Changeset View
Changeset View
Standalone View
Standalone View
src/test/amount_tests.cpp
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(AmountTests) { | ||||
BOOST_CHECK_EQUAL(2 * COIN + COIN, 3 * COIN); | BOOST_CHECK_EQUAL(2 * COIN + COIN, 3 * COIN); | ||||
BOOST_CHECK_EQUAL(-1 * COIN + COIN, Amount::zero()); | BOOST_CHECK_EQUAL(-1 * COIN + COIN, Amount::zero()); | ||||
BOOST_CHECK_EQUAL(COIN - COIN, Amount::zero()); | BOOST_CHECK_EQUAL(COIN - COIN, Amount::zero()); | ||||
BOOST_CHECK_EQUAL(COIN - 2 * COIN, -1 * COIN); | BOOST_CHECK_EQUAL(COIN - 2 * COIN, -1 * COIN); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(MoneyRangeTest) { | BOOST_AUTO_TEST_CASE(MoneyRangeTest) { | ||||
BOOST_CHECK_EQUAL(MoneyRange(Amount(-1 * SATOSHI)), false); | BOOST_CHECK_EQUAL(MoneyRange(-SATOSHI), false); | ||||
BOOST_CHECK_EQUAL(MoneyRange(MAX_MONEY + Amount(1 * SATOSHI)), false); | BOOST_CHECK_EQUAL(MoneyRange(Amount::zero()), true); | ||||
BOOST_CHECK_EQUAL(MoneyRange(Amount(1 * SATOSHI)), true); | BOOST_CHECK_EQUAL(MoneyRange(SATOSHI), true); | ||||
BOOST_CHECK_EQUAL(MoneyRange(MAX_MONEY), true); | |||||
BOOST_CHECK_EQUAL(MoneyRange(MAX_MONEY + SATOSHI), false); | |||||
} | } | ||||
BOOST_AUTO_TEST_CASE(BinaryOperatorTest) { | BOOST_AUTO_TEST_CASE(BinaryOperatorTest) { | ||||
CFeeRate a, b; | CFeeRate a, b; | ||||
a = CFeeRate(1 * SATOSHI); | a = CFeeRate(1 * SATOSHI); | ||||
b = CFeeRate(2 * SATOSHI); | b = CFeeRate(2 * SATOSHI); | ||||
BOOST_CHECK(a < b); | BOOST_CHECK(a < b); | ||||
BOOST_CHECK(b > a); | BOOST_CHECK(b > a); | ||||
Show All 17 Lines |