From d8bbcf21be73f16622973237d5bb24c2fcf6ee28 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 2 Nov 2017 15:36:39 -0400 Subject: [PATCH] Add test for size_varint --- src/test/nodestore/varint_test.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/test/nodestore/varint_test.cpp b/src/test/nodestore/varint_test.cpp index c7b3256f3..e2f8c1f46 100644 --- a/src/test/nodestore/varint_test.cpp +++ b/src/test/nodestore/varint_test.cpp @@ -35,17 +35,12 @@ public: testcase("encode, decode"); for (auto const v : vv) { - std::array::max> vi; - auto const n0 = - write_varint( - vi.data(), v); + std::array::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"); }