1 /* This file is part of the Zebra server.
2 Copyright (C) 1994-2009 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
22 const char *myrec[] ={
24 " <title>My title</title>\n"
25 "</private_attset>\n",
28 static void tst(int argc, char **argv)
30 ZebraService zs = tl_start_up("test_private_attset.cfg", argc, argv);
31 ZebraHandle zh = zebra_open(zs, 0);
33 YAZ_CHECK(tl_init_data(zh, myrec));
37 // string attributes in search
38 YAZ_CHECK(tl_query(zh, "@attr 1=title my", 1));
39 YAZ_CHECK(tl_query(zh, "@attr 1=title my", 1));
40 YAZ_CHECK(tl_query(zh, "@attr 1=title titlex", 0));
41 YAZ_CHECK(tl_query(zh, "@attr 1=extra_title my", 1));
43 // numeric attributes with Bib-1 should produce an error
44 YAZ_CHECK(tl_query_x(zh,
45 "@attr 1=4 my", 0, 121));
46 YAZ_CHECK(tl_query_x(zh,
47 "@attr 1=7 my", 0, 121));
48 // private OID with incorrect use attribute
49 YAZ_CHECK(tl_query_x(zh,
50 "@attr 1.2.840.10003.3.1000.1000.1 1=4 my", 0, 114));
51 // private OID with OK use attribute
52 YAZ_CHECK(tl_query(zh,
53 "@attr 1.2.840.10003.3.1000.1000.1 1=7 my", 1));
55 YAZ_CHECK(tl_query(zh,
56 "@attr 1.2.840.10003.3.1000.1000.1 1=8 my", 1));
58 YAZ_CHECK(tl_close_down(zh, zs));
66 * indent-tabs-mode: nil
68 * vim: shiftwidth=4 tabstop=8 expandtab