diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2016-10-28 16:51:33 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-11-07 13:56:22 -0800 |
commit | 657e05ab2e87ff725723fe8a375fc3f8aad02126 (patch) | |
tree | e20cebbde1dee31d6d21dccdaa2223a5ca1566e3 /src/test | |
parent | fad9b66504f176ed3624515f3bf4d428cf687607 (diff) |
Make GetSerializeSize a wrapper on top of CSizeComputer
Given that in default GetSerializeSize implementations created by
ADD_SERIALIZE_METHODS we're already using CSizeComputer(), get rid
of the specialized GetSerializeSize methods everywhere, and just use
CSizeComputer. This removes a lot of code which isn't actually used
anywhere.
For CCompactSize and CVarInt this actually removes a more efficient
size computing algorithm, which is brought back in a later commit.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/uint256_tests.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/uint256_tests.cpp b/src/test/uint256_tests.cpp index da0a3d73e0..ba8eb16ba9 100644 --- a/src/test/uint256_tests.cpp +++ b/src/test/uint256_tests.cpp @@ -184,8 +184,8 @@ BOOST_AUTO_TEST_CASE( methods ) // GetHex SetHex begin() end() size() GetLow64 G BOOST_CHECK(OneL.begin() + 32 == OneL.end()); BOOST_CHECK(MaxL.begin() + 32 == MaxL.end()); BOOST_CHECK(TmpL.begin() + 32 == TmpL.end()); - BOOST_CHECK(R1L.GetSerializeSize(0,PROTOCOL_VERSION) == 32); - BOOST_CHECK(ZeroL.GetSerializeSize(0,PROTOCOL_VERSION) == 32); + BOOST_CHECK(GetSerializeSize(R1L, 0, PROTOCOL_VERSION) == 32); + BOOST_CHECK(GetSerializeSize(ZeroL, 0, PROTOCOL_VERSION) == 32); std::stringstream ss; R1L.Serialize(ss,0,PROTOCOL_VERSION); @@ -230,8 +230,8 @@ BOOST_AUTO_TEST_CASE( methods ) // GetHex SetHex begin() end() size() GetLow64 G BOOST_CHECK(OneS.begin() + 20 == OneS.end()); BOOST_CHECK(MaxS.begin() + 20 == MaxS.end()); BOOST_CHECK(TmpS.begin() + 20 == TmpS.end()); - BOOST_CHECK(R1S.GetSerializeSize(0,PROTOCOL_VERSION) == 20); - BOOST_CHECK(ZeroS.GetSerializeSize(0,PROTOCOL_VERSION) == 20); + BOOST_CHECK(GetSerializeSize(R1S, 0, PROTOCOL_VERSION) == 20); + BOOST_CHECK(GetSerializeSize(ZeroS, 0, PROTOCOL_VERSION) == 20); R1S.Serialize(ss,0,PROTOCOL_VERSION); BOOST_CHECK(ss.str() == std::string(R1Array,R1Array+20)); |