diff options
-rw-r--r-- | hangul/hangul.h | 1 | ||||
-rw-r--r-- | hangul/hangulkeyboard.c | 2 | ||||
-rw-r--r-- | test/Makefile.am | 4 | ||||
-rw-r--r-- | test/recursive.xml | 12 | ||||
-rw-r--r-- | test/test.c | 6 |
5 files changed, 22 insertions, 3 deletions
diff --git a/hangul/hangul.h b/hangul/hangul.h index 447e1e3..61d4357 100644 --- a/hangul/hangul.h +++ b/hangul/hangul.h @@ -101,6 +101,7 @@ int hangul_fini(); /* keyboard */ HangulKeyboard* hangul_keyboard_new(void); +HangulKeyboard* hangul_keyboard_new_from_file(const char* path); void hangul_keyboard_delete(HangulKeyboard *keyboard); void hangul_keyboard_set_type(HangulKeyboard *keyboard, int type); diff --git a/hangul/hangulkeyboard.c b/hangul/hangulkeyboard.c index caaae29..c04a417 100644 --- a/hangul/hangulkeyboard.c +++ b/hangul/hangulkeyboard.c @@ -767,7 +767,7 @@ done: context->path_stack_top--; } -static HangulKeyboard* +HangulKeyboard* hangul_keyboard_new_from_file(const char* path) { HangulKeyboardLoadContext context; diff --git a/test/Makefile.am b/test/Makefile.am index 5889f49..6364f50 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -12,5 +12,5 @@ hanja_LDADD = ../hangul/libhangul.la $(LTLIBINTL) TESTS = test check_PROGRAMS = test test_SOURCES = test.c ../hangul/hangul.h -test_CFLAGS = $(CHECK_CFLAGS) -test_LDADD = $(CHECK_LIBS) $(top_builddir)/hangul/libhangul.la $(LTLIBINTL) +test_CFLAGS = $(CHECK_CFLAGS) -DTEST_SOURCE_DIR=\"$(abs_srcdir)\" +test_LDADD = $(CHECK_LIBS) ../hangul/libhangul.la $(LTLIBINTL) diff --git a/test/recursive.xml b/test/recursive.xml new file mode 100644 index 0000000..cd2ab15 --- /dev/null +++ b/test/recursive.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<hangul-keyboard id="recursive" type="jamo"> + + <name>Recursive</name> + + <map id="0"> + <item key="0x20" value="0x0020"/> + </map> + + <include file="recursive.xml"/> + +</hangul-keyboard> diff --git a/test/test.c b/test/test.c index 3147ee5..579b5e1 100644 --- a/test/test.c +++ b/test/test.c @@ -543,6 +543,12 @@ START_TEST(test_hangul_keyboard) fail_unless(name != NULL, "error: keyboard id == NULL"); } + + HangulKeyboard* keyboard; + fail_unless( + (keyboard = hangul_keyboard_new_from_file(TEST_SOURCE_DIR "/recursive.xml")) != NULL + ); + hangul_keyboard_delete(keyboard); } END_TEST |