]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
uchar-h tests: Strengthen tests.
authorBruno Haible <bruno@clisp.org>
Sat, 25 Apr 2026 08:09:58 +0000 (10:09 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 25 Apr 2026 08:09:58 +0000 (10:09 +0200)
* tests/test-uchar-h.c: Move #include <wchar.h> after most other tests
are done.

ChangeLog
tests/test-uchar-h.c

index c39c3cc04d05182bcbd3e4e69f3f5d5c9aabcbeb..a69fff73ddb0a0249c073e05f38e3377fd2001bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-04-25  Bruno Haible  <bruno@clisp.org>
+
+       uchar-h tests: Strengthen tests.
+       * tests/test-uchar-h.c: Move #include <wchar.h> after most other tests
+       are done.
+
 2026-04-24  Paul Eggert  <eggert@cs.ucla.edu>
 
        regex: be consistent with dfa
index 4b0667df5811e506553056c5092cbb7f693d2913..9c054ed065a1f6675f08bf3edc3dd19928d1f253 100644 (file)
 
 #include <config.h>
 
+/* Specification.  */
 #include <uchar.h>
 
-#include <wchar.h>
-
-#if _GL_WCHAR_T_IS_UCS4
-static_assert (sizeof (char32_t) == sizeof (wchar_t));
-#endif
 
 /* Check that the types are defined.  */
 mbstate_t a = { 0 };
@@ -49,6 +45,15 @@ static_assert ((char16_t)0xFFFF != (char16_t)0x7FFF);
 /* Check that char32_t is at least 31 bits wide.  */
 static_assert ((char32_t)0x7FFFFFFF != (char32_t)0x3FFFFFFF);
 
+
+/* Checks relating to wchar_t.  */
+
+#include <wchar.h>
+
+#if _GL_WCHAR_T_IS_UCS4
+static_assert (sizeof (char32_t) == sizeof (wchar_t));
+#endif
+
 /* Check that _GL_SMALL_WCHAR_T is correctly defined.  */
 #if _GL_SMALL_WCHAR_T
 static_assert (sizeof (wchar_t) < sizeof (char32_t));
@@ -56,6 +61,7 @@ static_assert (sizeof (wchar_t) < sizeof (char32_t));
 static_assert (sizeof (wchar_t) == sizeof (char32_t));
 #endif
 
+
 int
 main (void)
 {