* tests/test-wcsncmp.c (main): Add zero-size tests.
+2024-11-05 Bruno Haible <bruno@clisp.org>
+
+ wcsncmp tests: Verify N3322 functionality.
+ * tests/test-wcsncmp.c (main): Add zero-size tests.
+
2024-11-05 Bruno Haible <bruno@clisp.org>
wcsncat tests: Verify N3322 functionality.
}
}
+ int volatile value;
+
+ /* Test zero-length operations on NULL pointers, allowed by
+ <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3322.pdf>. */
+
+ value = (wcsncmp (NULL, L"x", 0) == 0);
+ ASSERT (value);
+
+ value = (wcsncmp (L"x", NULL, 0) == 0);
+ ASSERT (value);
+
+ value = (wcsncmp (NULL, NULL, 0) == 0);
+ ASSERT (value);
+
return test_exit_status;
}