]> Savannah Git Hosting - gnulib.git/commitdiff
limits-h tests: Add tests for BOOL_MAX and BOOL_WIDTH.
authorBruno Haible <bruno@clisp.org>
Sun, 1 Aug 2021 13:38:04 +0000 (15:38 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 1 Aug 2021 13:38:04 +0000 (15:38 +0200)
* tests/test-limits-h.c (bool_attrs): New variable.
Check value of BOOL_MAX.

ChangeLog
tests/test-limits-h.c

index e3b868f91be8677ef5ca40629c8e2f8a94202eed..dbd0598ec5eca59e1485d1ecac1a582aa5a2ccb9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-08-01  Bruno Haible  <bruno@clisp.org>
+
+       limits-h tests: Add tests for BOOL_MAX and BOOL_WIDTH.
+       * tests/test-limits-h.c (bool_attrs): New variable.
+       Check value of BOOL_MAX.
+
 2021-07-31  Paul Eggert  <eggert@cs.ucla.edu>
 
        regex: pacify GCC 11.2 -fanalyzer
index 4144013010ef72c68b787511db6fa0223146f164..f3394c1ae108f2a72d8d1b71b759e9fc7d53efb6 100644 (file)
@@ -110,6 +110,11 @@ verify_width (ULONG_WIDTH, 0, ULONG_MAX);
 verify_width (LLONG_WIDTH, LLONG_MIN, LLONG_MAX);
 verify_width (ULLONG_WIDTH, 0, ULLONG_MAX);
 
+/* Macros specified by C2x.  */
+
+int bool_attrs[] = { BOOL_MAX, BOOL_WIDTH };
+verify (BOOL_MAX == (((1U << (BOOL_WIDTH - 1)) - 1) * 2) + 1);
+
 int
 main (void)
 {