Avoid a compiler warning.
[gnulib.git] / tests / uninorm / test-u8-nfd.c
index 9dfde02..d1d840a 100644 (file)
@@ -88,7 +88,7 @@ check (const uint8_t *input, size_t input_length,
     result = u8_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 uint8_t *input, size_t input_length,
 void
 test_u8_nfd (void)
 {
+  { /* Empty string.  */
+    ASSERT (check (NULL, 0, NULL, 0) == 0);
+  }
   { /* SPACE */
     static const uint8_t input[]    = { 0x20 };
     ASSERT (check (input, SIZEOF (input), input, SIZEOF (input)) == 0);