Renamed config.[ch] to pazpar2_config.[ch].
[pazpar2-moved-to-github.git] / src / test_reclists.c
1 /* This file is part of Pazpar2.
2    Copyright (C) 2006-2008 Index Data
3
4 Pazpar2 is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8
9 Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
18 */
19
20 #if HAVE_CONFIG_H
21 #include "cconfig.h"
22 #endif
23
24 #define USE_TIMING 0
25 #if USE_TIMING
26 #include <yaz/timing.h>
27 #endif
28
29 #include <yaz/test.h>
30
31
32 #include "pazpar2_config.h"
33 //#include "record.h"
34 #include "reclists.h"
35
36
37 #if 0
38
39 void test_reclist_sortparms(int argc, char **argv)
40 {
41   NMEM  nmem = nmem_create();
42
43   struct conf_service *service = 0; 
44   service =  conf_service_create(nmem, 1, 2);
45
46   conf_service_add_metadata(nmem, service, 0, "title",
47                             Metadata_type_generic, Metadata_merge_unique,
48                             1, 1, 1, 0);
49
50   conf_service_add_sortkey(nmem, service, 0, "relevance",
51                            Metadata_sortkey_relevance);
52   
53   conf_service_add_sortkey(nmem, service, 1, "title",
54                            Metadata_sortkey_string);
55   
56
57   // initializing of sort parameters is controlled by service descriptions
58   struct reclist_sortparms *sort_parms = 0;
59
60   // sorting ascending according to relevance, then title
61   YAZ_CHECK(0 == sort_parms);
62   YAZ_CHECK(reclist_sortparms_insert(nmem, &sort_parms, service, "title", 1));
63   YAZ_CHECK(sort_parms);
64
65   YAZ_CHECK(0 == sort_parms->next);
66   YAZ_CHECK(reclist_sortparms_insert(nmem, &sort_parms, service, 
67                                      "relevance", 1));
68   YAZ_CHECK(sort_parms->next);
69
70
71   nmem_destroy(nmem);
72
73   //YAZ_CHECK(0 == 0);
74   //YAZ_CHECK_EQ(0, 1);
75 }
76
77
78 #endif 
79
80 int main(int argc, char **argv)
81 {
82     YAZ_CHECK_INIT(argc, argv); 
83     YAZ_CHECK_LOG(); 
84
85
86     //test_reclist_sortparms(argc, argv); 
87
88     
89     YAZ_CHECK_TERM;
90 }
91
92
93
94
95 /*
96  * Local variables:
97  * c-basic-offset: 4
98  * indent-tabs-mode: nil
99  * End:
100  * vim: shiftwidth=4 tabstop=8 expandtab
101  */