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

Function UNIT_TEST

libs/coding/coding_tests/geometry_coding_test.cpp:92–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90} // namespace
91
92UNIT_TEST(EncodePointDeltaAsUint)
93{
94 for (int x = -100; x <= 100; ++x)
95 {
96 for (int y = -100; y <= 100; ++y)
97 {
98 PU orig = PU(100 + x, 100 + y);
99 PU pred = PU(100, 100);
100 TEST_EQUAL(orig, DecodePointDeltaFromUint(EncodePointDeltaAsUint(orig, pred), pred), ());
101 vector<char> data;
102 PushBackByteSink<vector<char>> sink(data);
103 WriteVarUint(sink, EncodePointDeltaAsUint(orig, pred));
104 size_t expectedSize = 1;
105 if (x >= 8 || x < -8 || y >= 4 || y < -4)
106 expectedSize = 2;
107 if (x >= 64 || x < -64 || y >= 64 || y < -64)
108 expectedSize = 3;
109 TEST_EQUAL(data.size(), expectedSize, (x, y));
110 }
111 }
112}
113
114UNIT_TEST(PredictPointsInPolyline2)
115{

Callers

nothing calls this directly

Calls 13

DecodePointDeltaFromUintFunction · 0.85
EncodePointDeltaAsUintFunction · 0.85
WriteVarUintFunction · 0.85
PredictPointInPolylineFunction · 0.85
PredictPointInTriangleFunction · 0.85
TestEncodePolylineFunction · 0.85
TestPolylineEncodeFunction · 0.85
SimplifyPointsFunction · 0.70
D2UFunction · 0.70
GetMaxPointFunction · 0.70
sizeMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected