aboutsummaryrefslogtreecommitdiff
path: root/src/test/arith_uint256_tests.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-12-16 15:47:29 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-05 15:45:36 +0100
commit30007fda76aa7ba4e4090f7a16298874a7722926 (patch)
tree9b2a2e70e0ac9169aac94ea70a8d539d467c7874 /src/test/arith_uint256_tests.cpp
parentedc720479d0749a000d5a6970da6d2d72657cf38 (diff)
Remove now-unused methods from arith_uint256 and base_uint
- Methods that access the guts of arith_uint256 are removed, as these are incompatible between endians. Use uint256 instead - Serialization is no longer needed as arith_uint256's are never read or written - GetHash is never used on arith_uint256
Diffstat (limited to 'src/test/arith_uint256_tests.cpp')
-rw-r--r--src/test/arith_uint256_tests.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/test/arith_uint256_tests.cpp b/src/test/arith_uint256_tests.cpp
index e0c4b27259..6895367531 100644
--- a/src/test/arith_uint256_tests.cpp
+++ b/src/test/arith_uint256_tests.cpp
@@ -370,7 +370,7 @@ bool almostEqual(double d1, double d2)
return fabs(d1-d2) <= 4*fabs(d1)*std::numeric_limits<double>::epsilon();
}
-BOOST_AUTO_TEST_CASE( methods ) // GetHex SetHex begin() end() size() GetLow64 GetSerializeSize, Serialize, Unserialize
+BOOST_AUTO_TEST_CASE( methods ) // GetHex SetHex size() GetLow64 GetSerializeSize, Serialize, Unserialize
{
BOOST_CHECK(R1L.GetHex() == R1L.ToString());
BOOST_CHECK(R2L.GetHex() == R2L.ToString());
@@ -383,42 +383,13 @@ BOOST_AUTO_TEST_CASE( methods ) // GetHex SetHex begin() end() size() GetLow64 G
TmpL.SetHex(HalfL.ToString()); BOOST_CHECK(TmpL == HalfL);
TmpL.SetHex(R1L.ToString());
- BOOST_CHECK(memcmp(R1L.begin(), R1Array, 32)==0);
- BOOST_CHECK(memcmp(TmpL.begin(), R1Array, 32)==0);
- BOOST_CHECK(memcmp(R2L.begin(), R2Array, 32)==0);
- BOOST_CHECK(memcmp(ZeroL.begin(), ZeroArray, 32)==0);
- BOOST_CHECK(memcmp(OneL.begin(), OneArray, 32)==0);
BOOST_CHECK(R1L.size() == 32);
BOOST_CHECK(R2L.size() == 32);
BOOST_CHECK(ZeroL.size() == 32);
BOOST_CHECK(MaxL.size() == 32);
- BOOST_CHECK(R1L.begin() + 32 == R1L.end());
- BOOST_CHECK(R2L.begin() + 32 == R2L.end());
- BOOST_CHECK(OneL.begin() + 32 == OneL.end());
- BOOST_CHECK(MaxL.begin() + 32 == MaxL.end());
- BOOST_CHECK(TmpL.begin() + 32 == TmpL.end());
BOOST_CHECK(R1L.GetLow64() == R1LLow64);
BOOST_CHECK(HalfL.GetLow64() ==0x0000000000000000ULL);
BOOST_CHECK(OneL.GetLow64() ==0x0000000000000001ULL);
- BOOST_CHECK(R1L.GetSerializeSize(0,PROTOCOL_VERSION) == 32);
- BOOST_CHECK(ZeroL.GetSerializeSize(0,PROTOCOL_VERSION) == 32);
-
- std::stringstream ss;
- R1L.Serialize(ss,0,PROTOCOL_VERSION);
- BOOST_CHECK(ss.str() == std::string(R1Array,R1Array+32));
- TmpL.Unserialize(ss,0,PROTOCOL_VERSION);
- BOOST_CHECK(R1L == TmpL);
- ss.str("");
- ZeroL.Serialize(ss,0,PROTOCOL_VERSION);
- BOOST_CHECK(ss.str() == std::string(ZeroArray,ZeroArray+32));
- TmpL.Unserialize(ss,0,PROTOCOL_VERSION);
- BOOST_CHECK(ZeroL == TmpL);
- ss.str("");
- MaxL.Serialize(ss,0,PROTOCOL_VERSION);
- BOOST_CHECK(ss.str() == std::string(MaxArray,MaxArray+32));
- TmpL.Unserialize(ss,0,PROTOCOL_VERSION);
- BOOST_CHECK(MaxL == TmpL);
- ss.str("");
for (unsigned int i = 0; i < 255; ++i)
{