From: Bruno Haible Date: Mon, 21 Mar 2011 21:55:30 +0000 (+0100) Subject: Tests for module 'unictype/joiningtype-name'. X-Git-Tag: v0.1~3075 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=c39048baf36b2bc4ebdf3956b096d5a675e01de4;p=gnulib.git Tests for module 'unictype/joiningtype-name'. * modules/unictype/joiningtype-name-tests: New file. * tests/unictype/test-joiningtype_name.c: New file. --- diff --git a/ChangeLog b/ChangeLog index 8edc356c5..07d4b5f2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2011-03-21 Bruno Haible + Tests for module 'unictype/joiningtype-name'. + * modules/unictype/joiningtype-name-tests: New file. + * tests/unictype/test-joiningtype_name.c: New file. + New module 'unictype/joiningtype-name'. * modules/unictype/joiningtype-name: New file. * lib/unictype/joiningtype_name.c: New file. diff --git a/modules/unictype/joiningtype-name-tests b/modules/unictype/joiningtype-name-tests new file mode 100644 index 000000000..d46e8ae53 --- /dev/null +++ b/modules/unictype/joiningtype-name-tests @@ -0,0 +1,13 @@ +Files: +tests/unictype/test-joiningtype_name.c +tests/macros.h + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-joiningtype_name +check_PROGRAMS += test-joiningtype_name +test_joiningtype_name_SOURCES = unictype/test-joiningtype_name.c +test_joiningtype_name_LDADD = $(LDADD) $(LIBUNISTRING) diff --git a/tests/unictype/test-joiningtype_name.c b/tests/unictype/test-joiningtype_name.c new file mode 100644 index 000000000..83cbeb127 --- /dev/null +++ b/tests/unictype/test-joiningtype_name.c @@ -0,0 +1,39 @@ +/* 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 (strcmp (uc_joining_type_name (UC_JOINING_TYPE_U), "U") == 0); + ASSERT (strcmp (uc_joining_type_name (UC_JOINING_TYPE_T), "T") == 0); + ASSERT (strcmp (uc_joining_type_name (UC_JOINING_TYPE_C), "C") == 0); + ASSERT (strcmp (uc_joining_type_name (UC_JOINING_TYPE_L), "L") == 0); + ASSERT (strcmp (uc_joining_type_name (UC_JOINING_TYPE_R), "R") == 0); + ASSERT (strcmp (uc_joining_type_name (UC_JOINING_TYPE_D), "D") == 0); + ASSERT (uc_joining_type_name (-1) == NULL); + + return 0; +}