hppa: Sync with pthread.h.
[platform/upstream/glibc.git] / catgets / tst-catgets.c
index 20e2738..a0a4089 100644 (file)
@@ -14,8 +14,8 @@ static const char *msgs[] =
 
 #define ROUNDS 5
 
-int
-main (void)
+static int
+do_test (void)
 {
   int rnd;
   int result = 0;
@@ -26,7 +26,7 @@ main (void)
   for (rnd = 0; rnd < ROUNDS; ++rnd)
     {
       nl_catd cd = catopen ("libc", 0);
-      int cnt;
+      size_t cnt;
 
       if (cd == (nl_catd) -1)
        {
@@ -41,14 +41,14 @@ main (void)
          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;
@@ -64,3 +64,6 @@ main (void)
 
   return result;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"