X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=test%2Fapi%2Ftest_scan.c;h=d1e3f8c35c5c3fce0498f1f0581b004ab1db18d3;hp=f6038dc31011096b134a42166d5bf2fe44691f33;hb=049a7363a54b6e467e8f0d2202b01848fe98dc70;hpb=965cbd297cf8de73cfe01d55983b8161ae7cf67e diff --git a/test/api/test_scan.c b/test/api/test_scan.c index f6038dc..d1e3f8c 100644 --- a/test/api/test_scan.c +++ b/test/api/test_scan.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1995-2008 Index Data + Copyright (C) 1994-2011 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -18,6 +18,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** testing of scan */ +#if HAVE_CONFIG_H +#include +#endif #include "testlib.h" const char *myrec[] = { @@ -133,12 +136,33 @@ static void tst(int argc, char **argv) YAZ_CHECK(tl_scan(zh, "@attr 1=4 0", 10, 100, 1, 6, 1, ent)); } + { - const char *ent[] = { "a", "b", "c", "d", "e", "f", 0 }; + const char *ent[] = { 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 0", 22, 10, 1, 0, 1, ent)); } { + const char *ent[] = { "a", "b", "c", "d", 0 }; + YAZ_CHECK(tl_scan(zh, "@attr 1=4 f", 6, 4, 6, 4, 0, ent)); + } + + { + const char *ent[] = { "a", "b", "c", "d", "e", 0 }; + YAZ_CHECK(tl_scan(zh, "@attr 1=4 f", 6, 5, 6, 5, 0, ent)); + } + + { + const char *ent[] = { "a", "b", 0 }; + YAZ_CHECK(tl_scan(zh, "@attr 1=4 c", 6, 5, 3, 2, 1, ent)); + } + + { + const char *ent[] = { "c", "d", "e", "f", 0 }; + YAZ_CHECK(tl_scan(zh, "@attr 1=4 c", 1, 6, 1, 4, 1, ent)); + } + + { const char *ent[] = { 0 }; YAZ_CHECK(tl_scan(zh, "@attr 1=4 z", -22, 10, -22, 0, 1, ent)); } @@ -164,6 +188,7 @@ TL_MAIN /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab