mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 20:32:35 -03:00
[tests] Extend util_ParseMoney test case
This commit is contained in:
parent
9f33dba05c
commit
fa3a81af18
1 changed files with 5 additions and 0 deletions
|
@ -200,6 +200,8 @@ BOOST_AUTO_TEST_CASE(util_ParseMoney)
|
||||||
BOOST_CHECK_EQUAL(ret, COIN*10);
|
BOOST_CHECK_EQUAL(ret, COIN*10);
|
||||||
BOOST_CHECK(ParseMoney("1.00", ret));
|
BOOST_CHECK(ParseMoney("1.00", ret));
|
||||||
BOOST_CHECK_EQUAL(ret, COIN);
|
BOOST_CHECK_EQUAL(ret, COIN);
|
||||||
|
BOOST_CHECK(ParseMoney("1", ret));
|
||||||
|
BOOST_CHECK_EQUAL(ret, COIN);
|
||||||
BOOST_CHECK(ParseMoney("0.1", ret));
|
BOOST_CHECK(ParseMoney("0.1", ret));
|
||||||
BOOST_CHECK_EQUAL(ret, COIN/10);
|
BOOST_CHECK_EQUAL(ret, COIN/10);
|
||||||
BOOST_CHECK(ParseMoney("0.01", ret));
|
BOOST_CHECK(ParseMoney("0.01", ret));
|
||||||
|
@ -219,6 +221,9 @@ BOOST_AUTO_TEST_CASE(util_ParseMoney)
|
||||||
|
|
||||||
// Attempted 63 bit overflow should fail
|
// Attempted 63 bit overflow should fail
|
||||||
BOOST_CHECK(!ParseMoney("92233720368.54775808", ret));
|
BOOST_CHECK(!ParseMoney("92233720368.54775808", ret));
|
||||||
|
|
||||||
|
// Parsing negative amounts must fail
|
||||||
|
BOOST_CHECK(!ParseMoney("-1", ret));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(util_IsHex)
|
BOOST_AUTO_TEST_CASE(util_IsHex)
|
||||||
|
|
Loading…
Reference in a new issue