X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fapi%2Ft16.c;h=bf44b5795f4c9f755e6cdb056ce7368131372dc9;hb=21f90a8618faec6bee8d125c12088b74db8eb8b9;hp=4ace1e55379e241f1ee9bd3fab26ad522bf0d9a3;hpb=bf647b34fd7224275cb2c1020925897f0d28fe01;p=idzebra-moved-to-github.git diff --git a/test/api/t16.c b/test/api/t16.c index 4ace1e5..bf44b57 100644 --- a/test/api/t16.c +++ b/test/api/t16.c @@ -1,5 +1,5 @@ -/* $Id: t16.c,v 1.3 2006-11-16 21:58:55 marc Exp $ - Copyright (C) 1995-2006 +/* $Id: t16.c,v 1.9 2007-01-15 15:10:20 adam Exp $ + Copyright (C) 1995-2007 Index Data ApS This file is part of the Zebra server. @@ -63,8 +63,8 @@ static ZEBRA_RES fetch_first(ZebraHandle zh, const char *element_set, static ZEBRA_RES fetch_first_compare(ZebraHandle zh, const char *element_set, oid_value format, const char *cmp_rec) { - const char *rec_buf; - size_t rec_len; + const char *rec_buf = 0; + size_t rec_len = 0; ODR odr = odr_createmem(ODR_ENCODE); ZEBRA_RES res = fetch_first(zh, element_set, format, odr, &rec_buf, &rec_len); @@ -86,7 +86,10 @@ static void tst(int argc, char **argv) zint hits; ZEBRA_RES res; const char * zebra_xml_sysno - = "\n"; + = "\n"; + + const char * zebra_xml_meta + = "\n"; const char * zebra_xml_index_title_p = "\n" @@ -116,11 +119,20 @@ static void tst(int argc, char **argv) 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", + + YAZ_CHECK_EQ(fetch_first_compare(zh, "zebra::meta", VAL_TEXT_XML, + zebra_xml_meta), ZEBRA_OK); + + YAZ_CHECK_EQ(fetch_first_compare(zh, "zebra::index::title:p", VAL_TEXT_XML, zebra_xml_index_title_p), ZEBRA_OK); - */ + + YAZ_CHECK_EQ(fetch_first_compare(zh, "zebra::nonexistent", + VAL_TEXT_XML, ""), ZEBRA_OK); + + YAZ_CHECK_EQ(fetch_first_compare(zh, "zebra::index::nonexistent", + VAL_TEXT_XML, ""), ZEBRA_OK); + YAZ_CHECK(tl_close_down(zh, zs)); }