heremaps / flexible-polyline

Flexible Polyline encoding: a lossy compressed representation of a list of coordinate pairs or triples
MIT License
89 stars 76 forks source link

Update flexpolyline.h #40

Closed oyefremov closed 4 months ago

oyefremov commented 3 years ago

Function MUST write to out parameter on success, it was missing for last return true. On the other hand we must never reach this line on a valid data. In can happens only when decoding empty string.

Suggested test:

TEST(decode_unsigned_varint, empty_string){ uint32_t index = 0; int64_t result = 123456789; // initialized with random data EXPECT_FALSE(decode_unsigned_varint("", index, 0, result); EXPECT_EQ(index, 0); EXPECT_EQ(result, 123456789); // no writes to result on failure }

VeaaC commented 3 years ago

Would the full re-write https://github.com/heremaps/flexible-polyline/pull/38 also address your problems?

VeaaC commented 4 months ago

Closing this, as the C++ implementation has been completely rewritten since then