summaryrefslogtreecommitdiff
path: root/tests/uniwbrk
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:33 +0100
committerJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:33 +0100
commit5f59a34ab747dde8ede7357f3431bf06bd6002fe (patch)
tree056a4477fd870d454d5be5868cddab829a47f4d2 /tests/uniwbrk
parent27dae84ed92f1ef0300263091972338d12e78348 (diff)
New upstream version 1.4.2upstream/1.4.2upstream
Diffstat (limited to 'tests/uniwbrk')
-rw-r--r--tests/uniwbrk/test-u16-wordbreaks.c14
-rw-r--r--tests/uniwbrk/test-u32-wordbreaks.c14
-rw-r--r--tests/uniwbrk/test-u8-wordbreaks.c14
-rw-r--r--tests/uniwbrk/test-uc-wordbreaks.c8
-rw-r--r--tests/uniwbrk/test-ulc-wordbreaks.c5
-rw-r--r--tests/uniwbrk/test-uniwbrk-h.c2
6 files changed, 21 insertions, 36 deletions
diff --git a/tests/uniwbrk/test-u16-wordbreaks.c b/tests/uniwbrk/test-u16-wordbreaks.c
index 408eb809..8c301a4c 100644
--- a/tests/uniwbrk/test-u16-wordbreaks.c
+++ b/tests/uniwbrk/test-u16-wordbreaks.c
@@ -1,5 +1,5 @@
/* Test of word breaks in UTF-16 strings.
- Copyright (C) 2009-2025 Free Software Foundation, Inc.
+ Copyright (C) 2009-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,11 +41,10 @@ main ()
0x65E5, 0x672C, 0x8A9E, ',', 0x4E2D, 0x6587, ',', 0xD55C, 0xAE00, '\n'
};
char *p = (char *) malloc (SIZEOF (input));
- size_t i;
u16_wordbreaks (input, SIZEOF (input), p);
- for (i = 0; i < 61; i++)
+ for (size_t i = 0; i < 61; i++)
{
ASSERT (p[i] == ((i >= 4 && i <= 5)
|| (i >= 9 && i <= 11)
@@ -73,11 +72,10 @@ main ()
0x1112, 0x1161, 0x11AB, 0x1100, 0x1173, 0x11AF, '\n'
};
char *p = (char *) malloc (SIZEOF (input));
- size_t i;
u16_wordbreaks (input, SIZEOF (input), p);
- for (i = 0; i < 67; i++)
+ for (size_t i = 0; i < 67; i++)
{
ASSERT (p[i] == ((i >= 5 && i <= 6)
|| (i >= 10 && i <= 12)
@@ -97,10 +95,9 @@ main ()
static const uint16_t input[8] =
{ 'a', '\n', 'b', '\r', 'c', '\r', '\n', 'd' };
char *p = (char *) malloc (SIZEOF (input));
- size_t i;
u16_wordbreaks (input, SIZEOF (input), p);
- for (i = 0; i < 8; i++)
+ for (size_t i = 0; i < 8; i++)
{
ASSERT (p[i] == (i == 1 || i == 2 || i == 3 || i == 4 || i == 5
|| i == 7 ? 1 :
@@ -114,10 +111,9 @@ main ()
static const uint16_t input[10] =
{ '.', 0xD83C, 0xDDE9, 0xD83C, 0xDDEA, 0xD83C, 0xDDEB, 0xD83C, 0xDDF7, '.' };
char *p = (char *) malloc (SIZEOF (input));
- size_t i;
u16_wordbreaks (input, SIZEOF (input), p);
- for (i = 0; i < 10; i++)
+ for (size_t i = 0; i < 10; i++)
{
ASSERT (p[i] == (i == 1 || i == 5 || i == 9 ? 1 : 0));
}
diff --git a/tests/uniwbrk/test-u32-wordbreaks.c b/tests/uniwbrk/test-u32-wordbreaks.c
index 58fa9cd4..0a2e77e1 100644
--- a/tests/uniwbrk/test-u32-wordbreaks.c
+++ b/tests/uniwbrk/test-u32-wordbreaks.c
@@ -1,5 +1,5 @@
/* Test of word breaks in UTF-32 strings.
- Copyright (C) 2009-2025 Free Software Foundation, Inc.
+ Copyright (C) 2009-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,11 +41,10 @@ main ()
0x65E5, 0x672C, 0x8A9E, ',', 0x4E2D, 0x6587, ',', 0xD55C, 0xAE00, '\n'
};
char *p = (char *) malloc (SIZEOF (input));
- size_t i;
u32_wordbreaks (input, SIZEOF (input), p);
- for (i = 0; i < 61; i++)
+ for (size_t i = 0; i < 61; i++)
{
ASSERT (p[i] == ((i >= 4 && i <= 5)
|| (i >= 9 && i <= 11)
@@ -73,11 +72,10 @@ main ()
0x1112, 0x1161, 0x11AB, 0x1100, 0x1173, 0x11AF, '\n'
};
char *p = (char *) malloc (SIZEOF (input));
- size_t i;
u32_wordbreaks (input, SIZEOF (input), p);
- for (i = 0; i < 67; i++)
+ for (size_t i = 0; i < 67; i++)
{
ASSERT (p[i] == ((i >= 5 && i <= 6)
|| (i >= 10 && i <= 12)
@@ -97,10 +95,9 @@ main ()
static const uint32_t input[8] =
{ 'a', '\n', 'b', '\r', 'c', '\r', '\n', 'd' };
char *p = (char *) malloc (SIZEOF (input));
- size_t i;
u32_wordbreaks (input, SIZEOF (input), p);
- for (i = 0; i < 8; i++)
+ for (size_t i = 0; i < 8; i++)
{
ASSERT (p[i] == (i == 1 || i == 2 || i == 3 || i == 4 || i == 5
|| i == 7 ? 1 :
@@ -114,10 +111,9 @@ main ()
static const uint32_t input[6] =
{ '.', 0x1F1E9, 0x1F1EA, 0x1F1EB, 0x1F1F7, '.' };
char *p = (char *) malloc (SIZEOF (input));
- size_t i;
u32_wordbreaks (input, SIZEOF (input), p);
- for (i = 0; i < 6; i++)
+ for (size_t i = 0; i < 6; i++)
{
ASSERT (p[i] == (i == 1 || i == 3 || i == 5 ? 1 : 0));
}
diff --git a/tests/uniwbrk/test-u8-wordbreaks.c b/tests/uniwbrk/test-u8-wordbreaks.c
index b8d035a9..c6cde97a 100644
--- a/tests/uniwbrk/test-u8-wordbreaks.c
+++ b/tests/uniwbrk/test-u8-wordbreaks.c
@@ -1,5 +1,5 @@
/* Test of word breaks in UTF-8 strings.
- Copyright (C) 2009-2025 Free Software Foundation, Inc.
+ Copyright (C) 2009-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,11 +35,10 @@ main ()
/* "Grüß Gott. Здравствуйте! x=(-b±sqrt(b²-4ac))/(2a) 日本語,中文,한글" */
"Gr\303\274\303\237 Gott. \320\227\320\264\321\200\320\260\320\262\321\201\321\202\320\262\321\203\320\271\321\202\320\265! x=(-b\302\261sqrt(b\302\262-4ac))/(2a) \346\227\245\346\234\254\350\252\236,\344\270\255\346\226\207,\355\225\234\352\270\200\n";
char *p = (char *) malloc (SIZEOF (input));
- size_t i;
u8_wordbreaks (input, SIZEOF (input), p);
- for (i = 0; i < 91; i++)
+ for (size_t i = 0; i < 91; i++)
{
ASSERT (p[i] == ((i >= 6 && i <= 7)
|| (i >= 11 && i <= 13)
@@ -62,11 +61,10 @@ main ()
/* "Grüß Gott. Здравствуйте! x=(-b±sqrt(b²-4ac))/(2a) 日本語,中文,한글" */
"Gru\314\210\303\237 Gott. \320\227\320\264\321\200\320\260\320\262\321\201\321\202\320\262\321\203\320\270\314\206\321\202\320\265! x=(-b\302\261sqrt(b\302\262-4ac))/(2a) \346\227\245\346\234\254\350\252\236,\344\270\255\346\226\207,\341\204\222\341\205\241\341\206\253\341\204\200\341\205\263\341\206\257\n";
char *p = (char *) malloc (SIZEOF (input));
- size_t i;
u8_wordbreaks (input, SIZEOF (input), p);
- for (i = 0; i < 106; i++)
+ for (size_t i = 0; i < 106; i++)
{
ASSERT (p[i] == ((i >= 7 && i <= 8)
|| (i >= 12 && i <= 14)
@@ -87,10 +85,9 @@ main ()
{
static const uint8_t input[8] _GL_ATTRIBUTE_NONSTRING = "a\nb\rc\r\nd";
char *p = (char *) malloc (SIZEOF (input));
- size_t i;
u8_wordbreaks (input, SIZEOF (input), p);
- for (i = 0; i < 8; i++)
+ for (size_t i = 0; i < 8; i++)
{
ASSERT (p[i] == (i == 1 || i == 2 || i == 3 || i == 4 || i == 5
|| i == 7 ? 1 :
@@ -104,10 +101,9 @@ main ()
static const uint8_t input[18] _GL_ATTRIBUTE_NONSTRING =
".\360\237\207\251\360\237\207\252\360\237\207\253\360\237\207\267.";
char *p = (char *) malloc (SIZEOF (input));
- size_t i;
u8_wordbreaks (input, SIZEOF (input), p);
- for (i = 0; i < 18; i++)
+ for (size_t i = 0; i < 18; i++)
{
ASSERT (p[i] == (i == 1 || i == 9 || i == 17 ? 1 : 0));
}
diff --git a/tests/uniwbrk/test-uc-wordbreaks.c b/tests/uniwbrk/test-uc-wordbreaks.c
index 11f4f201..a9dcb628 100644
--- a/tests/uniwbrk/test-uc-wordbreaks.c
+++ b/tests/uniwbrk/test-uc-wordbreaks.c
@@ -1,5 +1,5 @@
/* Word break function test, using test data from UCD.
- Copyright (C) 2010-2025 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
@@ -157,10 +157,8 @@ main (int argc, char *argv[])
breaks[0] = breaks_expected[0] = 1;
if (memcmp (breaks, breaks_expected, i - 1) != 0)
{
- int j;
-
fprintf (stderr, "%s:%d: expected: ", filename, lineno);
- for (j = 0; j < i - 1; j++)
+ for (int j = 0; j < i - 1; j++)
{
int input_wbp = uc_wordbreak_property (input[j]);
fprintf (stderr, "%s U+%04X (%s) ",
@@ -169,7 +167,7 @@ main (int argc, char *argv[])
}
fprintf (stderr, "\n");
fprintf (stderr, "%s:%d: actual: ", filename, lineno);
- for (j = 0; j < i - 1; j++)
+ for (int j = 0; j < i - 1; j++)
{
int input_wbp = uc_wordbreak_property (input[j]);
fprintf (stderr, "%s U+%04X (%s) ",
diff --git a/tests/uniwbrk/test-ulc-wordbreaks.c b/tests/uniwbrk/test-ulc-wordbreaks.c
index 0d95fc38..5974cba8 100644
--- a/tests/uniwbrk/test-ulc-wordbreaks.c
+++ b/tests/uniwbrk/test-ulc-wordbreaks.c
@@ -1,5 +1,5 @@
/* Test of word breaks in strings.
- Copyright (C) 2009-2025 Free Software Foundation, Inc.
+ Copyright (C) 2009-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,11 +41,10 @@ main ()
/* "Grüß Gott. x=(-b±sqrt(b²-4ac))/(2a)" */
"Gr\374\337 Gott. x=(-b\261sqrt(b\262-4ac))/(2a)\n";
char *p = (char *) malloc (SIZEOF (input));
- size_t i;
ulc_wordbreaks (input, SIZEOF (input), p);
- for (i = 0; i < 36; i++)
+ for (size_t i = 0; i < 36; i++)
{
ASSERT (p[i] == ((i >= 4 && i <= 5)
|| (i >= 9 && i <= 17)
diff --git a/tests/uniwbrk/test-uniwbrk-h.c b/tests/uniwbrk/test-uniwbrk-h.c
index 7954b894..4e4ef299 100644
--- a/tests/uniwbrk/test-uniwbrk-h.c
+++ b/tests/uniwbrk/test-uniwbrk-h.c
@@ -1,5 +1,5 @@
/* Test of <uniwbrk.h>.
- Copyright (C) 2025 Free Software Foundation, Inc.
+ Copyright (C) 2025-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by