Changeset View
Changeset View
Standalone View
Standalone View
src/test/coins_tests.cpp
Show First 20 Lines • Show All 576 Lines • ▼ Show 20 Lines | try { | ||||
BOOST_CHECK_MESSAGE(false, "We should have thrown"); | BOOST_CHECK_MESSAGE(false, "We should have thrown"); | ||||
} catch (const std::ios_base::failure &) { | } catch (const std::ios_base::failure &) { | ||||
} | } | ||||
// Very large scriptPubKey (3*10^9 bytes) past the end of the stream | // Very large scriptPubKey (3*10^9 bytes) past the end of the stream | ||||
CDataStream tmp(SER_DISK, CLIENT_VERSION); | CDataStream tmp(SER_DISK, CLIENT_VERSION); | ||||
uint64_t x = 3000000000ULL; | uint64_t x = 3000000000ULL; | ||||
tmp << VARINT(x); | tmp << VARINT(x); | ||||
BOOST_CHECK_EQUAL(HexStr(tmp.begin(), tmp.end()), "8a95c0bb00"); | BOOST_CHECK_EQUAL(HexStr(tmp), "8a95c0bb00"); | ||||
CDataStream ss5(ParseHex("00008a95c0bb00"), SER_DISK, CLIENT_VERSION); | CDataStream ss5(ParseHex("00008a95c0bb00"), SER_DISK, CLIENT_VERSION); | ||||
try { | try { | ||||
Coin c5; | Coin c5; | ||||
ss5 >> c5; | ss5 >> c5; | ||||
BOOST_CHECK_MESSAGE(false, "We should have thrown"); | BOOST_CHECK_MESSAGE(false, "We should have thrown"); | ||||
} catch (const std::ios_base::failure &) { | } catch (const std::ios_base::failure &) { | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 347 Lines • Show Last 20 Lines |