1 /* $Id: test_reclists.c,v 1.2 2007-05-11 08:41:07 marc Exp $
2 Copyright (c) 2006-2007, Index Data.
4 This file is part of Pazpar2.
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
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
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
28 #include <yaz/timing.h>
41 void test_reclist_sortparms(int argc, char **argv)
43 NMEM nmem = nmem_create();
45 struct conf_service *service = 0;
46 service = conf_service_create(nmem, 1, 2);
48 conf_service_add_metadata(nmem, service, 0, "title",
49 Metadata_type_generic, Metadata_merge_unique,
52 conf_service_add_sortkey(nmem, service, 0, "relevance",
53 Metadata_sortkey_relevance);
55 conf_service_add_sortkey(nmem, service, 1, "title",
56 Metadata_sortkey_string);
59 // initializing of sort parameters is controlled by service descriptions
60 struct reclist_sortparms *sort_parms = 0;
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);
67 YAZ_CHECK(0 == sort_parms->next);
68 YAZ_CHECK(reclist_sortparms_insert(nmem, &sort_parms, service,
70 YAZ_CHECK(sort_parms->next);
82 int main(int argc, char **argv)
84 YAZ_CHECK_INIT(argc, argv);
88 //test_reclist_sortparms(argc, argv);
100 * indent-tabs-mode: nil
102 * vim: shiftwidth=4 tabstop=8 expandtab