summaryrefslogtreecommitdiffstats
path: root/swedish.test.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-09-09 20:56:12 +0200
committerMattias Andrée <maandree@kth.se>2021-09-09 20:56:12 +0200
commitc70673f4e73c7a071cff12735789eb6d45380d74 (patch)
treed222c092b7695d3b7c6bb775c9f5696eb599df0b /swedish.test.c
parentmisc (diff)
downloadlibnumtext-c70673f4e73c7a071cff12735789eb6d45380d74.tar.gz
libnumtext-c70673f4e73c7a071cff12735789eb6d45380d74.tar.bz2
libnumtext-c70673f4e73c7a071cff12735789eb6d45380d74.tar.xz
Add libnumtext_card2ord
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'swedish.test.c')
-rw-r--r--swedish.test.c14
1 files changed, 9 insertions, 5 deletions
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++)