commit a47423db495e7aad4332c8181a836ec54e2804b7
parent 3921a989ebfefe0cbda271350d87a09c90c21970
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Fri, 10 Apr 2026 12:09:56 +0200
fix validators test
Diffstat:
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
@@ -66,7 +66,7 @@ test_contract_LDADD = \
libtalermerchantutil.la
test_validators_SOURCES = \
- test_contract.c
+ test_validators.c
test_validators_LDADD = \
-lgnunetutil \
libtalermerchantutil.la
diff --git a/src/util/test_validators.c b/src/util/test_validators.c
@@ -137,7 +137,6 @@ check_phone (void)
{"+1-800-FLOWERS", NULL, false},
/* Invalid phone numbers */
- {NULL, NULL, false},
{"", NULL, false},
{"202-555-0173", NULL, false}, /* Missing + */
{"1-202-555-0173", NULL, false}, /* Missing + */
@@ -161,8 +160,8 @@ check_phone (void)
for (unsigned int i = 0; i < num_tests; i++)
{
- char *result = TALER_MERCHANT_phone_valid (tests[i].phone,
- tests[i].allow_letters);
+ char *result = TALER_MERCHANT_phone_validate_normalize (tests[i].phone,
+ tests[i].allow_letters);
bool success;
if (NULL == tests[i].expected_normalized)
@@ -197,9 +196,17 @@ check_phone (void)
int
main (void)
{
- if (! check_email ())
+ if (check_email ())
+ {
+ fprintf (stderr,
+ "email failed\n");
return 1;
- if (! check_phone ())
+ }
+ if (check_phone ())
+ {
+ fprintf (stderr,
+ "phone failed\n");
return 1;
+ }
return 0;
}