]> Savannah Git Hosting - gnulib.git/commitdiff
test-gettext-h: check call results
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 2 Feb 2025 23:27:39 +0000 (15:27 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 2 Feb 2025 23:36:13 +0000 (15:36 -0800)
* tests/test-gettext-h.c: Include string.h.
(main): Check return values of calls.
This also pacifies GCC, which otherwise might
warn about a variable being set but not used.

ChangeLog
tests/test-gettext-h.c

index cc0fe249433e4ef7766fa8eb4d651274b2d82913..2b02191a57d3711b6189349770d7ed04ba70a319 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-02-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       test-gettext-h: check call results
+       * tests/test-gettext-h.c: Include string.h.
+       (main): Check return values of calls.
+       This also pacifies GCC, which otherwise might
+       warn about a variable being set but not used.
+
 2025-01-31  Paul Eggert  <eggert@cs.ucla.edu>
 
        announce-gen: add comments
index 6eb9affb9a95a7299513f2a7b559caaf057f1247..04e6c6df7193ba8e60e06c5c68df45aa205550f0 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "gettext.h"
 
+#include <string.h>
+
 int
 main (void)
 {
@@ -28,7 +30,12 @@ main (void)
   textdomain ("tzlof");
 
   s = gettext ("some text");
+  if (strcmp (s, "some text") != 0)
+    return 1;
+
   s = pgettext ("menu", "some other text");
+  if (strcmp (s, "some other text") != 0)
+    return 1;
 
   return 0;
 }