Mercurial > hg > octave-kai > gnulib-hg
changeset 14452:b61ad0463b76
Tests for module 'unictype/joiningtype-of'.
* modules/unictype/joiningtype-of-tests: New file.
* tests/unictype/test-joiningtype_of.c: New file.
* tests/unictype/test-joiningtype_of.h: New file, automatically
generated by gen-uni-tables.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Mon, 21 Mar 2011 23:04:10 +0100 |
parents | 3a8e630d8a31 |
children | 74c1200a73eb |
files | ChangeLog modules/unictype/joiningtype-of-tests tests/unictype/test-joiningtype_of.c tests/unictype/test-joiningtype_of.h |
diffstat | 4 files changed, 364 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2011-03-21 Bruno Haible <bruno@clisp.org> + Tests for module 'unictype/joiningtype-of'. + * modules/unictype/joiningtype-of-tests: New file. + * tests/unictype/test-joiningtype_of.c: New file. + * tests/unictype/test-joiningtype_of.h: New file, automatically + generated by gen-uni-tables. + New module 'unictype/joiningtype-of'. * modules/unictype/joiningtype-of: New file. * lib/unictype/joiningtype_of.c: New file.
new file mode 100644 --- /dev/null +++ b/modules/unictype/joiningtype-of-tests @@ -0,0 +1,14 @@ +Files: +tests/unictype/test-joiningtype_of.c +tests/unictype/test-joiningtype_of.h +tests/macros.h + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-joiningtype_of +check_PROGRAMS += test-joiningtype_of +test_joiningtype_of_SOURCES = unictype/test-joiningtype_of.c +test_joiningtype_of_LDADD = $(LDADD) $(LIBUNISTRING)
new file mode 100644 --- /dev/null +++ b/tests/unictype/test-joiningtype_of.c @@ -0,0 +1,65 @@ +/* Test the Unicode character Arabic joining type functions. + Copyright (C) 2011 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2011. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "unictype.h" + +#include <string.h> + +#include "macros.h" + +typedef struct { ucs4_t ch; int value; } pair_t; + +static const pair_t mapping[] = + { +#include "test-joiningtype_of.h" + }; + +int +main () +{ + unsigned int c; + size_t i; + + c = 0; + for (i = 0; i < SIZEOF (mapping); i++) + { + for (; c < mapping[i].ch; c++) + ASSERT (uc_joining_type (c) == UC_JOINING_TYPE_U + || uc_joining_type (c) == UC_JOINING_TYPE_T); + ASSERT (uc_joining_type (c) == mapping[i].value); + c++; + } + for (; c < 0x110000; c++) + ASSERT (uc_joining_type (c) == UC_JOINING_TYPE_U + || uc_joining_type (c) == UC_JOINING_TYPE_T); + + /* Test distinction between U and T. */ + ASSERT (uc_joining_type (0x060C) == UC_JOINING_TYPE_U); + ASSERT (uc_joining_type (0x060D) == UC_JOINING_TYPE_U); + ASSERT (uc_joining_type (0x060E) == UC_JOINING_TYPE_U); + ASSERT (uc_joining_type (0x060F) == UC_JOINING_TYPE_U); + ASSERT (uc_joining_type (0x0610) == UC_JOINING_TYPE_T); + ASSERT (uc_joining_type (0x0611) == UC_JOINING_TYPE_T); + ASSERT (uc_joining_type (0x0612) == UC_JOINING_TYPE_T); + ASSERT (uc_joining_type (0x0613) == UC_JOINING_TYPE_T); + ASSERT (uc_joining_type (0x0614) == UC_JOINING_TYPE_T); + + return 0; +}
new file mode 100644 --- /dev/null +++ b/tests/unictype/test-joiningtype_of.h @@ -0,0 +1,279 @@ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +/* Arabic joining type of Unicode characters. */ +/* Generated automatically by gen-uni-tables.c for Unicode 6.0.0. */ + { 0x0600, UC_JOINING_TYPE_U }, + { 0x0601, UC_JOINING_TYPE_U }, + { 0x0602, UC_JOINING_TYPE_U }, + { 0x0603, UC_JOINING_TYPE_U }, + { 0x0608, UC_JOINING_TYPE_U }, + { 0x060B, UC_JOINING_TYPE_U }, + { 0x0620, UC_JOINING_TYPE_D }, + { 0x0621, UC_JOINING_TYPE_U }, + { 0x0622, UC_JOINING_TYPE_R }, + { 0x0623, UC_JOINING_TYPE_R }, + { 0x0624, UC_JOINING_TYPE_R }, + { 0x0625, UC_JOINING_TYPE_R }, + { 0x0626, UC_JOINING_TYPE_D }, + { 0x0627, UC_JOINING_TYPE_R }, + { 0x0628, UC_JOINING_TYPE_D }, + { 0x0629, UC_JOINING_TYPE_R }, + { 0x062A, UC_JOINING_TYPE_D }, + { 0x062B, UC_JOINING_TYPE_D }, + { 0x062C, UC_JOINING_TYPE_D }, + { 0x062D, UC_JOINING_TYPE_D }, + { 0x062E, UC_JOINING_TYPE_D }, + { 0x062F, UC_JOINING_TYPE_R }, + { 0x0630, UC_JOINING_TYPE_R }, + { 0x0631, UC_JOINING_TYPE_R }, + { 0x0632, UC_JOINING_TYPE_R }, + { 0x0633, UC_JOINING_TYPE_D }, + { 0x0634, UC_JOINING_TYPE_D }, + { 0x0635, UC_JOINING_TYPE_D }, + { 0x0636, UC_JOINING_TYPE_D }, + { 0x0637, UC_JOINING_TYPE_D }, + { 0x0638, UC_JOINING_TYPE_D }, + { 0x0639, UC_JOINING_TYPE_D }, + { 0x063A, UC_JOINING_TYPE_D }, + { 0x063B, UC_JOINING_TYPE_D }, + { 0x063C, UC_JOINING_TYPE_D }, + { 0x063D, UC_JOINING_TYPE_D }, + { 0x063E, UC_JOINING_TYPE_D }, + { 0x063F, UC_JOINING_TYPE_D }, + { 0x0640, UC_JOINING_TYPE_C }, + { 0x0641, UC_JOINING_TYPE_D }, + { 0x0642, UC_JOINING_TYPE_D }, + { 0x0643, UC_JOINING_TYPE_D }, + { 0x0644, UC_JOINING_TYPE_D }, + { 0x0645, UC_JOINING_TYPE_D }, + { 0x0646, UC_JOINING_TYPE_D }, + { 0x0647, UC_JOINING_TYPE_D }, + { 0x0648, UC_JOINING_TYPE_R }, + { 0x0649, UC_JOINING_TYPE_D }, + { 0x064A, UC_JOINING_TYPE_D }, + { 0x066E, UC_JOINING_TYPE_D }, + { 0x066F, UC_JOINING_TYPE_D }, + { 0x0671, UC_JOINING_TYPE_R }, + { 0x0672, UC_JOINING_TYPE_R }, + { 0x0673, UC_JOINING_TYPE_R }, + { 0x0674, UC_JOINING_TYPE_U }, + { 0x0675, UC_JOINING_TYPE_R }, + { 0x0676, UC_JOINING_TYPE_R }, + { 0x0677, UC_JOINING_TYPE_R }, + { 0x0678, UC_JOINING_TYPE_D }, + { 0x0679, UC_JOINING_TYPE_D }, + { 0x067A, UC_JOINING_TYPE_D }, + { 0x067B, UC_JOINING_TYPE_D }, + { 0x067C, UC_JOINING_TYPE_D }, + { 0x067D, UC_JOINING_TYPE_D }, + { 0x067E, UC_JOINING_TYPE_D }, + { 0x067F, UC_JOINING_TYPE_D }, + { 0x0680, UC_JOINING_TYPE_D }, + { 0x0681, UC_JOINING_TYPE_D }, + { 0x0682, UC_JOINING_TYPE_D }, + { 0x0683, UC_JOINING_TYPE_D }, + { 0x0684, UC_JOINING_TYPE_D }, + { 0x0685, UC_JOINING_TYPE_D }, + { 0x0686, UC_JOINING_TYPE_D }, + { 0x0687, UC_JOINING_TYPE_D }, + { 0x0688, UC_JOINING_TYPE_R }, + { 0x0689, UC_JOINING_TYPE_R }, + { 0x068A, UC_JOINING_TYPE_R }, + { 0x068B, UC_JOINING_TYPE_R }, + { 0x068C, UC_JOINING_TYPE_R }, + { 0x068D, UC_JOINING_TYPE_R }, + { 0x068E, UC_JOINING_TYPE_R }, + { 0x068F, UC_JOINING_TYPE_R }, + { 0x0690, UC_JOINING_TYPE_R }, + { 0x0691, UC_JOINING_TYPE_R }, + { 0x0692, UC_JOINING_TYPE_R }, + { 0x0693, UC_JOINING_TYPE_R }, + { 0x0694, UC_JOINING_TYPE_R }, + { 0x0695, UC_JOINING_TYPE_R }, + { 0x0696, UC_JOINING_TYPE_R }, + { 0x0697, UC_JOINING_TYPE_R }, + { 0x0698, UC_JOINING_TYPE_R }, + { 0x0699, UC_JOINING_TYPE_R }, + { 0x069A, UC_JOINING_TYPE_D }, + { 0x069B, UC_JOINING_TYPE_D }, + { 0x069C, UC_JOINING_TYPE_D }, + { 0x069D, UC_JOINING_TYPE_D }, + { 0x069E, UC_JOINING_TYPE_D }, + { 0x069F, UC_JOINING_TYPE_D }, + { 0x06A0, UC_JOINING_TYPE_D }, + { 0x06A1, UC_JOINING_TYPE_D }, + { 0x06A2, UC_JOINING_TYPE_D }, + { 0x06A3, UC_JOINING_TYPE_D }, + { 0x06A4, UC_JOINING_TYPE_D }, + { 0x06A5, UC_JOINING_TYPE_D }, + { 0x06A6, UC_JOINING_TYPE_D }, + { 0x06A7, UC_JOINING_TYPE_D }, + { 0x06A8, UC_JOINING_TYPE_D }, + { 0x06A9, UC_JOINING_TYPE_D }, + { 0x06AA, UC_JOINING_TYPE_D }, + { 0x06AB, UC_JOINING_TYPE_D }, + { 0x06AC, UC_JOINING_TYPE_D }, + { 0x06AD, UC_JOINING_TYPE_D }, + { 0x06AE, UC_JOINING_TYPE_D }, + { 0x06AF, UC_JOINING_TYPE_D }, + { 0x06B0, UC_JOINING_TYPE_D }, + { 0x06B1, UC_JOINING_TYPE_D }, + { 0x06B2, UC_JOINING_TYPE_D }, + { 0x06B3, UC_JOINING_TYPE_D }, + { 0x06B4, UC_JOINING_TYPE_D }, + { 0x06B5, UC_JOINING_TYPE_D }, + { 0x06B6, UC_JOINING_TYPE_D }, + { 0x06B7, UC_JOINING_TYPE_D }, + { 0x06B8, UC_JOINING_TYPE_D }, + { 0x06B9, UC_JOINING_TYPE_D }, + { 0x06BA, UC_JOINING_TYPE_D }, + { 0x06BB, UC_JOINING_TYPE_D }, + { 0x06BC, UC_JOINING_TYPE_D }, + { 0x06BD, UC_JOINING_TYPE_D }, + { 0x06BE, UC_JOINING_TYPE_D }, + { 0x06BF, UC_JOINING_TYPE_D }, + { 0x06C0, UC_JOINING_TYPE_R }, + { 0x06C1, UC_JOINING_TYPE_D }, + { 0x06C2, UC_JOINING_TYPE_D }, + { 0x06C3, UC_JOINING_TYPE_R }, + { 0x06C4, UC_JOINING_TYPE_R }, + { 0x06C5, UC_JOINING_TYPE_R }, + { 0x06C6, UC_JOINING_TYPE_R }, + { 0x06C7, UC_JOINING_TYPE_R }, + { 0x06C8, UC_JOINING_TYPE_R }, + { 0x06C9, UC_JOINING_TYPE_R }, + { 0x06CA, UC_JOINING_TYPE_R }, + { 0x06CB, UC_JOINING_TYPE_R }, + { 0x06CC, UC_JOINING_TYPE_D }, + { 0x06CD, UC_JOINING_TYPE_R }, + { 0x06CE, UC_JOINING_TYPE_D }, + { 0x06CF, UC_JOINING_TYPE_R }, + { 0x06D0, UC_JOINING_TYPE_D }, + { 0x06D1, UC_JOINING_TYPE_D }, + { 0x06D2, UC_JOINING_TYPE_R }, + { 0x06D3, UC_JOINING_TYPE_R }, + { 0x06D5, UC_JOINING_TYPE_R }, + { 0x06DD, UC_JOINING_TYPE_U }, + { 0x06EE, UC_JOINING_TYPE_R }, + { 0x06EF, UC_JOINING_TYPE_R }, + { 0x06FA, UC_JOINING_TYPE_D }, + { 0x06FB, UC_JOINING_TYPE_D }, + { 0x06FC, UC_JOINING_TYPE_D }, + { 0x06FF, UC_JOINING_TYPE_D }, + { 0x0710, UC_JOINING_TYPE_R }, + { 0x0712, UC_JOINING_TYPE_D }, + { 0x0713, UC_JOINING_TYPE_D }, + { 0x0714, UC_JOINING_TYPE_D }, + { 0x0715, UC_JOINING_TYPE_R }, + { 0x0716, UC_JOINING_TYPE_R }, + { 0x0717, UC_JOINING_TYPE_R }, + { 0x0718, UC_JOINING_TYPE_R }, + { 0x0719, UC_JOINING_TYPE_R }, + { 0x071A, UC_JOINING_TYPE_D }, + { 0x071B, UC_JOINING_TYPE_D }, + { 0x071C, UC_JOINING_TYPE_D }, + { 0x071D, UC_JOINING_TYPE_D }, + { 0x071E, UC_JOINING_TYPE_R }, + { 0x071F, UC_JOINING_TYPE_D }, + { 0x0720, UC_JOINING_TYPE_D }, + { 0x0721, UC_JOINING_TYPE_D }, + { 0x0722, UC_JOINING_TYPE_D }, + { 0x0723, UC_JOINING_TYPE_D }, + { 0x0724, UC_JOINING_TYPE_D }, + { 0x0725, UC_JOINING_TYPE_D }, + { 0x0726, UC_JOINING_TYPE_D }, + { 0x0727, UC_JOINING_TYPE_D }, + { 0x0728, UC_JOINING_TYPE_R }, + { 0x0729, UC_JOINING_TYPE_D }, + { 0x072A, UC_JOINING_TYPE_R }, + { 0x072B, UC_JOINING_TYPE_D }, + { 0x072C, UC_JOINING_TYPE_R }, + { 0x072D, UC_JOINING_TYPE_D }, + { 0x072E, UC_JOINING_TYPE_D }, + { 0x072F, UC_JOINING_TYPE_R }, + { 0x074D, UC_JOINING_TYPE_R }, + { 0x074E, UC_JOINING_TYPE_D }, + { 0x074F, UC_JOINING_TYPE_D }, + { 0x0750, UC_JOINING_TYPE_D }, + { 0x0751, UC_JOINING_TYPE_D }, + { 0x0752, UC_JOINING_TYPE_D }, + { 0x0753, UC_JOINING_TYPE_D }, + { 0x0754, UC_JOINING_TYPE_D }, + { 0x0755, UC_JOINING_TYPE_D }, + { 0x0756, UC_JOINING_TYPE_D }, + { 0x0757, UC_JOINING_TYPE_D }, + { 0x0758, UC_JOINING_TYPE_D }, + { 0x0759, UC_JOINING_TYPE_R }, + { 0x075A, UC_JOINING_TYPE_R }, + { 0x075B, UC_JOINING_TYPE_R }, + { 0x075C, UC_JOINING_TYPE_D }, + { 0x075D, UC_JOINING_TYPE_D }, + { 0x075E, UC_JOINING_TYPE_D }, + { 0x075F, UC_JOINING_TYPE_D }, + { 0x0760, UC_JOINING_TYPE_D }, + { 0x0761, UC_JOINING_TYPE_D }, + { 0x0762, UC_JOINING_TYPE_D }, + { 0x0763, UC_JOINING_TYPE_D }, + { 0x0764, UC_JOINING_TYPE_D }, + { 0x0765, UC_JOINING_TYPE_D }, + { 0x0766, UC_JOINING_TYPE_D }, + { 0x0767, UC_JOINING_TYPE_D }, + { 0x0768, UC_JOINING_TYPE_D }, + { 0x0769, UC_JOINING_TYPE_D }, + { 0x076A, UC_JOINING_TYPE_D }, + { 0x076B, UC_JOINING_TYPE_R }, + { 0x076C, UC_JOINING_TYPE_R }, + { 0x076D, UC_JOINING_TYPE_D }, + { 0x076E, UC_JOINING_TYPE_D }, + { 0x076F, UC_JOINING_TYPE_D }, + { 0x0770, UC_JOINING_TYPE_D }, + { 0x0771, UC_JOINING_TYPE_R }, + { 0x0772, UC_JOINING_TYPE_D }, + { 0x0773, UC_JOINING_TYPE_R }, + { 0x0774, UC_JOINING_TYPE_R }, + { 0x0775, UC_JOINING_TYPE_D }, + { 0x0776, UC_JOINING_TYPE_D }, + { 0x0777, UC_JOINING_TYPE_D }, + { 0x0778, UC_JOINING_TYPE_R }, + { 0x0779, UC_JOINING_TYPE_R }, + { 0x077A, UC_JOINING_TYPE_D }, + { 0x077B, UC_JOINING_TYPE_D }, + { 0x077C, UC_JOINING_TYPE_D }, + { 0x077D, UC_JOINING_TYPE_D }, + { 0x077E, UC_JOINING_TYPE_D }, + { 0x077F, UC_JOINING_TYPE_D }, + { 0x07CA, UC_JOINING_TYPE_D }, + { 0x07CB, UC_JOINING_TYPE_D }, + { 0x07CC, UC_JOINING_TYPE_D }, + { 0x07CD, UC_JOINING_TYPE_D }, + { 0x07CE, UC_JOINING_TYPE_D }, + { 0x07CF, UC_JOINING_TYPE_D }, + { 0x07D0, UC_JOINING_TYPE_D }, + { 0x07D1, UC_JOINING_TYPE_D }, + { 0x07D2, UC_JOINING_TYPE_D }, + { 0x07D3, UC_JOINING_TYPE_D }, + { 0x07D4, UC_JOINING_TYPE_D }, + { 0x07D5, UC_JOINING_TYPE_D }, + { 0x07D6, UC_JOINING_TYPE_D }, + { 0x07D7, UC_JOINING_TYPE_D }, + { 0x07D8, UC_JOINING_TYPE_D }, + { 0x07D9, UC_JOINING_TYPE_D }, + { 0x07DA, UC_JOINING_TYPE_D }, + { 0x07DB, UC_JOINING_TYPE_D }, + { 0x07DC, UC_JOINING_TYPE_D }, + { 0x07DD, UC_JOINING_TYPE_D }, + { 0x07DE, UC_JOINING_TYPE_D }, + { 0x07DF, UC_JOINING_TYPE_D }, + { 0x07E0, UC_JOINING_TYPE_D }, + { 0x07E1, UC_JOINING_TYPE_D }, + { 0x07E2, UC_JOINING_TYPE_D }, + { 0x07E3, UC_JOINING_TYPE_D }, + { 0x07E4, UC_JOINING_TYPE_D }, + { 0x07E5, UC_JOINING_TYPE_D }, + { 0x07E6, UC_JOINING_TYPE_D }, + { 0x07E7, UC_JOINING_TYPE_D }, + { 0x07E8, UC_JOINING_TYPE_D }, + { 0x07E9, UC_JOINING_TYPE_D }, + { 0x07EA, UC_JOINING_TYPE_D }, + { 0x07FA, UC_JOINING_TYPE_C }, + { 0x200C, UC_JOINING_TYPE_U }, + { 0x200D, UC_JOINING_TYPE_C }