mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-18 18:15:50 +00:00
Add test for size_varint
This commit is contained in:
committed by
Nikolaos D. Bougalis
parent
7ff6d34a49
commit
d8bbcf21be
@@ -35,17 +35,12 @@ public:
|
||||
testcase("encode, decode");
|
||||
for (auto const v : vv)
|
||||
{
|
||||
std::array<std::uint8_t,
|
||||
varint_traits<
|
||||
std::size_t>::max> vi;
|
||||
auto const n0 =
|
||||
write_varint(
|
||||
vi.data(), v);
|
||||
std::array<std::uint8_t, varint_traits<std::size_t>::max> vi;
|
||||
auto const n0 = write_varint(vi.data(), v);
|
||||
expect (n0 > 0, "write error");
|
||||
expect(n0 == size_varint(v), "size error");
|
||||
std::size_t v1;
|
||||
auto const n1 =
|
||||
read_varint(
|
||||
vi.data(), n0, v1);
|
||||
auto const n1 = read_varint(vi.data(), n0, v1);
|
||||
expect(n1 == n0, "read error");
|
||||
expect(v == v1, "wrong value");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user