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