Avoid test failures on AIX and OSF/1.
[pspp] / tests / uninorm / test-u32-nfd.c
index 9aa820a3db4f0c2682b6ac8044d6c97a1833cb95..f7b2d8dfb50a914122ad8576007ccd13ce99d3ac 100644 (file)
@@ -88,7 +88,7 @@ check (const uint32_t *input, size_t input_length,
     result = u32_normalize (UNINORM_NFD, input, input_length, preallocated, &length);
     if (!(result != NULL))
       return 8;
-    if (!(result == preallocated))
+    if (!(preallocated == NULL || result == preallocated))
       return 9;
     if (!(length == expected_length))
       return 10;
@@ -103,6 +103,9 @@ check (const uint32_t *input, size_t input_length,
 void
 test_u32_nfd (void)
 {
+  { /* Empty string.  */
+    ASSERT (check (NULL, 0, NULL, 0) == 0);
+  }
   { /* SPACE */
     static const uint32_t input[]    = { 0x0020 };
     ASSERT (check (input, SIZEOF (input), input, SIZEOF (input)) == 0);