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

Function BOOST_AUTO_TEST_CASE

src/test/policy_fee_tests.cpp:14–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12BOOST_AUTO_TEST_SUITE(policy_fee_tests)
13
14BOOST_AUTO_TEST_CASE(FeeRounder)
15{
16 FeeFilterRounder fee_rounder{CFeeRate{1000}};
17
18 // check that 1000 rounds to 974 or 1071
19 std::set<CAmount> results;
20 while (results.size() < 2) {
21 results.emplace(fee_rounder.round(1000));
22 }
23 BOOST_CHECK_EQUAL(*results.begin(), 974);
24 BOOST_CHECK_EQUAL(*++results.begin(), 1071);
25
26 // check that negative amounts rounds to 0
27 BOOST_CHECK_EQUAL(fee_rounder.round(-0), 0);
28 BOOST_CHECK_EQUAL(fee_rounder.round(-1), 0);
29
30 // check that MAX_MONEY rounds to 9170997
31 BOOST_CHECK_EQUAL(fee_rounder.round(MAX_MONEY), 9170997);
32}
33
34BOOST_AUTO_TEST_SUITE_END()

Callers

nothing calls this directly

Calls 3

roundMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected