7 static const char *msgs
[] =
10 #define OUTPUT(str) str,
11 #include <intl/msgs.h>
13 #define nmsgs (sizeof (msgs) / sizeof (msgs[0]))
25 /* We do this a few times to stress the memory handling. */
26 for (rnd
= 0; rnd
< ROUNDS
; ++rnd
)
28 nl_catd cd
= catopen ("libc", 0);
31 if (cd
== (nl_catd
) -1)
33 printf ("cannot load catalog: %m\n");
38 /* Go through all the messages and compare the result. */
39 for (cnt
= 0; cnt
< nmsgs
; ++cnt
)
43 trans
= catgets (cd
, 1, 1 + cnt
,
44 "+#+# if this comes backs it's an error");
48 printf ("catgets return NULL for %zd\n", cnt
);
51 else if (strcmp (trans
, msgs
[cnt
]) != 0 && msgs
[cnt
][0] != '\0')
53 printf ("expected \"%s\", got \"%s\"\n", msgs
[cnt
], trans
);
58 if (catclose (cd
) != 0)
60 printf ("catclose failed: %m\n");
68 #define TEST_FUNCTION do_test ()
69 #include "../test-skeleton.c"