diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-10 02:52:46 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-10 02:52:46 +0200 |
commit | 71107a7b3d5ba0367aad3b6ae926e54c08cb0963 (patch) | |
tree | a86904f520bc07024a072a5502c69473e48d1561 /src/util | |
parent | 6e90ef9f4a8ab5352a948fd7fd4de9150a778ce5 (diff) |
expanding aggregator testcase
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/test_amount.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util/test_amount.c b/src/util/test_amount.c index 3f33334bc..640477156 100644 --- a/src/util/test_amount.c +++ b/src/util/test_amount.c @@ -73,6 +73,19 @@ main(int argc, GNUNET_assert (4 == a1.value); GNUNET_assert (0 == a1.fraction); + /* test conversion with leading zero in fraction */ + GNUNET_assert (GNUNET_OK == + TALER_string_to_amount ("eur:0.02", + &a2)); + GNUNET_assert (0 == strcasecmp ("eur", + a2.currency)); + GNUNET_assert (0 == a2.value); + GNUNET_assert (TALER_AMOUNT_FRAC_BASE / 100 * 2 == a2.fraction); + c = TALER_amount_to_string (&a2); + GNUNET_assert (0 == strcmp ("eur:0.02", + c)); + GNUNET_free (c); + /* test conversion with leading space and with fraction */ GNUNET_assert (GNUNET_OK == TALER_string_to_amount (" eur:4.12", |