1 /* $Id: tstres.c,v 1.3 2007-08-31 21:12:51 mike 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
24 #include <idzebra/res.h>
27 static void tst_res_open(void)
39 static void tst_res_read_file(void)
41 Res res = res_open(0, 0);
46 int r = res_read_file(res, "notfound");
47 YAZ_CHECK_EQ(r, ZEBRA_FAIL);
52 int r = res_read_file(res, "tstres.cfg");
53 YAZ_CHECK_EQ(r, ZEBRA_OK);
55 v = res_get_def(res, "register", "none");
56 YAZ_CHECK(!strcmp(v, "a:b"));
58 v = res_get_def(res, "name", "none");
59 YAZ_CHECK(!strcmp(v, "c d"));
61 v = res_get_def(res, "here", "none");
62 YAZ_CHECK(!strcmp(v, "_"));
64 v = res_get_def(res, "namex", "none");
65 YAZ_CHECK(!strcmp(v, "none"));
70 int main (int argc, char **argv)
72 YAZ_CHECK_INIT(argc, argv);
81 * indent-tabs-mode: nil
83 * vim: shiftwidth=4 tabstop=8 expandtab