MiniblockchainProject / Cryptonite

MIT License
27 stars 42 forks source link

Unit test failure: FormatMoney #2

Open shawnpringle opened 9 years ago

shawnpringle commented 9 years ago

The unit testing framework reports 8 failures. You may be able to reproduce this with sh ./configure make make check

I am using a 32-bit/Linux/32.

Additionally, the unit tests incorrectly asks me to report the problem to info@bitcoin.org .

util_tests.cpp(197): error in "util_FormatMoney": check FormatMoney(COIN/100, false) == "0.1" failed [0.10 != 0.01] util_tests.cpp(198): error in "util_FormatMoney": check FormatMoney(COIN/1000, false) == "0001" failed [0.10 != 0.001] util_tests.cpp(199): error in "util_FormatMoney": check FormatMoney(COIN/10000, false) == ".0001" failed [0.01 != 0.0001] util_tests.cpp(200): error in "util_FormatMoney": check FormatMoney(COIN/100000, false) == 0.00001" failed [0.001 != 0.00001] util_tests.cpp(201): error in "util_FormatMoney": check FormatMoney(COIN/1000000, false) =="0.000001" failed [0.0001 != 0.000001] util_tests.cpp(202): error in "util_FormatMoney": check FormatMoney(COIN/10000000, false) = "0.0000001" failed [0.00001 != 0.0000001] util_tests.cpp(203): error in "util_FormatMoney": check FormatMoney(COIN/100000000, false) = "0.00000001" failed [0.000001 != 0.00000001] unknown location(0): fatal error in "rpc_rawparams": memory access violation at address: 0x0000000: no mapping at fault address rpc_tests.cpp(59): last checkpoint

*\ 8 failures detected in test suite "Bitcoin Test Suite"

FAIL: test_bitcoin

1 of 1 test failed Please report to info@bitcoin.org

shawnpringle commented 9 years ago

try using

string str = strprintf("%d.%010d", quotient, remainder);

instead of

string str = strprintf("%d.%08d", quotient, remainder);

at util.cpp:333. That should fix it. That doesn't help the rpc_rawparams problem after that, though.