| 38 | } |
| 39 | |
| 40 | BOOST_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 | |
| 65 | BOOST_AUTO_TEST_CASE(compress_script_to_ckey_id) |
| 66 | { |
nothing calls this directly
no test coverage detected