- Timestamp:
- Aug 20, 2014, 1:06:16 PM (11 years ago)
- Children:
- ef3885
- Parents:
- 1cde4e8
- git-author:
- Frederik Heber <heber@…> (07/09/14 22:08:37)
- git-committer:
- Frederik Heber <heber@…> (08/20/14 13:06:16)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp
r1cde4e8 ra2f8a9 68 68 CPPUNIT_TEST_SUITE_REGISTRATION( SphericalPointDistributionTest ); 69 69 70 /** due to root-taking in function we only have limited numerical precision, 71 * basically half of the double range. 72 */ 73 const double CenterAccuracy = sqrt(std::numeric_limits<double>::epsilon()*1e2); 70 74 71 75 void SphericalPointDistributionTest::setUp() … … 82 86 } 83 87 84 85 /** UnitTest for matchSphericalPointDistributions() with two points 88 /** UnitTest for calculateCenterOfMinimumDistance() 86 89 */ 87 void SphericalPointDistributionTest:: matchSphericalPointDistributionsTest_2()90 void SphericalPointDistributionTest::calculateCenterOfMinimumDistanceTest() 88 91 { 89 SphericalPointDistribution SPD(1.); 90 // test with one point, matching trivially 91 { 92 SphericalPointDistribution::WeightedPolygon_t polygon; 93 polygon += std::make_pair(Vector(1.,0.,0.), 1); 94 SphericalPointDistribution::Polygon_t newpolygon = 95 SPD.get<2>(); 96 SphericalPointDistribution::Polygon_t expected; 97 expected += Vector(-1.,0.,0.); 98 SphericalPointDistribution::Polygon_t remaining = 99 SphericalPointDistribution::matchSphericalPointDistributions( 100 polygon, 101 newpolygon); 102 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 103 } 104 105 // test with one point, just a flip of axis 106 { 107 SphericalPointDistribution::WeightedPolygon_t polygon; 108 polygon += std::make_pair( Vector(0.,1.,0.), 1); 109 SphericalPointDistribution::Polygon_t newpolygon = 110 SPD.get<2>(); 111 SphericalPointDistribution::Polygon_t expected; 112 expected += Vector(0.,-1.,0.); 113 SphericalPointDistribution::Polygon_t remaining = 114 SphericalPointDistribution::matchSphericalPointDistributions( 115 polygon, 116 newpolygon); 117 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 118 } 119 120 // test with one point, just a flip to another axis 121 { 122 SphericalPointDistribution::WeightedPolygon_t polygon; 123 polygon += std::make_pair( Vector(0.,0.,-1.), 1); 124 SphericalPointDistribution::Polygon_t newpolygon = 125 SPD.get<2>(); 126 SphericalPointDistribution::Polygon_t expected; 127 expected += Vector(0.,0.,1.); 128 SphericalPointDistribution::Polygon_t remaining = 129 SphericalPointDistribution::matchSphericalPointDistributions( 130 polygon, 131 newpolygon); 132 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 133 } 134 135 // test with one point, full rotation 136 { 137 Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248)); 138 SphericalPointDistribution::WeightedPolygon_t polygon; 139 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 140 SphericalPointDistribution::Polygon_t newpolygon = 141 SPD.get<2>(); 142 SphericalPointDistribution::Polygon_t expected; 143 expected += RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI); 144 SphericalPointDistribution::Polygon_t remaining = 145 SphericalPointDistribution::matchSphericalPointDistributions( 146 polygon, 147 newpolygon); 148 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 149 } 150 } 151 152 void perturbPolygon( 153 SphericalPointDistribution::WeightedPolygon_t &_polygon, 154 double _amplitude 155 ) 156 { 157 for (SphericalPointDistribution::WeightedPolygon_t::iterator iter = _polygon.begin(); 158 iter != _polygon.end(); ++iter) { 159 Vector perturber; 160 perturber.GetOneNormalVector(iter->first); 161 perturber.Scale(_amplitude); 162 iter->first = iter->first + perturber; 163 (iter->first).Normalize(); 92 // single point 93 { 94 SphericalPointDistribution::VectorArray_t points; 95 points += 96 Vector(1.,0.,0.); 97 SphericalPointDistribution::IndexList_t indices; 98 indices += 0; 99 const Vector expected = points[0]; 100 const Vector center = 101 SphericalPointDistribution::calculateCenterOfMinimumDistance(points, indices); 102 // std::cout << " Difference is " << (expected - center).Norm() << std::endl; 103 // CPPUNIT_ASSERT_EQUAL ( expected, center ); 104 CPPUNIT_ASSERT( expected.IsEqualTo(center, CenterAccuracy)); 105 } 106 107 // single point, rotated 108 { 109 Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248)); 110 SphericalPointDistribution::VectorArray_t points; 111 points += 112 RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI); 113 SphericalPointDistribution::IndexList_t indices; 114 indices += 0; 115 const Vector expected = points[0]; 116 const Vector center = 117 SphericalPointDistribution::calculateCenterOfMinimumDistance(points, indices); 118 // std::cout << " Difference is " << (expected - center).Norm() << std::endl; 119 // CPPUNIT_ASSERT_EQUAL ( expected, center ); 120 CPPUNIT_ASSERT( expected.IsEqualTo(center, CenterAccuracy)); 121 } 122 123 // two points 124 { 125 SphericalPointDistribution::VectorArray_t points; 126 points += 127 Vector(1.,0.,0.), 128 Vector(0.,1.,0.); 129 SphericalPointDistribution::IndexList_t indices; 130 indices += 0,1; 131 const Vector expected = Vector(M_SQRT1_2,M_SQRT1_2,0.); 132 const Vector center = 133 SphericalPointDistribution::calculateCenterOfMinimumDistance(points, indices); 134 // std::cout << " Difference is " << (expected - center).Norm() << std::endl; 135 // CPPUNIT_ASSERT_EQUAL ( expected, center ); 136 CPPUNIT_ASSERT( expected.IsEqualTo(center, CenterAccuracy)); 137 } 138 139 // two points, rotated 140 { 141 Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248)); 142 SphericalPointDistribution::VectorArray_t points; 143 points += 144 RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 145 RotationAxis.rotateVector(Vector(0.,1.,0.), 47.6/180*M_PI); 146 SphericalPointDistribution::IndexList_t indices; 147 indices += 0,1; 148 const Vector expected = RotationAxis.rotateVector(Vector(M_SQRT1_2,M_SQRT1_2,0.), 47.6/180*M_PI); 149 const Vector center = 150 SphericalPointDistribution::calculateCenterOfMinimumDistance(points, indices); 151 // std::cout << " Difference is " << (expected - center).Norm() << std::endl; 152 // CPPUNIT_ASSERT_EQUAL ( expected, center ); 153 CPPUNIT_ASSERT( expected.IsEqualTo(center, CenterAccuracy)); 154 } 155 156 // three points in line 157 { 158 SphericalPointDistribution::VectorArray_t points; 159 points += 160 Vector(1.,0.,0.), 161 Vector(0.,1.,0.), 162 Vector(-1.,0.,0.); 163 SphericalPointDistribution::IndexList_t indices; 164 indices += 0,1,2; 165 const Vector expected = points[1]; 166 const Vector center = 167 SphericalPointDistribution::calculateCenterOfMinimumDistance(points, indices); 168 // std::cout << " Difference is " << (expected - center).Norm() << std::endl; 169 // CPPUNIT_ASSERT_EQUAL ( expected, center ); 170 CPPUNIT_ASSERT( expected.IsEqualTo(center, CenterAccuracy)); 171 } 172 173 // three points in line, rotated 174 { 175 Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248)); 176 SphericalPointDistribution::VectorArray_t points; 177 points += 178 RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 179 RotationAxis.rotateVector(Vector(0.,1.,0.), 47.6/180*M_PI), 180 RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI); 181 SphericalPointDistribution::IndexList_t indices; 182 indices += 0,1,2; 183 const Vector expected = points[1]; 184 const Vector center = 185 SphericalPointDistribution::calculateCenterOfMinimumDistance(points, indices); 186 // std::cout << " Difference is " << (expected - center).Norm() << std::endl; 187 // CPPUNIT_ASSERT_EQUAL ( expected, center ); 188 CPPUNIT_ASSERT( expected.IsEqualTo(center, CenterAccuracy)); 164 189 } 165 190 } … … 180 205 SphericalPointDistribution::Polygon_t::const_iterator otheriter = _otherpolygon.begin(); 181 206 for (; iter != _polygon.end(); ++iter, ++otheriter) { 182 status &= (*iter - *otheriter).Norm() < _amplitude;207 status &= (*iter).IsEqualTo(*otheriter, _amplitude); 183 208 } 184 209 return status; … … 242 267 expected += Vector(0.,1.,0.); 243 268 CPPUNIT_ASSERT( !areEqualToWithinBounds(polygon, expected, 0.05) ); 269 } 270 } 271 272 /** UnitTest for matchSphericalPointDistributions() with two points 273 */ 274 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_2() 275 { 276 SphericalPointDistribution SPD(1.); 277 // test with one point, matching trivially 278 { 279 SphericalPointDistribution::WeightedPolygon_t polygon; 280 polygon += std::make_pair(Vector(1.,0.,0.), 1); 281 SphericalPointDistribution::Polygon_t newpolygon = 282 SPD.get<2>(); 283 SphericalPointDistribution::Polygon_t expected; 284 expected += Vector(-1.,0.,0.); 285 SphericalPointDistribution::Polygon_t remaining = 286 SphericalPointDistribution::matchSphericalPointDistributions( 287 polygon, 288 newpolygon); 289 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 290 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 291 } 292 293 // test with one point, just a flip of axis 294 { 295 SphericalPointDistribution::WeightedPolygon_t polygon; 296 polygon += std::make_pair( Vector(0.,1.,0.), 1); 297 SphericalPointDistribution::Polygon_t newpolygon = 298 SPD.get<2>(); 299 SphericalPointDistribution::Polygon_t expected; 300 expected += Vector(0.,-1.,0.); 301 SphericalPointDistribution::Polygon_t remaining = 302 SphericalPointDistribution::matchSphericalPointDistributions( 303 polygon, 304 newpolygon); 305 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 306 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 307 } 308 309 // test with one point, just a flip to another axis 310 { 311 SphericalPointDistribution::WeightedPolygon_t polygon; 312 polygon += std::make_pair( Vector(0.,0.,-1.), 1); 313 SphericalPointDistribution::Polygon_t newpolygon = 314 SPD.get<2>(); 315 SphericalPointDistribution::Polygon_t expected; 316 expected += Vector(0.,0.,1.); 317 SphericalPointDistribution::Polygon_t remaining = 318 SphericalPointDistribution::matchSphericalPointDistributions( 319 polygon, 320 newpolygon); 321 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 322 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 323 } 324 325 // test with one point, full rotation 326 { 327 Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248)); 328 SphericalPointDistribution::WeightedPolygon_t polygon; 329 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 330 SphericalPointDistribution::Polygon_t newpolygon = 331 SPD.get<2>(); 332 SphericalPointDistribution::Polygon_t expected; 333 expected += RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI); 334 SphericalPointDistribution::Polygon_t remaining = 335 SphericalPointDistribution::matchSphericalPointDistributions( 336 polygon, 337 newpolygon); 338 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 339 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 340 } 341 } 342 343 void perturbPolygon( 344 SphericalPointDistribution::WeightedPolygon_t &_polygon, 345 double _amplitude 346 ) 347 { 348 for (SphericalPointDistribution::WeightedPolygon_t::iterator iter = _polygon.begin(); 349 iter != _polygon.end(); ++iter) { 350 Vector perturber; 351 perturber.GetOneNormalVector(iter->first); 352 perturber.Scale(_amplitude); 353 iter->first = iter->first + perturber; 354 (iter->first).Normalize(); 244 355 } 245 356 } … … 367 478 polygon, 368 479 newpolygon); 369 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 480 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 481 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 370 482 } 371 483 … … 387 499 polygon, 388 500 newpolygon); 389 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 501 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 502 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 390 503 } 391 504 … … 404 517 polygon, 405 518 newpolygon); 406 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 519 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 520 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 407 521 // also slightly perturbed 408 522 const double amplitude = 0.05; … … 429 543 polygon, 430 544 newpolygon); 431 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 545 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 546 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 432 547 // also slightly perturbed 433 548 const double amplitude = 0.05; … … 449 564 polygon, 450 565 newpolygon); 451 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 566 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 567 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 452 568 // also slightly perturbed 453 569 const double amplitude = 0.05; … … 471 587 polygon, 472 588 newpolygon); 473 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 589 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 590 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 474 591 // also slightly perturbed 475 592 const double amplitude = 0.05; … … 497 614 polygon, 498 615 newpolygon); 499 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 616 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 617 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 500 618 } 501 619 … … 517 635 polygon, 518 636 newpolygon); 519 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 637 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 638 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 520 639 } 521 640 … … 534 653 polygon, 535 654 newpolygon); 536 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 655 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 656 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 537 657 // also slightly perturbed 538 658 const double amplitude = 0.05; … … 555 675 polygon, 556 676 newpolygon); 557 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 677 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 678 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 558 679 // also slightly perturbed 559 680 const double amplitude = 0.05; … … 580 701 polygon, 581 702 newpolygon); 582 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 703 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 704 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 583 705 // also slightly perturbed 584 706 const double amplitude = 0.05; … … 603 725 polygon, 604 726 newpolygon); 605 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 727 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 728 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 606 729 // also slightly perturbed 607 730 const double amplitude = 0.05; … … 630 753 polygon, 631 754 newpolygon); 632 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 755 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 756 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 633 757 // also slightly perturbed 634 758 const double amplitude = 0.05; … … 659 783 newpolygon); 660 784 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 661 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 785 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 786 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 662 787 } 663 788 … … 677 802 newpolygon); 678 803 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 679 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 804 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 805 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 680 806 } 681 807 … … 696 822 newpolygon); 697 823 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 698 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 824 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 825 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 699 826 } 700 827 … … 714 841 newpolygon); 715 842 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 716 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 843 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 844 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 717 845 } 718 846 } … … 736 864 polygon, 737 865 newpolygon); 738 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 866 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 867 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 739 868 } 740 869 … … 756 885 polygon, 757 886 newpolygon); 758 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 887 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 888 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 759 889 } 760 890 … … 773 903 polygon, 774 904 newpolygon); 775 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 905 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 906 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 776 907 // also slightly perturbed 777 908 const double amplitude = 0.05; … … 827 958 polygon, 828 959 newpolygon); 829 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 960 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 961 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 830 962 // also slightly perturbed 831 963 const double amplitude = 0.05; … … 854 986 polygon, 855 987 newpolygon); 856 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 988 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 989 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 857 990 // also slightly perturbed 858 991 const double amplitude = 0.05; … … 880 1013 polygon, 881 1014 newpolygon); 882 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1015 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1016 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 883 1017 } 884 1018 … … 900 1034 polygon, 901 1035 newpolygon); 902 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1036 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1037 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 903 1038 } 904 1039 … … 917 1052 polygon, 918 1053 newpolygon); 919 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1054 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1055 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 920 1056 // also slightly perturbed 921 1057 const double amplitude = 0.05; … … 971 1107 polygon, 972 1108 newpolygon); 973 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1109 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1110 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 974 1111 // also slightly perturbed 975 1112 const double amplitude = 0.05; … … 998 1135 polygon, 999 1136 newpolygon); 1000 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1137 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1138 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1001 1139 // also slightly perturbed 1002 1140 const double amplitude = 0.05; … … 1024 1162 polygon, 1025 1163 newpolygon); 1026 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1164 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1165 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1027 1166 } 1028 1167 … … 1044 1183 polygon, 1045 1184 newpolygon); 1046 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1185 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1186 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1047 1187 } 1048 1188 … … 1061 1201 polygon, 1062 1202 newpolygon); 1063 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1203 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1204 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1064 1205 // also slightly perturbed 1065 1206 const double amplitude = 0.05; … … 1115 1256 polygon, 1116 1257 newpolygon); 1117 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1258 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1259 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1118 1260 // also slightly perturbed 1119 1261 const double amplitude = 0.05; … … 1142 1284 polygon, 1143 1285 newpolygon); 1144 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1286 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1287 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1145 1288 // also slightly perturbed 1146 1289 const double amplitude = 0.05; … … 1168 1311 polygon, 1169 1312 newpolygon); 1170 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1313 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1314 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1171 1315 } 1172 1316 … … 1188 1332 polygon, 1189 1333 newpolygon); 1190 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1334 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1335 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1191 1336 } 1192 1337 … … 1205 1350 polygon, 1206 1351 newpolygon); 1207 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1352 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1353 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1208 1354 // also slightly perturbed 1209 1355 const double amplitude = 0.05; … … 1263 1409 polygon, 1264 1410 newpolygon); 1265 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1411 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1412 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1266 1413 // also slightly perturbed 1267 1414 const double amplitude = 0.05; … … 1290 1437 polygon, 1291 1438 newpolygon); 1292 CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1439 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1440 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1293 1441 // also slightly perturbed 1294 1442 const double amplitude = 0.05;
Note:
See TracChangeset
for help on using the changeset viewer.
