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

Function TestVarInt

libs/coding/coding_tests/varint_test.cpp:31–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30template <typename T>
31void TestVarInt(T const x)
32{
33 vector<uint8_t> data;
34 PushBackByteSink<vector<uint8_t>> dst(data);
35 WriteVarInt(dst, x);
36
37 ArrayByteSource src(&data[0]);
38 TEST_EQUAL(ReadVarInt<T>(src), x, ());
39
40 size_t const bytesRead = src.PtrUint8() - data.data();
41 TEST_EQUAL(bytesRead, data.size(), (x));
42}
43} // namespace
44
45UNIT_TEST(VarUint0)

Callers 1

UNIT_TESTFunction · 0.85

Calls 4

WriteVarIntFunction · 0.85
PtrUint8Method · 0.80
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected