X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=isamb%2Ftstisamb.c;h=253bc1ff54cba8b6bba915867371f588a5f46ce0;hb=70ba74c9bbf739fbe82d1bc2b0fb64a547c0c9e0;hp=872ef0a1e1ae62bf8a300e2bc796c2d1e128d1b6;hpb=892728fe00debf2b9176e0bc7517a73113f6660b;p=idzebra-moved-to-github.git diff --git a/isamb/tstisamb.c b/isamb/tstisamb.c index 872ef0a..253bc1f 100644 --- a/isamb/tstisamb.c +++ b/isamb/tstisamb.c @@ -1,4 +1,4 @@ -/* $Id: tstisamb.c,v 1.4 2004-06-02 07:51:52 adam Exp $ +/* $Id: tstisamb.c,v 1.7 2004-08-03 14:54:41 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -26,6 +26,18 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include +static void log_item(int level, const void *b, const char *txt) +{ + int x; + memcpy(&x, b, sizeof(int)); + yaz_log(LOG_DEBUG, "%s %d", txt, x); +} + +static void log_pr(const char *txt) +{ + yaz_log(LOG_DEBUG, "%s", txt); +} + int compare_item(const void *a, const void *b) { int ia, ib; @@ -84,7 +96,6 @@ void tst_forward(ISAMB isb, int n) struct read_info ri; int i; ISAMB_PP pp; - char key_buf[10]; /* insert a number of entries */ ri.no = 0; @@ -98,12 +109,12 @@ void tst_forward(ISAMB isb, int n) /* read the entries */ pp = isamb_pp_open (isb, isamc_p); - for (i = 0; i xuntil) + int xu = i; + isamb_pp_forward(pp, &x, &xu); + if (x != xu && xu != x+1) { yaz_log(LOG_WARN, "isamb_pp_forward (2). Got %d (expected %d)", - x, xuntil); + x, xu); exit(4); } ri.no++; @@ -172,13 +183,10 @@ void tst_insert(ISAMB isb, int n) } isamb_pp_close(pp); + isamb_dump(isb, isamc_p, log_pr); isamb_unlink(isb, isamc_p); } -static void log_item(int level, const void *b, const char *txt) -{ -} - int main(int argc, char **argv) { BFiles bfs;