Since Gnulib's signal.h defines SIG2STR_MAX like POSIX requires, the
test should check for it.

Done with the attached patch.

Collin

>From aaf13948de429369aa71e7bf9d6d05196cba4ebf Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Sun, 29 Dec 2024 11:56:28 -0800
Subject: [PATCH] signal-h tests: Check that SIG2STR_MAX is properly defined.

* modules/signal-h-tests (Depends-on): Add assert-h.
* tests/test-signal-h.c: Check that SIG2STR_MAX is defined to a
positive integer.
---
 ChangeLog              | 5 +++++
 modules/signal-h-tests | 1 +
 tests/test-signal-h.c  | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 8fcb0f9a46..a0d18345f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2024-12-29  Collin Funk  <collin.fu...@gmail.com>
 
+	signal-h tests: Check that SIG2STR_MAX is properly defined.
+	* modules/signal-h-tests (Depends-on): Add assert-h.
+	* tests/test-signal-h.c: Check that SIG2STR_MAX is defined to a
+	positive integer.
+
 	sig2str tests: Add signature check.
 	* modules/sig2str-tests (Files): Add tests/signature.h.
 	* tests/test-sig2str.c: Include signal.h instead of sig2str.h. Check the
diff --git a/modules/signal-h-tests b/modules/signal-h-tests
index dab83e9edf..1228f7c1df 100644
--- a/modules/signal-h-tests
+++ b/modules/signal-h-tests
@@ -2,6 +2,7 @@ Files:
 tests/test-signal-h.c
 
 Depends-on:
+assert-h
 signal-h-c++-tests
 
 configure.ac:
diff --git a/tests/test-signal-h.c b/tests/test-signal-h.c
index c4b3220787..4268fa4d56 100644
--- a/tests/test-signal-h.c
+++ b/tests/test-signal-h.c
@@ -20,6 +20,9 @@
 
 #include <signal.h>
 
+/* Check that SIG2STR_MAX is defined to a positive integer.  */
+static_assert (0 < SIG2STR_MAX);
+
 /* Check for required types.  */
 struct
 {
-- 
2.47.1

Reply via email to