From: Bruno Haible Date: Mon, 21 Mar 2011 21:58:36 +0000 (+0100) Subject: Tests for module 'unictype/joiningtype-byname'. X-Git-Tag: v0.1~3073 X-Git-Url: http://erislabs.net/gitweb/?p=gnulib.git;a=commitdiff_plain;h=7570f48a8681cd2b3eec73a737727008dfd9fdfe Tests for module 'unictype/joiningtype-byname'. * modules/unictype/joiningtype-byname-tests: New file. * tests/unictype/test-joiningtype_byname.c: New file. --- diff --git a/ChangeLog b/ChangeLog index 36842df0b..7ceb80277 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2011-03-21 Bruno Haible + Tests for module 'unictype/joiningtype-byname'. + * modules/unictype/joiningtype-byname-tests: New file. + * tests/unictype/test-joiningtype_byname.c: New file. + New module 'unictype/joiningtype-byname'. * modules/unictype/joiningtype-byname: New file. * lib/unictype/joiningtype_byname.c: New file. diff --git a/modules/unictype/joiningtype-byname-tests b/modules/unictype/joiningtype-byname-tests new file mode 100644 index 000000000..5163f0459 --- /dev/null +++ b/modules/unictype/joiningtype-byname-tests @@ -0,0 +1,13 @@ +Files: +tests/unictype/test-joiningtype_byname.c +tests/macros.h + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-joiningtype_byname +check_PROGRAMS += test-joiningtype_byname +test_joiningtype_byname_SOURCES = unictype/test-joiningtype_byname.c +test_joiningtype_byname_LDADD = $(LDADD) $(LIBUNISTRING) diff --git a/tests/unictype/test-joiningtype_byname.c b/tests/unictype/test-joiningtype_byname.c new file mode 100644 index 000000000..900b38a8a --- /dev/null +++ b/tests/unictype/test-joiningtype_byname.c @@ -0,0 +1,40 @@ +/* Test the Unicode character Arabic joining type functions. + Copyright (C) 2011 Free Software Foundation, Inc. + Written by Bruno Haible , 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 . */ + +#include + +/* Specification. */ +#include "unictype.h" + +#include + +#include "macros.h" + +int +main () +{ + ASSERT (uc_joining_type_byname ("U") == UC_JOINING_TYPE_U); + ASSERT (uc_joining_type_byname ("T") == UC_JOINING_TYPE_T); + ASSERT (uc_joining_type_byname ("C") == UC_JOINING_TYPE_C); + ASSERT (uc_joining_type_byname ("L") == UC_JOINING_TYPE_L); + ASSERT (uc_joining_type_byname ("R") == UC_JOINING_TYPE_R); + ASSERT (uc_joining_type_byname ("D") == UC_JOINING_TYPE_D); + ASSERT (uc_joining_type_byname ("X") < 0); + ASSERT (uc_joining_type_byname ("") < 0); + + return 0; +}