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;
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);