MCPcopy Create free account
hub / github.com/ElementsProject/elements / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

src/test/compress_tests.cpp:40–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40BOOST_AUTO_TEST_CASE(compress_amounts)
41{
42 BOOST_CHECK(TestPair( 0, 0x0));
43 BOOST_CHECK(TestPair( 1, 0x1));
44 BOOST_CHECK(TestPair( CENT, 0x7));
45 BOOST_CHECK(TestPair( COIN, 0x9));
46 BOOST_CHECK(TestPair( 50*COIN, 0x32));
47 BOOST_CHECK(TestPair(21000000*COIN, 0x1406f40));
48
49 for (uint64_t i = 1; i <= NUM_MULTIPLES_UNIT; i++)
50 BOOST_CHECK(TestEncode(i));
51
52 for (uint64_t i = 1; i <= NUM_MULTIPLES_CENT; i++)
53 BOOST_CHECK(TestEncode(i * CENT));
54
55 for (uint64_t i = 1; i <= NUM_MULTIPLES_1BTC; i++)
56 BOOST_CHECK(TestEncode(i * COIN));
57
58 for (uint64_t i = 1; i <= NUM_MULTIPLES_50BTC; i++)
59 BOOST_CHECK(TestEncode(i * 50 * COIN));
60
61 for (uint64_t i = 0; i < 100000; i++)
62 BOOST_CHECK(TestDecode(i));
63}
64
65BOOST_AUTO_TEST_CASE(compress_script_to_ckey_id)
66{

Callers

nothing calls this directly

Calls 12

TestPairFunction · 0.85
TestEncodeFunction · 0.85
TestDecodeFunction · 0.85
ToByteVectorFunction · 0.85
CompressScriptFunction · 0.85
CScriptIDClass · 0.85
MakeNewKeyMethod · 0.80
CScriptClass · 0.50
GetPubKeyMethod · 0.45
GetIDMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected