summaryrefslogtreecommitdiff
path: root/tests/unistr/test-u32-uctomb.c
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/unistr/test-u32-uctomb.c
parent27dae84ed92f1ef0300263091972338d12e78348 (diff)
New upstream version 1.4.2upstream/1.4.2upstream
Diffstat (limited to 'tests/unistr/test-u32-uctomb.c')
-rw-r--r--tests/unistr/test-u32-uctomb.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/tests/unistr/test-u32-uctomb.c b/tests/unistr/test-u32-uctomb.c
index f05b8646..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-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 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);