Happy new year
[yaz-moved-to-github.git] / test / tst_icu_I18N.c
index cf328ad..3c643df 100644 (file)
@@ -1,23 +1,7 @@
-/* $Id: tst_icu_I18N.c,v 1.12 2007-11-08 08:17:18 adam Exp $
-   Copyright (c) 2006-2007, Index Data.
-
-   This file is part of Pazpar2.
-
-   Pazpar2 is free software; you can redistribute it and/or modify it under
-   the terms of the GNU General Public License as published by the Free
-   Software Foundation; either version 2, or (at your option) any later
-   version.
-
-   Pazpar2 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 General Public License
-   for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with Pazpar2; see the file LICENSE.  If not, write to the
-   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
-*/
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2009 Index Data
+ * See the file LICENSE for details.
+ */
 
 /* DO NOT EDIT THIS FILE IF YOUR EDITOR DOES NOT SUPPORT UTF-8 */
  
@@ -493,10 +477,10 @@ void test_icu_I18N_chain(int argc, char **argv)
     struct icu_chain * chain = 0;
     
 
-    const char * xml_str = "<icu>"
-        "<normalize rule=\"[:Control:] Any-Remove\"/>"
+    const char * xml_str = "<icu locale=\"en\">"
+        "<transform rule=\"[:Control:] Any-Remove\"/>"
         "<tokenize rule=\"l\"/>"
-        "<normalize rule=\"[[:WhiteSpace:][:Punctuation:]] Remove\"/>"
+        "<transform rule=\"[[:WhiteSpace:][:Punctuation:]] Remove\"/>"
         "<display/>"
         "<casemap rule=\"l\"/>"
         "</icu>";
@@ -506,8 +490,7 @@ void test_icu_I18N_chain(int argc, char **argv)
     xmlNode *xml_node = xmlDocGetRootElement(doc);
     YAZ_CHECK(xml_node);
 
-
-    chain = icu_chain_xml_config(xml_node, (uint8_t *) "en", 0, &status);
+    chain = icu_chain_xml_config(xml_node, 0, &status);
 
     xmlFreeDoc(doc);
     YAZ_CHECK(chain);
@@ -547,14 +530,14 @@ void test_bug_1140(void)
     UErrorCode status = U_ZERO_ERROR;
     struct icu_chain * chain = 0;
     
-    const char * xml_str = "<icu>"
+    const char * xml_str = "<icu locale=\"en\">"
 
         /* if the first rule is normalize instead. Then it works */
 #if 0
-        "<normalize rule=\"[:Control:] Any-Remove\"/>"
+        "<transform rule=\"[:Control:] Any-Remove\"/>"
 #endif
         "<tokenize rule=\"l\"/>"
-        "<normalize rule=\"[[:WhiteSpace:][:Punctuation:]] Remove\"/>"
+        "<transform rule=\"[[:WhiteSpace:][:Punctuation:]] Remove\"/>"
         "<display/>"
         "<casemap rule=\"l\"/>"
         "</icu>";
@@ -564,7 +547,7 @@ void test_bug_1140(void)
     xmlNode *xml_node = xmlDocGetRootElement(doc);
     YAZ_CHECK(xml_node);
 
-    chain = icu_chain_xml_config(xml_node, (uint8_t *) "en", 0, &status);
+    chain = icu_chain_xml_config(xml_node, 0, &status);
 
     xmlFreeDoc(doc);
     YAZ_CHECK(chain);
@@ -608,16 +591,16 @@ void test_chain_empty_token(void)
     UErrorCode status = U_ZERO_ERROR;
     struct icu_chain * chain = 0;
 
-    const char * xml_str = "<icu>"
+    const char * xml_str = "<icu locale=\"en\">"
         "<tokenize rule=\"w\"/>"
-        "<normalize rule=\"[[:WhiteSpace:][:Punctuation:]] Remove\"/>"
+        "<transform rule=\"[[:WhiteSpace:][:Punctuation:]] Remove\"/>"
         "</icu>";
     
     xmlDoc *doc = xmlParseMemory(xml_str, strlen(xml_str));
     xmlNode *xml_node = xmlDocGetRootElement(doc);
     YAZ_CHECK(xml_node);
 
-    chain = icu_chain_xml_config(xml_node, (uint8_t *) "en", 0, &status);
+    chain = icu_chain_xml_config(xml_node, 0, &status);
 
     xmlFreeDoc(doc);
     YAZ_CHECK(chain);
@@ -644,7 +627,7 @@ void test_chain_empty_chain(void)
     UErrorCode status = U_ZERO_ERROR;
     struct icu_chain * chain = 0;
 
-    const char * xml_str = "<icu>"
+    const char * xml_str = "<icu locale=\"en\">"
         "</icu>";
     
     const char * src8 = "some 5487 weired !ยค%&(/& sTuFf";
@@ -654,7 +637,7 @@ void test_chain_empty_chain(void)
     xmlNode *xml_node = xmlDocGetRootElement(doc);
     YAZ_CHECK(xml_node);
 
-    chain = icu_chain_xml_config(xml_node, (uint8_t *) "en", 0, &status);
+    chain = icu_chain_xml_config(xml_node, 0, &status);
 
     xmlFreeDoc(doc);
     YAZ_CHECK(chain);