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

Function TestVarUint

libs/coding/coding_tests/varint_test.cpp:17–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15{
16template <typename T>
17void TestVarUint(T const x)
18{
19 vector<unsigned char> data;
20 PushBackByteSink<vector<uint8_t>> dst(data);
21 WriteVarUint(dst, x);
22
23 ArrayByteSource src(&data[0]);
24 TEST_EQUAL(ReadVarUint<T>(src), x, ());
25
26 size_t const bytesRead = src.PtrUint8() - data.data();
27 TEST_EQUAL(bytesRead, data.size(), (x));
28}
29
30template <typename T>
31void TestVarInt(T const x)

Callers 1

UNIT_TESTFunction · 0.85

Calls 4

WriteVarUintFunction · 0.85
PtrUint8Method · 0.80
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected