diff options
Diffstat (limited to 'tests/uniconv/test-u32-conv-to-enc.c')
| -rw-r--r-- | tests/uniconv/test-u32-conv-to-enc.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/tests/uniconv/test-u32-conv-to-enc.c b/tests/uniconv/test-u32-conv-to-enc.c index e26d559f..e23e2867 100644 --- a/tests/uniconv/test-u32-conv-to-enc.c +++ b/tests/uniconv/test-u32-conv-to-enc.c @@ -1,5 +1,5 @@ /* Test of conversion from UTF-32 to legacy encodings. - Copyright (C) 2007-2024 Free Software Foundation, Inc. + Copyright (C) 2007-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 @@ -43,15 +43,12 @@ main () #if HAVE_ICONV static enum iconv_ilseq_handler handlers[] = { iconveh_error, iconveh_question_mark, iconveh_escape_sequence }; - size_t h; - size_t o; - size_t i; /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1, ISO-8859-2, and UTF-8. */ /* Test conversion from UTF-32 to ISO-8859-1 with no errors. */ - for (h = 0; h < SIZEOF (handlers); h++) + for (size_t h = 0; h < SIZEOF (handlers); h++) { enum iconv_ilseq_handler handler = handlers[h]; static const uint32_t input[] = /* Ärger mit bösen Bübchen ohne Augenmaß */ @@ -61,7 +58,7 @@ main () 'n', 'e', ' ', 'A', 'u', 'g', 'e', 'n', 'm', 'a', 0xDF }; static const char expected[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; - for (o = 0; o < 2; o++) + for (size_t o = 0; o < 2; o++) { size_t *offsets = (o ? new_offsets (SIZEOF (input)) : NULL); size_t length; @@ -74,7 +71,7 @@ main () ASSERT (memcmp (result, expected, length) == 0); if (o) { - for (i = 0; i < 37; i++) + for (size_t i = 0; i < 37; i++) ASSERT (offsets[i] == i); ASSERT (offsets[37] == MAGIC); free (offsets); @@ -84,7 +81,7 @@ main () } /* Test conversion from UTF-32 to ISO-8859-1 with EILSEQ. */ - for (h = 0; h < SIZEOF (handlers); h++) + for (size_t h = 0; h < SIZEOF (handlers); h++) { enum iconv_ilseq_handler handler = handlers[h]; static const uint32_t input[] = /* Rafał Maszkowski */ @@ -92,7 +89,7 @@ main () 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z', 'k', 'o', 'w', 's', 'k', 'i' }; - for (o = 0; o < 2; o++) + for (size_t o = 0; o < 2; o++) { size_t *offsets = (o ? new_offsets (SIZEOF (input)) : NULL); size_t length = 0xdead; @@ -119,7 +116,7 @@ main () || memcmp (result, expected_translit, length) == 0); if (o) { - for (i = 0; i < 16; i++) + for (size_t i = 0; i < 16; i++) ASSERT (offsets[i] == i); ASSERT (offsets[16] == MAGIC); free (offsets); @@ -135,7 +132,7 @@ main () ASSERT (memcmp (result, expected, length) == 0); if (o) { - for (i = 0; i < 16; i++) + for (size_t i = 0; i < 16; i++) ASSERT (offsets[i] == (i < 5 ? i : i + 5)); ASSERT (offsets[16] == MAGIC); free (offsets); |
