aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_amount.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-10-12 16:23:05 +0200
committerChristian Grothoff <grothoff@gnunet.org>2023-10-12 16:23:05 +0200
commit82a04210fd23a7962566b47caccc8e717a380118 (patch)
treecf513af8688f3aecba1ee8d9a65651621b0055b0 /src/util/test_amount.c
parentf6c99c78ff3b764f0eda7851ed9ca7f1f63fb5bc (diff)
update private key files and harden checks for currency codes
Diffstat (limited to 'src/util/test_amount.c')
-rw-r--r--src/util/test_amount.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/util/test_amount.c b/src/util/test_amount.c
index a45b71de7..57d73b14f 100644
--- a/src/util/test_amount.c
+++ b/src/util/test_amount.c
@@ -78,31 +78,31 @@ main (int argc,
/* test conversion with leading zero in fraction */
GNUNET_assert (GNUNET_OK ==
- TALER_string_to_amount ("eur:0.02",
+ TALER_string_to_amount ("EUR:0.02",
&a2));
- GNUNET_assert (0 == strcasecmp ("eur",
+ 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 == strcasecmp ("eur:0.02",
+ GNUNET_assert (0 == strcasecmp ("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",
+ TALER_string_to_amount (" EUR:4.12",
&a2));
- GNUNET_assert (0 == strcasecmp ("eur",
+ GNUNET_assert (0 == strcasecmp ("EUR",
a2.currency));
GNUNET_assert (4 == a2.value);
GNUNET_assert (TALER_AMOUNT_FRAC_BASE / 100 * 12 == a2.fraction);
/* test use of local currency */
GNUNET_assert (GNUNET_OK ==
- TALER_string_to_amount (" *LOCAL:4444.1000",
+ TALER_string_to_amount (" LOCAL:4444.1000",
&a3));
- GNUNET_assert (0 == strcasecmp ("*LOCAL",
+ GNUNET_assert (0 == strcasecmp ("LOCAL",
a3.currency));
GNUNET_assert (4444 == a3.value);
GNUNET_assert (TALER_AMOUNT_FRAC_BASE / 10 == a3.fraction);