1 /* $Id: tstres.c,v 1.2 2007-05-16 12:31:17 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 #include <idzebra/res.h>
26 static void tst_res_open(void)
38 static void tst_res_read_file(void)
40 Res res = res_open(0, 0);
45 int r = res_read_file(res, "notfound");
46 YAZ_CHECK_EQ(r, ZEBRA_FAIL);
51 int r = res_read_file(res, "tstres.cfg");
52 YAZ_CHECK_EQ(r, ZEBRA_OK);
54 v = res_get_def(res, "register", "none");
55 YAZ_CHECK(!strcmp(v, "a:b"));
57 v = res_get_def(res, "name", "none");
58 YAZ_CHECK(!strcmp(v, "c d"));
60 v = res_get_def(res, "here", "none");
61 YAZ_CHECK(!strcmp(v, "_"));
63 v = res_get_def(res, "namex", "none");
64 YAZ_CHECK(!strcmp(v, "none"));
69 int main (int argc, char **argv)
71 YAZ_CHECK_INIT(argc, argv);
80 * indent-tabs-mode: nil
82 * vim: shiftwidth=4 tabstop=8 expandtab