]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Correctly handle untranslated messages in positive tests.
authorUlrich Drepper <drepper@redhat.com>
Tue, 16 Jul 2002 04:48:01 +0000 (04:48 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 16 Jul 2002 04:48:01 +0000 (04:48 +0000)
intl/tst-gettext.c

index e6cbf6f1b2dbeff6e7c20a27d0025c8ec3113580..55b8310dfad3d54dea95847d56c622322654e66a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of the gettext functions.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 2000.
 
@@ -235,7 +235,9 @@ positive_gettext_test (void)
     {
       const char *found = gettext (msgs[cnt].msgid);
 
-      if (found == NULL || strcmp (found, msgs[cnt].msgstr) != 0)
+      if (found == NULL
+         || (msgs[cnt].msgstr[0] != '\0'
+             && strcmp (found, msgs[cnt].msgstr) != 0))
        {
          /* Oops, shouldn't happen.  */
          printf ("\
@@ -281,7 +283,9 @@ positive_dgettext_test (const char *domain)
     {
       const char *found = dgettext (domain, msgs[cnt].msgid);
 
-      if (found == NULL || strcmp (found, msgs[cnt].msgstr) != 0)
+      if (found == NULL
+         || (msgs[cnt].msgstr[0] != '\0'
+             && strcmp (found, msgs[cnt].msgstr) != 0))
        {
          /* Oops, shouldn't happen.  */
          printf ("\
@@ -305,7 +309,9 @@ positive_dcgettext_test (const char *domain, int category)
     {
       const char *found = dcgettext (domain, msgs[cnt].msgid, category);
 
-      if (found == NULL || strcmp (found, msgs[cnt].msgstr) != 0)
+      if (found == NULL
+         || (msgs[cnt].msgstr[0] != '\0'
+             && strcmp (found, msgs[cnt].msgstr) != 0))
        {
          /* Oops, shouldn't happen.  */
          printf ("\