1 /* This file is part of the Zebra server.
2 Copyright (C) 1994-2011 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
24 #include <libxml/xmlversion.h>
27 static void tst(int argc, char **argv)
30 char profile_path[256];
31 char record_buf[20000];
35 ZebraService zs = tl_start_up(0, argc, argv);
36 ZebraHandle zh = zebra_open(zs, 0);
38 tl_check_filter(zs, "alvis");
40 YAZ_CHECK_EQ(zebra_select_database(zh, "Default"), ZEBRA_OK);
44 sprintf(profile_path, "%s:%s/../../tab",
45 tl_get_srcdir(), tl_get_srcdir());
46 zebra_set_resource(zh, "profilePath", profile_path);
48 zebra_set_resource(zh, "recordType", "alvis.marcschema-one.xml");
50 sprintf(path, "%.200s/marc-missing-ns.xml", tl_get_srcdir());
51 f = fopen(path, "rb");
55 r = fread(record_buf, 1, sizeof(record_buf)-1, f);
62 /* disable this test for now: bug #730 */
63 /* http://xmlsoft.org/html/libxml-parser.html#xmlReadIO */
65 /* On Mac OSX using Libxml 2.6.16, we xmlTextReaderExpand does
66 not return 0 ptr even though the record has an error in it */
67 #if LIBXML_VERSION >= 20617
68 YAZ_CHECK_EQ(zebra_add_record(zh, record_buf, strlen(record_buf)),
71 zebra_add_record(zh, record_buf, strlen(record_buf));
76 YAZ_CHECK(tl_close_down(zh, zs));
84 * c-file-style: "Stroustrup"
85 * indent-tabs-mode: nil
87 * vim: shiftwidth=4 tabstop=8 expandtab