MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

generator/generator_tests/mini_roundabout_tests.cpp:66–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66UNIT_TEST(PointToPolygon_GeneralProperties)
67{
68 m2::PointD constexpr center(0.0, 0.0);
69 double constexpr r = 10.0;
70
71 std::array<double, 4> const anglesDeg{0.0, -30.0, 30.0, 45.0};
72
73 for (double const & angleDeg : anglesDeg)
74 {
75 for (size_t verticesCount = 3; verticesCount < 30; ++verticesCount)
76 {
77 std::vector<m2::PointD> const circlePlain = PointToPolygon(center, r, verticesCount, angleDeg);
78 double const vertexLenght = DistanceOnPlain(circlePlain.front(), circlePlain.back());
79
80 for (size_t i = 0; i < circlePlain.size() - 1; ++i)
81 {
82 double const rCurrent = DistanceOnPlain(circlePlain[i], center);
83 TEST(AlmostEqualAbs(rCurrent, r, kMwmPointAccuracy), ());
84
85 double const vertexLengthCurrent = DistanceOnPlain(circlePlain[i], circlePlain[i + 1]);
86 TEST(AlmostEqualAbs(vertexLengthCurrent, vertexLenght, kMwmPointAccuracy), ());
87 }
88 }
89 }
90}
91
92UNIT_TEST(TrimSegment_Vertical)
93{

Callers

nothing calls this directly

Calls 15

PointToPolygonFunction · 0.85
DistanceOnPlainFunction · 0.85
TESTFunction · 0.85
GetPointAtDistFromTargetFunction · 0.85
MetersToMercatorFunction · 0.85
TestRunCmpPointsFunction · 0.85
TestRunCmpNumbersFunction · 0.85
RoadNodeFunction · 0.85
MiniRoundaboutFunction · 0.85
AddPointToCircleFunction · 0.85
frontMethod · 0.80
backMethod · 0.80

Tested by

no test coverage detected