mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
test: Fix failing univalue float test
This commit is contained in:
parent
07720b1cdd
commit
fa4c69669e
2 changed files with 2 additions and 1 deletions
|
@ -291,6 +291,7 @@ BOOST_AUTO_TEST_CASE(rpc_parse_monetary_values)
|
||||||
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("1e-8")), COIN/100000000);
|
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("1e-8")), COIN/100000000);
|
||||||
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.1e-7")), COIN/100000000);
|
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.1e-7")), COIN/100000000);
|
||||||
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.01e-6")), COIN/100000000);
|
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.01e-6")), COIN/100000000);
|
||||||
|
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.00000000000000000000000000000000000001e+30")), 1);
|
||||||
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.0000000000000000000000000000000000000000000000000000000000000000000000000001e+68")), COIN/100000000);
|
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.0000000000000000000000000000000000000000000000000000000000000000000000000001e+68")), COIN/100000000);
|
||||||
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("10000000000000000000000000000000000000000000000000000000000000000e-64")), COIN);
|
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("10000000000000000000000000000000000000000000000000000000000000000e-64")), COIN);
|
||||||
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000e64")), COIN);
|
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000e64")), COIN);
|
||||||
|
|
|
@ -421,7 +421,7 @@ void univalue_readwrite()
|
||||||
// Valid, with leading or trailing whitespace
|
// Valid, with leading or trailing whitespace
|
||||||
BOOST_CHECK(v.read(" 1.0") && (v.get_real() == 1.0));
|
BOOST_CHECK(v.read(" 1.0") && (v.get_real() == 1.0));
|
||||||
BOOST_CHECK(v.read("1.0 ") && (v.get_real() == 1.0));
|
BOOST_CHECK(v.read("1.0 ") && (v.get_real() == 1.0));
|
||||||
BOOST_CHECK(v.read("0.00000000000000000000000000000000000001e+30 ") && v.get_real() == 1e-8);
|
BOOST_CHECK(v.read("0.00000000000000000000000000000000000001e+30 "));
|
||||||
|
|
||||||
BOOST_CHECK(!v.read(".19e-6")); //should fail, missing leading 0, therefore invalid JSON
|
BOOST_CHECK(!v.read(".19e-6")); //should fail, missing leading 0, therefore invalid JSON
|
||||||
// Invalid, initial garbage
|
// Invalid, initial garbage
|
||||||
|
|
Loading…
Add table
Reference in a new issue