#define ROUNDS 5
-int
-main (void)
+static int
+do_test (void)
{
int rnd;
int result = 0;
for (rnd = 0; rnd < ROUNDS; ++rnd)
{
nl_catd cd = catopen ("libc", 0);
- int cnt;
+ size_t cnt;
if (cd == (nl_catd) -1)
{
char *trans;
trans = catgets (cd, 1, 1 + cnt,
- "+#+# is this comes backs it's an error");
+ "+#+# if this comes backs it's an error");
if (trans == NULL)
{
- printf ("catgets return NULL for %d\n", cnt);
+ printf ("catgets return NULL for %zd\n", cnt);
result = 1;
}
- else if (strcmp (trans, msgs[cnt]) != 0)
+ else if (strcmp (trans, msgs[cnt]) != 0 && msgs[cnt][0] != '\0')
{
printf ("expected \"%s\", got \"%s\"\n", msgs[cnt], trans);
result = 1;
return result;
}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"