From: Adam Dickmeiss Date: Fri, 18 Jan 2013 09:33:03 +0000 (+0100) Subject: Add unit test for ICU rule join X-Git-Tag: v4.2.49~7 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=a2d04f72d33de6b0e92900d38ebedeeecb3fc336;p=yaz-moved-to-github.git Add unit test for ICU rule join --- 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();