summaryrefslogtreecommitdiff
path: root/tests/unigbrk/test-u16-grapheme-breaks.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unigbrk/test-u16-grapheme-breaks.c')
-rw-r--r--tests/unigbrk/test-u16-grapheme-breaks.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/unigbrk/test-u16-grapheme-breaks.c b/tests/unigbrk/test-u16-grapheme-breaks.c
index 651496eb..634ec4dc 100644
--- a/tests/unigbrk/test-u16-grapheme-breaks.c
+++ b/tests/unigbrk/test-u16-grapheme-breaks.c
@@ -1,5 +1,5 @@
/* Grapheme cluster breaks test.
- Copyright (C) 2010-2024 Free Software Foundation, Inc.
+ Copyright (C) 2010-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
@@ -35,14 +35,13 @@ test_u16_grapheme_breaks (const char *expected, ...)
uint16_t s[16];
va_list args;
char breaks[16];
- size_t i;
ASSERT (n <= 16);
memset (breaks, 0xcc, n);
va_start (args, expected);
- for (i = 0; i < n; i++)
+ for (size_t i = 0; i < n; i++)
{
int unit = va_arg (args, int);
ASSERT (unit >= 0);
@@ -52,25 +51,23 @@ test_u16_grapheme_breaks (const char *expected, ...)
va_end (args);
u16_grapheme_breaks (s, n, breaks);
- for (i = 0; i < n; i++)
+ for (size_t i = 0; i < n; i++)
if (breaks[i] != (expected[i] == '#'))
{
- size_t j;
-
fprintf (stderr, "wrong grapheme breaks:\n");
fprintf (stderr, " input:");
- for (j = 0; j < n; j++)
+ for (size_t j = 0; j < n; j++)
fprintf (stderr, " %04X", s[j]);
putc ('\n', stderr);
fprintf (stderr, "expected:");
- for (j = 0; j < n; j++)
+ for (size_t j = 0; j < n; j++)
fprintf (stderr, " %d", expected[j] == '#');
putc ('\n', stderr);
fprintf (stderr, " actual:");
- for (j = 0; j < n; j++)
+ for (size_t j = 0; j < n; j++)
fprintf (stderr, " %d", breaks[j]);
putc ('\n', stderr);
@@ -107,7 +104,7 @@ main (void)
/* Emoji modifier / ZWJ sequence. */
test_u16_grapheme_breaks ("#____",
- 0x2605, 0x0305, 0x0347, 0x200D, 0x2600,
+ 0x2B50, 0x0305, 0x0347, 0x200D, 0x2600,
-1);
/* Regional indicators. */