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