* 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              | 8 ++++++++
 tests/test-gettext-h.c | 7 +++++++
 2 files changed, 15 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index cc0fe24943..2b02191a57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-02-02  Paul Eggert  <egg...@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  <egg...@cs.ucla.edu>
 
        announce-gen: add comments
diff --git a/tests/test-gettext-h.c b/tests/test-gettext-h.c
index 6eb9affb9a..04e6c6df71 100644
--- a/tests/test-gettext-h.c
+++ b/tests/test-gettext-h.c
@@ -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;
 }
-- 
2.45.2


Reply via email to