1 /* This file is part of the Zebra server.
2 Copyright (C) 1995-2008 Index Data
4 Zebra 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
9 Zebra 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
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
20 /* Creates a few result sets */
24 const char *myrec[] ={
26 " <title>My title</title>\n"
30 static void tst(int argc, char **argv)
32 ZebraService zs = tl_start_up("zebra10.cfg", argc, argv);
33 ZebraHandle zh = zebra_open(zs, 0);
35 YAZ_CHECK(tl_init_data(zh, myrec));
39 // string attributes in search
40 YAZ_CHECK(tl_query(zh, "@attr 1=title my", 1));
41 YAZ_CHECK(tl_query(zh, "@attr 1=title my", 1));
42 YAZ_CHECK(tl_query(zh, "@attr 1=title titlex", 0));
43 YAZ_CHECK(tl_query(zh, "@attr 1=extra_title my", 1));
45 // numeric attributes with Bib-1 should produce an error
46 YAZ_CHECK(tl_query_x(zh,
47 "@attr 1=4 my", 0, 121));
48 YAZ_CHECK(tl_query_x(zh,
49 "@attr 1=7 my", 0, 121));
50 // private OID with incorrect use attribute
51 YAZ_CHECK(tl_query_x(zh,
52 "@attr 1.2.840.10003.3.1000.1000.1 1=4 my", 0, 114));
53 // private OID with OK use attribute
54 YAZ_CHECK(tl_query(zh,
55 "@attr 1.2.840.10003.3.1000.1000.1 1=7 my", 1));
57 YAZ_CHECK(tl_query(zh,
58 "@attr 1.2.840.10003.3.1000.1000.1 1=8 my", 1));
60 YAZ_CHECK(tl_close_down(zh, zs));
68 * indent-tabs-mode: nil
70 * vim: shiftwidth=4 tabstop=8 expandtab