checked in test for ICU uppercase lowercase, title and foldcase char mapping
[pazpar2-moved-to-github.git] / src / test_config.c
index b2ada52..f351a28 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: test_config.c,v 1.1 2007-04-19 19:42:30 marc Exp $
+/* $Id: test_config.c,v 1.3 2007-04-25 07:00:33 marc Exp $
    Copyright (c) 2006-2007, Index Data.
 
 This file is part of Pazpar2.
@@ -19,17 +19,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.
  */
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <signal.h>
-#include <ctype.h>
-#include <assert.h>
-
 #if HAVE_CONFIG_H
 #include "cconfig.h"
 #endif
@@ -41,8 +30,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <yaz/test.h>
 
-
-//#include "pazpar2.h"
 #include "config.h"
 
 
@@ -52,7 +39,7 @@ void test_conf_service(int argc, char **argv)
   NMEM         nmem = nmem_create();
 
   struct conf_service *service = 0;
-  service = conf_service_create(nmem, 4, 1);
+  service = conf_service_create(nmem, 4, 3);
 
   YAZ_CHECK(service);
 
@@ -117,7 +104,7 @@ void test_conf_service(int argc, char **argv)
   YAZ_CHECK(!conf_service_add_sortkey(nmem, service, -1, "out_of_bounds",
                                      Metadata_sortkey_string));
 
-  YAZ_CHECK(!conf_service_add_sortkey(nmem, service, 1, "out_of_bounds",
+  YAZ_CHECK(!conf_service_add_sortkey(nmem, service, 3, "out_of_bounds",
                                      Metadata_sortkey_relevance));
 
   YAZ_CHECK(!conf_service_add_sortkey(nmem, service, 0, 0, //missing name
@@ -125,9 +112,16 @@ void test_conf_service(int argc, char **argv)
 
 
   // expected sortkey sucess
-  YAZ_CHECK(conf_service_add_sortkey(nmem, service, 0, "title",
+  YAZ_CHECK(conf_service_add_sortkey(nmem, service, 0, "relevance",
                                      Metadata_sortkey_relevance));
+
+  YAZ_CHECK(conf_service_add_sortkey(nmem, service, 1, "title",
+                                     Metadata_sortkey_string));
   
+  YAZ_CHECK(conf_service_add_sortkey(nmem, service, 2, "year",
+                                     Metadata_sortkey_numeric));
+  
+