1 /* $Id: t10.c,v 1.14 2007-01-15 15:10:20 adam Exp $
2 Copyright (C) 1995-2007
5 This file is part of the Zebra server.
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 /* Creates a few result sets */
27 const char *myrec[] ={
29 " <title>My title</title>\n"
33 static void tst(int argc, char **argv)
35 ZebraService zs = tl_start_up("zebra10.cfg", argc, argv);
36 ZebraHandle zh = zebra_open(zs, 0);
38 YAZ_CHECK(tl_init_data(zh, myrec));
42 // string attributes in search
43 YAZ_CHECK(tl_query(zh, "@attr 1=title my", 1));
44 YAZ_CHECK(tl_query(zh, "@attr 1=title my", 1));
45 YAZ_CHECK(tl_query(zh, "@attr 1=title titlex", 0));
46 YAZ_CHECK(tl_query(zh, "@attr 1=extra_title my", 1));
48 // numeric attributes with Bib-1 should produce an error
49 YAZ_CHECK(tl_query_x(zh,
50 "@attr 1=4 my", 0, 121));
51 YAZ_CHECK(tl_query_x(zh,
52 "@attr 1=7 my", 0, 121));
53 // private OID with incorrect use attribute
54 YAZ_CHECK(tl_query_x(zh,
55 "@attr 1.2.840.10003.3.1000.1000.1 1=4 my", 0, 114));
56 // private OID with OK use attribute
57 YAZ_CHECK(tl_query(zh,
58 "@attr 1.2.840.10003.3.1000.1000.1 1=7 my", 1));
60 YAZ_CHECK(tl_query(zh,
61 "@attr 1.2.840.10003.3.1000.1000.1 1=8 my", 1));
63 YAZ_CHECK(tl_close_down(zh, zs));
71 * indent-tabs-mode: nil
73 * vim: shiftwidth=4 tabstop=8 expandtab