aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/parse_amount.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2014-10-08 21:38:55 +0200
committerRiccardo Spagni <ric@spagni.net>2014-10-08 21:38:55 +0200
commit1795c381c0537119cc26ae55b523f71ba029da79 (patch)
treed645a3bd987f4f2fdaa8e3eb4e5c8c48a720ec07 /tests/unit_tests/parse_amount.cpp
parentminiupnpc static define change (diff)
downloadmonero-1795c381c0537119cc26ae55b523f71ba029da79.tar.xz
fixed unit tests
Diffstat (limited to 'tests/unit_tests/parse_amount.cpp')
-rw-r--r--tests/unit_tests/parse_amount.cpp43
1 files changed, 24 insertions, 19 deletions
diff --git a/tests/unit_tests/parse_amount.cpp b/tests/unit_tests/parse_amount.cpp
index 80770212a..5e677a0b2 100644
--- a/tests/unit_tests/parse_amount.cpp
+++ b/tests/unit_tests/parse_amount.cpp
@@ -105,22 +105,27 @@ TEST_pos(0, 00_00000000);
TEST_pos(0, 00_000000000);
TEST_pos(0, 00_00000000000000000000000000000000);
-TEST_pos(1, 0_00000001);
-TEST_pos(1, 0_000000010);
-TEST_pos(1, 0_000000010000000000000000000000000);
-TEST_pos(9, 0_00000009);
-TEST_pos(9, 0_000000090);
-TEST_pos(9, 0_000000090000000000000000000000000);
-
-TEST_pos( 100000000, 1);
-TEST_pos( 6553500000000, 65535);
-TEST_pos( 429496729500000000, 4294967295);
-TEST_pos(18446744073700000000, 184467440737_);
-TEST_pos(18446744073700000000, 184467440737_0);
-TEST_pos(18446744073700000000, 184467440737_00000000);
-TEST_pos(18446744073700000000, 184467440737_000000000);
-TEST_pos(18446744073700000000, 184467440737_0000000000000000000);
-TEST_pos(18446744073709551615, 184467440737_09551615);
+TEST_pos(1, 0_000000000001);
+TEST_pos(1, 0_0000000000010);
+TEST_pos(1, 0_0000000000010000000000000000000000000);
+TEST_pos(9, 0_000000000009);
+TEST_pos(9, 0_0000000000090);
+TEST_pos(9, 0_0000000000090000000000000000000000000);
+
+TEST_pos(1000000000000, 1);
+TEST_pos(10000000000000, 10);
+TEST_pos(100000000000000, 100);
+TEST_pos(1000000000000000, 1000);
+TEST_pos(6553500000000000, 6553_5);
+TEST_pos(429496729500000000, 429496_7295);
+TEST_pos(18446744073700000000, 18446744_0737);
+TEST_pos(18446744073700000000, 18446744_0737000);
+TEST_pos(18446744073700000000, 18446744_07370000);
+TEST_pos(18446744073700000000, 18446744_073700000);
+TEST_pos(18446744073700000000, 18446744_0737000000000000000);
+
+/* Max supply */
+TEST_pos(18446744073709551615, 18446744_073709551615);
// Invalid numbers
TEST_neg_n(~, empty_string);
@@ -130,9 +135,9 @@ TEST_neg_n(-1, minus_1);
TEST_neg_n(+1, plus_1);
TEST_neg_n(_, only_point);
-// A lot of fraction digits
-TEST_neg(0_000000001);
-TEST_neg(0_000000009);
+// Don't go below 10^-12
+TEST_neg(0_0000000000001);
+TEST_neg(0_0000000000009);
TEST_neg(184467440737_000000001);
// Overflow