Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
tests: add varints_bitpatterns test #7849
The current tests for varint only check that serialization-deserialization is a roundtrip. That is a useful test, but it is also good to check for some exact bit patterns, to prevent a code change that changes the serialization format from going undetected (or a similar incompatibility between platforms).
As the varint functions are templated, also check with different types.
I wrote this test in the course of diagnosing #7848 and everything turned out to be good, but it makes sense anyhow.