diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2026-03-10 13:24:07 +0100 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2026-03-10 13:24:07 +0100 |
| commit | cfd1f17f1a85d95ea12bca8dae42add7dad1ad11 (patch) | |
| tree | 8016486f8ee7157213f2d09ff2491bfa9c94638a /tests/uniname/test-uninames.c | |
| parent | 14e4d584d0121031ec40e6c35869745f1747ff29 (diff) | |
| parent | 1403307d6e2fb4e7b5d97a35f40d1e95134561ab (diff) | |
Merge branch 'release/debian/1.4.2-1'HEADdebian/1.4.2-1master
Diffstat (limited to 'tests/uniname/test-uninames.c')
| -rw-r--r-- | tests/uniname/test-uninames.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/tests/uniname/test-uninames.c b/tests/uniname/test-uninames.c index 72e198ed..38dc618c 100644 --- a/tests/uniname/test-uninames.c +++ b/tests/uniname/test-uninames.c @@ -1,5 +1,5 @@ /* Test the Unicode character name functions. - Copyright (C) 2000-2003, 2005, 2007, 2009-2024 Free Software Foundation, + Copyright (C) 2000-2003, 2005, 2007, 2009-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -187,8 +187,7 @@ fill_aliases (const char *namealiases_filename) static int name_has_alias (unsigned int uc) { - int i; - for (i = 0; i < ALIASLEN; i++) + for (int i = 0; i < ALIASLEN; i++) if (unicode_aliases[i].uc == uc) return 1; return 0; @@ -199,10 +198,9 @@ static int test_name_lookup () { int error = 0; - unsigned int i; char buf[UNINAME_MAX]; - for (i = 0; i < 0x11000; i++) + for (unsigned int i = 0; i < 0x11000; i++) { char *result = unicode_character_name (i, buf); @@ -231,7 +229,7 @@ test_name_lookup () } } - for (i = 0x110000; i < 0x1000000; i++) + for (unsigned int i = 0x110000; i < 0x1000000; i++) { char *result = unicode_character_name (i, buf); @@ -251,10 +249,9 @@ static int test_inverse_lookup () { int error = 0; - unsigned int i; /* First, verify all valid character names are recognized. */ - for (i = 0; i < 0x110000; i++) + for (unsigned int i = 0; i < 0x110000; i++) if (unicode_names[i] != NULL) { unsigned int result = unicode_name_character (unicode_names[i]); @@ -273,12 +270,12 @@ test_inverse_lookup () /* Second, generate random but likely names and verify they are not recognized unless really valid. */ - for (i = 0; i < 10000; i++) + for (unsigned int i = 0; i < 10000; i++) { unsigned int i1, i2; const char *s1; const char *s2; - unsigned int l1, l2, j1, j2; + unsigned int l1, l2; char buf[2*UNINAME_MAX]; unsigned int result; @@ -298,9 +295,9 @@ test_inverse_lookup () l2 = strlen (s2); /* Concatenate a starting piece of s1 with an ending piece of s2. */ - for (j1 = 1; j1 <= l1; j1++) + for (unsigned int j1 = 1; j1 <= l1; j1++) if (j1 == l1 || s1[j1] == ' ') - for (j2 = 0; j2 < l2; j2++) + for (unsigned int j2 = 0; j2 < l2; j2++) if (j2 == 0 || s2[j2-1] == ' ') { memcpy (buf, s1, j1); @@ -333,11 +330,10 @@ static int test_alias_lookup () { int error = 0; - unsigned int i; char buf[UNINAME_MAX]; /* Verify all valid character names are recognized. */ - for (i = 0; i < ALIASLEN; i++) + for (unsigned int i = 0; i < ALIASLEN; i++) if (unicode_aliases[i].uc != UNINAME_INVALID /* Skip if the character has no canonical name (e.g. control characters). */ @@ -371,8 +367,7 @@ main (int argc, char *argv[]) if (i < argc) { - int j; - for (j = 0; j < ALIASLEN; j++) + for (int j = 0; j < ALIASLEN; j++) unicode_aliases[j].uc = UNINAME_INVALID; i++; |
