X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fapi%2Ft11.c;h=5ef5298f4f90ab4ebab734ac4a33ab4f937a0cbd;hb=a12477a52f995b809b00ac9e7b73a9b98cfbc540;hp=d0cc7c91957057947d99f198a3858385dc3a5aec;hpb=0ee1415968148352b07c112d0a4eb1deb4aa2322;p=idzebra-moved-to-github.git diff --git a/test/api/t11.c b/test/api/t11.c index d0cc7c9..5ef5298 100644 --- a/test/api/t11.c +++ b/test/api/t11.c @@ -1,5 +1,5 @@ -/* $Id: t11.c,v 1.7 2006-08-31 08:36:53 adam Exp $ - Copyright (C) 1995-2006 +/* $Id: t11.c,v 1.11 2007-05-09 07:07:18 adam Exp $ + Copyright (C) 1995-2007 Index Data ApS This file is part of the Zebra server. @@ -39,111 +39,126 @@ static void tst(int argc, char **argv) YAZ_CHECK(tl_init_data(zh, myrec)); /* - int tl_scan(ZebraHandle zh, const char *query, + int tl_scan + ( + ZebraHandle zh, const char *query, int pos, int num, int exp_pos, int exp_num, int exp_partial, - const char **exp_entries) + const char **exp_entries + ) */ - if (1) + { /* bad string use attrite, bug #647 */ - const char *ent[] = { "a", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=bad 0", 1, 1, 1, 1, 0, 0)); } - if (1) + { /* bad numeric use attributes, bug #647 */ - const char *ent[] = { "a", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=1234 0", 1, 1, 1, 1, 0, 0)); } - if (1) + { /* scan before. nothing must be returned */ const char *ent[] = { "a", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 0", 1, 1, 1, 1, 0, ent)); } - if (1) + { /* scan after. nothing must be returned */ const char *ent[] = { 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 m", 1, 1, 1, 0, 1, ent)); } - if (1) + { const char *ent[] = { "a", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", 1, 1, 1, 1, 0, ent)); } - if (1) + { const char *ent[] = { "b", "c", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 aa", 1, 2, 1, 2, 0, ent)); } - if (1) + { const char *ent[] = { "b", "c", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 aa", 1, 2, 1, 2, 0, ent)); } - if (1) + { const char *ent[] = { "e", "f", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 e", 1, 3, 1, 2, 1, ent)); } - if (1) + { const char *ent[] = { "c", "d", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", -1, 2, -1, 2, 0, ent)); } - if (1) + { const char *ent[] = { "d", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", -2, 1, -2, 1, 0, ent)); } - if (1) + { const char *ent[] = { "f", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", -4, 1, -4, 1, 0, ent)); } - if (1) + { const char *ent[] = { "f", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", -5, 1, -5, 0, 1, ent)); } - if (1) + { const char *ent[] = { "d", "e", "f", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", -2, 3, -2, 3, 0, ent)); } - if (1) + { const char *ent[] = { "d", "e", "f", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", -2, 4, -2, 3, 1, ent)); } - if (1) + { const char *ent[] = { "a", "b", "c", "d", "e", "f", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 0", 2, 100, 1, 6, 1, ent)); } - if (1) + { const char *ent[] = { "b", "c", "d", "e", "f", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 0", 0, 100, 0, 5, 1, ent)); } - if (1) + { const char *ent[] = { "a", "b", "c", "d", "e", "f", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 0", 10, 100, 1, 6, 1, ent)); } - if (1) + { const char *ent[] = { "a", "b", "c", "d", "e", "f", 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 0", 22, 10, 1, 0, 1, ent)); } - if (1) + { const char *ent[] = { 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 z", -22, 10, -22, 0, 1, ent)); } + + { + const char *ent[] = { "c", "d", 0 }; + + YAZ_CHECK(tl_query(zh, "@attr 1=4 c", 1)); + + /* must fail, because x is not a result set */ + YAZ_CHECK(tl_scan(zh, "@attr 8=x @attr 1=4 a", 1, 3, 0, 0, 0, 0)); + + /* bug 1114 */ + YAZ_CHECK(tl_scan(zh, "@attr 8=rsetname @attr 1=4 0", + 1, 20, 1, 2, 1, ent)); + + } YAZ_CHECK(tl_close_down(zh, zs)); }