From c70673f4e73c7a071cff12735789eb6d45380d74 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 9 Sep 2021 20:56:12 +0200 Subject: Add libnumtext_card2ord MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- swedish.test.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'swedish.test.c') diff --git a/swedish.test.c b/swedish.test.c index 4e2d00b..c1cddc5 100644 --- a/swedish.test.c +++ b/swedish.test.c @@ -49,13 +49,15 @@ {N, Z, E, (FLAGS) | F(MASCULINE_GENDER), ERR},\ {N, Z, E, (FLAGS) | F(FEMININE_GENDER), ERR} -static struct test { +struct test { const char *num; size_t zeroes; const char *expect; uint32_t flags; int errnum; -} tests[] = { +}; + +static struct test n2t_tests[] = { {"0", 0, "noll", 0, 0}, {"00", 0, "noll", 0, 0}, {"00000000", 0, "noll", 0, 0}, @@ -757,9 +759,11 @@ static struct test { {"+-0", 0, NULL, 0, EINVAL}, {"x0", 0, NULL, 0, EINVAL}, {"0x", 0, NULL, 0, EINVAL}, - {"0x0", 0, NULL, 0, EINVAL}, + {"0x0", 0, NULL, 0, EINVAL} }; +/* TODO test libnumtext_card2ord */ + int main(void) @@ -770,9 +774,9 @@ main(void) size_t i, j, z, numlen, failures = 0; struct test *t; - for (i = 0; i < sizeof(tests) / sizeof(*tests); i++) { + for (i = 0; i < sizeof(n2t_tests) / sizeof(*n2t_tests); i++) { j = i + 1; - t = &tests[i]; + t = &n2t_tests[i]; numlen = strlen(t->num); memcpy(numbuf, t->num, numlen); for (z = 0; z < t->zeroes; z++) -- cgit v1.2.3-70-g09d2