diff options
Diffstat (limited to 'tests/uniwidth')
| -rw-r--r-- | tests/uniwidth/test-u16-strwidth.c | 4 | ||||
| -rw-r--r-- | tests/uniwidth/test-u16-width.c | 4 | ||||
| -rw-r--r-- | tests/uniwidth/test-u32-strwidth.c | 4 | ||||
| -rw-r--r-- | tests/uniwidth/test-u32-width.c | 4 | ||||
| -rw-r--r-- | tests/uniwidth/test-u8-strwidth.c | 4 | ||||
| -rw-r--r-- | tests/uniwidth/test-u8-width.c | 4 | ||||
| -rw-r--r-- | tests/uniwidth/test-uc_width.c | 8 | ||||
| -rw-r--r-- | tests/uniwidth/test-uc_width2.c | 8 | ||||
| -rwxr-xr-x | tests/uniwidth/test-uc_width2.sh | 92 | ||||
| -rw-r--r-- | tests/uniwidth/test-uniwidth-h.c | 26 |
10 files changed, 105 insertions, 53 deletions
diff --git a/tests/uniwidth/test-u16-strwidth.c b/tests/uniwidth/test-u16-strwidth.c index a41d47c0..2cf8f1c2 100644 --- a/tests/uniwidth/test-u16-strwidth.c +++ b/tests/uniwidth/test-u16-strwidth.c @@ -1,5 +1,5 @@ /* Test of u16_strwidth() function. - Copyright (C) 2007-2022 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 @@ -54,5 +54,5 @@ main () ASSERT (u16_strwidth (input, "GB2312") == 6); } - return 0; + return test_exit_status; } diff --git a/tests/uniwidth/test-u16-width.c b/tests/uniwidth/test-u16-width.c index c8dc1ad9..1adaeb15 100644 --- a/tests/uniwidth/test-u16-width.c +++ b/tests/uniwidth/test-u16-width.c @@ -1,5 +1,5 @@ /* Test of u16_width() function. - Copyright (C) 2007-2022 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 @@ -60,5 +60,5 @@ main () ASSERT (u16_width (input + INPUT4_OFFSET, INPUT4_LENGTH, "GB2312") == 6); } - return 0; + return test_exit_status; } diff --git a/tests/uniwidth/test-u32-strwidth.c b/tests/uniwidth/test-u32-strwidth.c index 6e627a4b..cd8337cd 100644 --- a/tests/uniwidth/test-u32-strwidth.c +++ b/tests/uniwidth/test-u32-strwidth.c @@ -1,5 +1,5 @@ /* Test of u32_strwidth() function. - Copyright (C) 2007-2022 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 @@ -54,5 +54,5 @@ main () ASSERT (u32_strwidth (input, "GB2312") == 6); } - return 0; + return test_exit_status; } diff --git a/tests/uniwidth/test-u32-width.c b/tests/uniwidth/test-u32-width.c index 4c92c852..5630d10a 100644 --- a/tests/uniwidth/test-u32-width.c +++ b/tests/uniwidth/test-u32-width.c @@ -1,5 +1,5 @@ /* Test of u32_width() function. - Copyright (C) 2007-2022 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 @@ -60,5 +60,5 @@ main () ASSERT (u32_width (input + INPUT4_OFFSET, INPUT4_LENGTH, "GB2312") == 6); } - return 0; + return test_exit_status; } diff --git a/tests/uniwidth/test-u8-strwidth.c b/tests/uniwidth/test-u8-strwidth.c index 90fa4369..be28a297 100644 --- a/tests/uniwidth/test-u8-strwidth.c +++ b/tests/uniwidth/test-u8-strwidth.c @@ -1,5 +1,5 @@ /* Test of u8_strwidth() function. - Copyright (C) 2007-2022 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 @@ -49,5 +49,5 @@ main () ASSERT (u8_strwidth (input, "GB2312") == 6); } - return 0; + return test_exit_status; } diff --git a/tests/uniwidth/test-u8-width.c b/tests/uniwidth/test-u8-width.c index eb56bc00..6fb7a9b0 100644 --- a/tests/uniwidth/test-u8-width.c +++ b/tests/uniwidth/test-u8-width.c @@ -1,5 +1,5 @@ /* Test of u8_width() function. - Copyright (C) 2007-2022 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 @@ -58,5 +58,5 @@ main () ASSERT (u8_width (input + INPUT4_OFFSET, INPUT4_LENGTH, "GB2312") == 6); } - return 0; + return test_exit_status; } diff --git a/tests/uniwidth/test-uc_width.c b/tests/uniwidth/test-uc_width.c index 86389b26..fd7adcf7 100644 --- a/tests/uniwidth/test-uc_width.c +++ b/tests/uniwidth/test-uc_width.c @@ -1,5 +1,5 @@ /* Test of uc_width() function. - Copyright (C) 2007-2022 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 @@ -25,10 +25,8 @@ int main () { - ucs4_t uc; - /* Test width of ASCII characters. */ - for (uc = 0x0020; uc < 0x007F; uc++) + for (ucs4_t uc = 0x0020; uc < 0x007F; uc++) ASSERT (uc_width (uc, "ISO-8859-2") == 1); /* Test width of some non-spacing characters. */ @@ -52,5 +50,5 @@ main () ASSERT (uc_width (0x20369, "UTF-8") == 2); ASSERT (uc_width (0x2F876, "UTF-8") == 2); - return 0; + return test_exit_status; } diff --git a/tests/uniwidth/test-uc_width2.c b/tests/uniwidth/test-uc_width2.c index d088cf39..ef2fd88a 100644 --- a/tests/uniwidth/test-uc_width2.c +++ b/tests/uniwidth/test-uc_width2.c @@ -1,5 +1,5 @@ /* Test of uc_width() function. - Copyright (C) 2007-2022 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 @@ -60,9 +60,7 @@ add_to_interval (ucs4_t uc, char width) int main () { - ucs4_t uc; - - for (uc = 0; uc < 0x110000; uc++) + for (ucs4_t uc = 0; uc < 0x110000; uc++) { int w1 = uc_width (uc, "UTF-8"); int w2 = uc_width (uc, "GBK"); @@ -82,5 +80,5 @@ main () } finish_interval (); - return 0; + return test_exit_status; } diff --git a/tests/uniwidth/test-uc_width2.sh b/tests/uniwidth/test-uc_width2.sh index 2833aef1..81c07cb8 100755 --- a/tests/uniwidth/test-uc_width2.sh +++ b/tests/uniwidth/test-uc_width2.sh @@ -1,7 +1,7 @@ #!/bin/sh tmpfiles="" -trap 'rm -fr $tmpfiles' 1 2 3 15 +trap 'rm -fr $tmpfiles' HUP INT QUIT TERM tmpfiles="$tmpfiles uc_width.out" ${CHECKER} ./test-uc_width2${EXEEXT} | LC_ALL=C tr -d '\r' > uc_width.out @@ -27,9 +27,7 @@ cat > uc_width.ok <<\EOF 05C4..05C5 0 05C6 A 05C7 0 -05C8..05FF A -0600..0605 0 -0606..060F A +05C8..060F A 0610..061A 0 061B A 061C 0 @@ -38,16 +36,14 @@ cat > uc_width.ok <<\EOF 0660..066F A 0670 0 0671..06D5 A -06D6..06DD 0 -06DE A +06D6..06DC 0 +06DD..06DE A 06DF..06E4 0 06E5..06E6 A 06E7..06E8 0 06E9 A 06EA..06ED 0 -06EE..070E A -070F 0 -0710 A +06EE..0710 A 0711 0 0712..072F A 0730..074A 0 @@ -67,12 +63,12 @@ cat > uc_width.ok <<\EOF 0829..082D 0 082E..0858 A 0859..085B 0 -085C..088F A -0890..0891 0 -0892..0897 A -0898..089F 0 +085C..0896 A +0897..089F 0 08A0..08C9 A -08CA..0902 0 +08CA..08E1 0 +08E2 A +08E3..0902 0 0903..0939 A 093A 0 093B A @@ -299,8 +295,10 @@ cat > uc_width.ok <<\EOF 1A7D..1A7E A 1A7F 0 1A80..1AAF A -1AB0..1ACE 0 -1ACF..1AFF A +1AB0..1ADD 0 +1ADE..1ADF A +1AE0..1AEB 0 +1AEC..1AFF A 1B00..1B03 0 1B04..1B33 A 1B34 0 @@ -558,10 +556,12 @@ FFFC..101FC 1 10AE5..10AE6 0 10AE7..10D23 1 10D24..10D27 0 -10D28..10EAA 1 +10D28..10D68 1 +10D69..10D6D 0 +10D6E..10EAA 1 10EAB..10EAC 0 -10EAD..10EFC 1 -10EFD..10EFF 0 +10EAD..10EF9 1 +10EFA..10EFF 0 10F00..10F45 1 10F46..10F50 0 10F51..10F81 1 @@ -580,13 +580,9 @@ FFFC..101FC 1 110B3..110B6 0 110B7..110B8 1 110B9..110BA 0 -110BB..110BC 1 -110BD 0 -110BE..110C1 1 +110BB..110C1 1 110C2 0 -110C3..110CC 1 -110CD 0 -110CE..110FF 1 +110C3..110FF 1 11100..11102 0 11103..11126 1 11127..1112B 0 @@ -626,7 +622,17 @@ FFFC..101FC 1 11366..1136C 0 1136D..1136F 1 11370..11374 0 -11375..11437 1 +11375..113BA 1 +113BB..113C0 0 +113C1..113CD 1 +113CE 0 +113CF 1 +113D0 0 +113D1 1 +113D2 0 +113D3..113E0 1 +113E1..113E2 0 +113E3..11437 1 11438..1143F 0 11440..11441 1 11442..11444 0 @@ -665,7 +671,9 @@ FFFC..101FC 1 116B6 1 116B7 0 116B8..1171C 1 -1171D..1171F 0 +1171D 0 +1171E 1 +1171F 0 11720..11721 1 11722..11725 0 11726 1 @@ -704,7 +712,13 @@ FFFC..101FC 1 11A8A..11A96 0 11A97 1 11A98..11A99 0 -11A9A..11C2F 1 +11A9A..11B5F 1 +11B60 0 +11B61 1 +11B62..11B64 0 +11B65 1 +11B66 0 +11B67..11C2F 1 11C30..11C36 0 11C37 1 11C38..11C3D 0 @@ -742,11 +756,17 @@ FFFC..101FC 1 11F40 0 11F41 1 11F42 0 -11F43..1342F 1 +11F43..11F59 1 +11F5A 0 +11F5B..1342F 1 13430..13440 0 13441..13446 1 13447..13455 0 -13456..16AEF 1 +13456..1611D 1 +1611E..16129 0 +1612A..1612C 1 +1612D..1612F 0 +16130..16AEF 1 16AF0..16AF4 0 16AF5..16B2F 1 16B30..16B36 0 @@ -829,7 +849,17 @@ FFFC..101FC 1 1E2EC..1E2EF 0 1E2F0..1E4EB 1 1E4EC..1E4EF 0 -1E4F0..1E8CF 1 +1E4F0..1E5ED 1 +1E5EE..1E5EF 0 +1E5F0..1E6E2 1 +1E6E3 0 +1E6E4..1E6E5 1 +1E6E6 0 +1E6E7..1E6ED 1 +1E6EE..1E6EF 0 +1E6F0..1E6F4 1 +1E6F5 0 +1E6F6..1E8CF 1 1E8D0..1E8D6 0 1E8D7..1E943 1 1E944..1E94A 0 diff --git a/tests/uniwidth/test-uniwidth-h.c b/tests/uniwidth/test-uniwidth-h.c new file mode 100644 index 00000000..70152039 --- /dev/null +++ b/tests/uniwidth/test-uniwidth-h.c @@ -0,0 +1,26 @@ +/* Test of <uniwidth.h>. + Copyright (C) 2025-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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <uniwidth.h> + +int +main (void) +{ + return 0; +} |
