MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / 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_1BTG; i++)
56 BOOST_CHECK(TestEncode(i * COIN));
57
58 for (uint64_t i = 1; i <= NUM_MULTIPLES_50BTG; 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_SUITE_END()

Callers

nothing calls this directly

Calls 3

TestPairFunction · 0.85
TestEncodeFunction · 0.85
TestDecodeFunction · 0.85

Tested by

no test coverage detected