From a2d04f72d33de6b0e92900d38ebedeeecb3fc336 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 18 Jan 2013 10:33:03 +0100 Subject: [PATCH] Add unit test for ICU rule join --- test/test_icu.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/test/test_icu.c b/test/test_icu.c index 1af0c5a..391e66e 100644 --- a/test/test_icu.c +++ b/test/test_icu.c @@ -846,6 +846,51 @@ static void check_icu_iter3(void) icu_chain_destroy(chain); } + +static void check_icu_iter4(void) +{ + UErrorCode status = U_ZERO_ERROR; + struct icu_chain * chain = 0; + xmlNode *xml_node; + + const char * xml_str = "" + "" + "" + "" + "" + "" + "" + "" + ""; + + xmlDoc *doc = xmlParseMemory(xml_str, strlen(xml_str)); + YAZ_CHECK(doc); + if (!doc) + return; + xml_node = xmlDocGetRootElement(doc); + YAZ_CHECK(xml_node); + if (!xml_node) + return ; + + chain = icu_chain_xml_config(xml_node, 1, &status); + + xmlFreeDoc(doc); + YAZ_CHECK(chain); + if (!chain) + return; + + YAZ_CHECK(test_iter(chain, "Adobe Acrobat Reader, 1991-1999.", + "[adobeacrobatreader19911999]")); + + YAZ_CHECK(test_iter(chain, "Νόταρης, Γιάννης Σωτ", + "[νόταρηςγιάννηςσωτ]")); + + // check_iter_threads(chain); + + icu_chain_destroy(chain); +} + + #endif /* YAZ_HAVE_ICU */ int main(int argc, char **argv) @@ -865,6 +910,7 @@ int main(int argc, char **argv) check_icu_iter1(); check_icu_iter2(); check_icu_iter3(); + check_icu_iter4(); check_bug_1140(); -- 1.7.10.4