| 90 | } // namespace |
| 91 | |
| 92 | UNIT_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 | |
| 114 | UNIT_TEST(PredictPointsInPolyline2) |
| 115 | { |
nothing calls this directly
no test coverage detected