mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4683 clang-format on all files in ApplicationCode
This commit is contained in:
@@ -4,16 +4,16 @@
|
||||
#include <iostream>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST(RiaPolyArcLineSampler, Basic)
|
||||
TEST( RiaPolyArcLineSampler, Basic )
|
||||
{
|
||||
std::vector<cvf::Vec3d> points{{0, 0, 0}, {0, 0, -10}, {0, 10, -20}, {0, 20, -20}, {0, 30, -30}};
|
||||
|
||||
RiaPolyArcLineSampler sampler({0, 0, -1}, points);
|
||||
RiaPolyArcLineSampler sampler( {0, 0, -1}, points );
|
||||
|
||||
std::vector<cvf::Vec3d> sampledPoints;
|
||||
std::vector<double> mds;
|
||||
|
||||
sampler.sampledPointsAndMDs(2, true, &sampledPoints, &mds);
|
||||
sampler.sampledPointsAndMDs( 2, true, &sampledPoints, &mds );
|
||||
#if 0
|
||||
for (size_t pIdx = 0; pIdx < sampledPoints.size(); ++pIdx)
|
||||
{
|
||||
@@ -22,56 +22,56 @@ TEST(RiaPolyArcLineSampler, Basic)
|
||||
<< sampledPoints[pIdx].z() << " md: " << mds[pIdx] << std::endl;
|
||||
}
|
||||
#endif
|
||||
EXPECT_EQ(27, (int)sampledPoints.size());
|
||||
EXPECT_NEAR(51.4159, mds.back(), 1e-4);
|
||||
EXPECT_EQ( 27, (int)sampledPoints.size() );
|
||||
EXPECT_NEAR( 51.4159, mds.back(), 1e-4 );
|
||||
|
||||
EXPECT_NEAR(points[2].y(), sampledPoints[12].y(), 2);
|
||||
EXPECT_NEAR(points[2].z(), sampledPoints[12].z(), 2);
|
||||
EXPECT_NEAR( points[2].y(), sampledPoints[12].y(), 2 );
|
||||
EXPECT_NEAR( points[2].z(), sampledPoints[12].z(), 2 );
|
||||
|
||||
EXPECT_NEAR(points[4].y(), sampledPoints[25].y(), 2);
|
||||
EXPECT_NEAR(points[4].z(), sampledPoints[25].z(), 2);
|
||||
EXPECT_NEAR( points[4].y(), sampledPoints[25].y(), 2 );
|
||||
EXPECT_NEAR( points[4].z(), sampledPoints[25].z(), 2 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST(RiaPolyArcLineSampler, TestInvalidInput)
|
||||
TEST( RiaPolyArcLineSampler, TestInvalidInput )
|
||||
{
|
||||
{
|
||||
// Two identical points after each other
|
||||
std::vector<cvf::Vec3d> points{{0, 0, -20}, {0, 0, -20}};
|
||||
|
||||
RiaPolyArcLineSampler sampler({0, 0, -1}, points);
|
||||
RiaPolyArcLineSampler sampler( {0, 0, -1}, points );
|
||||
|
||||
std::vector<cvf::Vec3d> sampledPoints;
|
||||
std::vector<double> mds;
|
||||
|
||||
sampler.sampledPointsAndMDs(2, true, &sampledPoints, &mds);
|
||||
sampler.sampledPointsAndMDs( 2, true, &sampledPoints, &mds );
|
||||
|
||||
EXPECT_EQ(0, (int)sampledPoints.size());
|
||||
EXPECT_EQ( 0, (int)sampledPoints.size() );
|
||||
}
|
||||
|
||||
{
|
||||
std::vector<cvf::Vec3d> points;
|
||||
|
||||
RiaPolyArcLineSampler sampler({0, 0, -1}, points);
|
||||
RiaPolyArcLineSampler sampler( {0, 0, -1}, points );
|
||||
|
||||
std::vector<cvf::Vec3d> sampledPoints;
|
||||
std::vector<double> mds;
|
||||
|
||||
sampler.sampledPointsAndMDs(2, true, &sampledPoints, &mds);
|
||||
sampler.sampledPointsAndMDs( 2, true, &sampledPoints, &mds );
|
||||
|
||||
EXPECT_EQ(0, (int)sampledPoints.size());
|
||||
EXPECT_EQ( 0, (int)sampledPoints.size() );
|
||||
}
|
||||
|
||||
{
|
||||
std::vector<cvf::Vec3d> points{{0, 0, 0}};
|
||||
|
||||
RiaPolyArcLineSampler sampler({0, 0, -1}, points);
|
||||
RiaPolyArcLineSampler sampler( {0, 0, -1}, points );
|
||||
|
||||
std::vector<cvf::Vec3d> sampledPoints;
|
||||
std::vector<double> mds;
|
||||
|
||||
sampler.sampledPointsAndMDs(2, true, &sampledPoints, &mds);
|
||||
sampler.sampledPointsAndMDs( 2, true, &sampledPoints, &mds );
|
||||
|
||||
EXPECT_EQ(0, (int)sampledPoints.size());
|
||||
EXPECT_EQ( 0, (int)sampledPoints.size() );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user