Update unit tests to accomodate changes in PolyArcLineSampler

This commit is contained in:
Jacob Støren
2019-11-18 10:29:53 +01:00
parent f0c127df27
commit 72cc643cd1

View File

@@ -14,7 +14,7 @@ TEST( RiaPolyArcLineSampler, Basic )
std::vector<double> mds; std::vector<double> mds;
sampler.sampledPointsAndMDs( 2, true, &sampledPoints, &mds ); sampler.sampledPointsAndMDs( 2, true, &sampledPoints, &mds );
#if 0 #if 1
for (size_t pIdx = 0; pIdx < sampledPoints.size(); ++pIdx) for (size_t pIdx = 0; pIdx < sampledPoints.size(); ++pIdx)
{ {
std::cout << sampledPoints[pIdx].x() << " " std::cout << sampledPoints[pIdx].x() << " "
@@ -22,14 +22,14 @@ TEST( RiaPolyArcLineSampler, Basic )
<< sampledPoints[pIdx].z() << " md: " << mds[pIdx] << std::endl; << sampledPoints[pIdx].z() << " md: " << mds[pIdx] << std::endl;
} }
#endif #endif
EXPECT_EQ( 27, (int)sampledPoints.size() ); EXPECT_EQ( 55, (int)sampledPoints.size() );
EXPECT_NEAR( 51.4159, mds.back(), 1e-4 ); EXPECT_NEAR( 51.4159, mds.back(), 1e-4 );
EXPECT_NEAR( points[2].y(), sampledPoints[12].y(), 2 ); EXPECT_NEAR( points[2].y(), sampledPoints[27].y(), 2 );
EXPECT_NEAR( points[2].z(), sampledPoints[12].z(), 2 ); EXPECT_NEAR( points[2].z(), sampledPoints[27].z(), 2 );
EXPECT_NEAR( points[4].y(), sampledPoints[25].y(), 2 ); EXPECT_NEAR( points[4].y(), sampledPoints.back().y(), 2 );
EXPECT_NEAR( points[4].z(), sampledPoints[25].z(), 2 ); EXPECT_NEAR( points[4].z(), sampledPoints.back().z(), 2 );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------