From c266dcc8a54593cc8d511074cce43a35729a9e1f Mon Sep 17 00:00:00 2001 From: Marc Cromme Date: Thu, 16 Nov 2006 20:44:28 +0000 Subject: [PATCH] added tests for zebra::data, zebra::meta::sysno and zebra::index::title:p element sets. Last one segfaults and need further debugging, it is commented out. --- test/api/t16.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/test/api/t16.c b/test/api/t16.c index cf8dd17..563b267 100644 --- a/test/api/t16.c +++ b/test/api/t16.c @@ -1,4 +1,4 @@ -/* $Id: t16.c,v 1.1 2006-11-16 12:48:28 adam Exp $ +/* $Id: t16.c,v 1.2 2006-11-16 20:44:28 marc Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -85,6 +85,13 @@ static void tst(int argc, char **argv) { zint hits; ZEBRA_RES res; + const char * zebra_xml_sysno + = "\n"; + + const char * zebra_xml_index_title_p + = "\n" +" my title\n" +"\n"; ZebraService zs = tl_start_up(0, argc, argv); ZebraHandle zh = zebra_open(zs, 0); @@ -96,11 +103,24 @@ static void tst(int argc, char **argv) YAZ_CHECK_EQ(hits, 1); YAZ_CHECK_EQ(fetch_first_compare(zh, "zebra::data", VAL_TEXT_XML, + "mismatch"), ZEBRA_FAIL); + + YAZ_CHECK_EQ(fetch_first_compare(zh, "zebra::data", VAL_SUTRS, myrec[0]), ZEBRA_OK); YAZ_CHECK_EQ(fetch_first_compare(zh, "zebra::data", VAL_TEXT_XML, - "mismatch"), ZEBRA_FAIL); + myrec[0]), ZEBRA_OK); + + YAZ_CHECK_EQ(fetch_first_compare(zh, "zebra::meta::sysno", VAL_SUTRS, + "2"), ZEBRA_OK); + + YAZ_CHECK_EQ(fetch_first_compare(zh, "zebra::meta::sysno", VAL_TEXT_XML, + zebra_xml_sysno), ZEBRA_OK); + /* YAZ_CHECK_EQ(fetch_first_compare(zh, "zebra::data::index:title:p", + VAL_TEXT_XML, + zebra_xml_index_title_p), ZEBRA_OK); + */ YAZ_CHECK(tl_close_down(zh, zs)); } -- 1.7.10.4