Avoid test failures on AIX and OSF/1.
[pspp] / tests / uninorm / test-u16-nfc.c
index 397914c5f4c1ec187eab8ac625bcbb312bde16f4..1bf9a94d7ee4f3f8a27326902f3852db20597b0f 100644 (file)
@@ -88,7 +88,7 @@ check (const uint16_t *input, size_t input_length,
     result = u16_normalize (UNINORM_NFC, 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 uint16_t *input, size_t input_length,
 void
 test_u16_nfc (void)
 {
+  { /* Empty string.  */
+    ASSERT (check (NULL, 0, NULL, 0) == 0);
+  }
   { /* SPACE */
     static const uint16_t input[]    = { 0x0020 };
     ASSERT (check (input, SIZEOF (input), input, SIZEOF (input)) == 0);