summaryrefslogtreecommitdiff
path: root/tests/unistr/test-u16-uctomb.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2026-03-10 13:24:07 +0100
committerJörg Frings-Fürst <debian@jff.email>2026-03-10 13:24:07 +0100
commitcfd1f17f1a85d95ea12bca8dae42add7dad1ad11 (patch)
tree8016486f8ee7157213f2d09ff2491bfa9c94638a /tests/unistr/test-u16-uctomb.c
parent14e4d584d0121031ec40e6c35869745f1747ff29 (diff)
parent1403307d6e2fb4e7b5d97a35f40d1e95134561ab (diff)
Merge branch 'release/debian/1.4.2-1'HEADdebian/1.4.2-1master
Diffstat (limited to 'tests/unistr/test-u16-uctomb.c')
-rw-r--r--tests/unistr/test-u16-uctomb.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/tests/unistr/test-u16-uctomb.c b/tests/unistr/test-u16-uctomb.c
index 03b9eaa8..5288f25d 100644
--- a/tests/unistr/test-u16-uctomb.c
+++ b/tests/unistr/test-u16-uctomb.c
@@ -1,5 +1,5 @@
/* Test of u16_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++)
- {
- uint16_t buf[3] = { MAGIC, MAGIC, MAGIC };
- int ret;
+ for (ucs4_t uc = 0; uc < 0x80; uc++)
+ {
+ uint16_t buf[3] = { MAGIC, MAGIC, MAGIC };
+ int ret;
- ret = u16_uctomb (buf, uc, 0);
- ASSERT (ret == -2);
- ASSERT (buf[0] == MAGIC);
+ ret = u16_uctomb (buf, uc, 0);
+ ASSERT (ret == -2);
+ ASSERT (buf[0] == MAGIC);
- ret = u16_uctomb (buf, uc, 1);
- ASSERT (ret == 1);
- ASSERT (buf[0] == uc);
- ASSERT (buf[1] == MAGIC);
- }
- }
+ ret = u16_uctomb (buf, uc, 1);
+ ASSERT (ret == 1);
+ ASSERT (buf[0] == uc);
+ ASSERT (buf[1] == MAGIC);
+ }
/* Test BMP character. */
{
@@ -88,14 +84,12 @@ main ()
{
ucs4_t invalid[] = { 0x110000, 0xD800, 0xDBFF, 0xDC00, 0xDFFF };
uint16_t buf[3] = { MAGIC, 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 = u16_uctomb (buf, uc, n);
ASSERT (ret == -1);