1 /* $Id: t14.c,v 1.3 2006-03-31 15:58:05 adam Exp $
2 Copyright (C) 2004-2005
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 Zebra; see the file LICENSE.zebra. If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
25 static void create_search_drop(ZebraHandle zh)
27 const char *rec = "<gils><title>some</title></gils>";
28 const char *opaque_id = "9";
30 YAZ_CHECK(zebra_create_database (zh, "Default") == ZEBRA_OK);
33 YAZ_CHECK(zebra_admin_exchange_record (
35 opaque_id, strlen(opaque_id),
36 1) == ZEBRA_OK); /* insert */
38 YAZ_CHECK(zebra_admin_exchange_record (
40 opaque_id, strlen(opaque_id),
41 4) == ZEBRA_OK); /* update/insert */
43 YAZ_CHECK(tl_query(zh, "@attr 1=4 some", 1));
45 zebra_drop_database(zh, "Default");
47 YAZ_CHECK(tl_query_x(zh, "@attr 1=4 some", 0, 109));
51 static void tst(int argc, char **argv)
53 ZebraService zs = tl_start_up("zebra.cfg", argc, argv);
54 ZebraHandle zh = zebra_open(zs, 0);
56 YAZ_CHECK(zebra_select_database(zh, "Default") == ZEBRA_OK);
60 create_search_drop(zh);
62 create_search_drop(zh);
64 YAZ_CHECK(tl_close_down(zh, zs));