diff options
Diffstat (limited to 'tests/unistr/test-u32-uctomb.c')
| -rw-r--r-- | tests/unistr/test-u32-uctomb.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/tests/unistr/test-u32-uctomb.c b/tests/unistr/test-u32-uctomb.c index 24d83410..752b2acd 100644 --- a/tests/unistr/test-u32-uctomb.c +++ b/tests/unistr/test-u32-uctomb.c @@ -1,5 +1,5 @@ /* Test of u32_uctomb() function. - 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 General Public License as published by @@ -28,24 +28,20 @@ int main () { /* Test ISO 646 character, in particular the NUL character. */ - { - ucs4_t uc; - - for (uc = 0; uc < 0x80; uc++) - { - uint32_t buf[2] = { MAGIC, MAGIC }; - int ret; + for (ucs4_t uc = 0; uc < 0x80; uc++) + { + uint32_t buf[2] = { MAGIC, MAGIC }; + int ret; - ret = u32_uctomb (buf, uc, 0); - ASSERT (ret == -2); - ASSERT (buf[0] == MAGIC); + ret = u32_uctomb (buf, uc, 0); + ASSERT (ret == -2); + ASSERT (buf[0] == MAGIC); - ret = u32_uctomb (buf, uc, 1); - ASSERT (ret == 1); - ASSERT (buf[0] == uc); - ASSERT (buf[1] == MAGIC); - } - } + ret = u32_uctomb (buf, uc, 1); + ASSERT (ret == 1); + ASSERT (buf[0] == uc); + ASSERT (buf[1] == MAGIC); + } /* Test BMP character. */ { @@ -83,14 +79,12 @@ main () { ucs4_t invalid[] = { 0x110000, 0xD800, 0xDBFF, 0xDC00, 0xDFFF }; uint32_t buf[2] = { MAGIC, MAGIC }; - size_t i; - for (i = 0; i < SIZEOF (invalid); i++) + for (size_t i = 0; i < SIZEOF (invalid); i++) { ucs4_t uc = invalid[i]; - int n; - for (n = 0; n <= 2; n++) + for (int n = 0; n <= 2; n++) { int ret = u32_uctomb (buf, uc, n); ASSERT (ret == -1); |
