-/* $Id: tstisamb.c,v 1.10 2004-09-09 10:08:06 heikki Exp $
+/* $Id: tstisamb.c,v 1.12 2004-12-08 14:02:37 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
#include <string.h>
#include <yaz/xmalloc.h>
-#include <yaz/log.h>
-#include <isamb.h>
+#include <yaz/ylog.h>
+#include <idzebra/isamb.h>
#include <assert.h>
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);
+ yaz_log(YLOG_DEBUG, "%s %d", txt, x);
}
static void log_pr(const char *txt)
{
- yaz_log(LOG_DEBUG, "%s", txt);
+ yaz_log(YLOG_DEBUG, "%s", txt);
}
int compare_item(const void *a, const void *b)
isamb_pp_forward(pp, &x, &xu);
if (x != xu && xu != x+1)
{
- yaz_log(LOG_WARN, "isamb_pp_forward (1). Got %d (expected %d)",
+ yaz_log(YLOG_WARN, "isamb_pp_forward (1). Got %d (expected %d)",
x, xu);
exit(4);
}
isamb_pp_forward(pp, &x, &xu);
if (x != xu && xu != x+1)
{
- yaz_log(LOG_WARN, "isamb_pp_forward (2). Got %d (expected %d)",
+ yaz_log(YLOG_WARN, "isamb_pp_forward (2). Got %d (expected %d)",
x, xu);
exit(4);
}
memcpy (&x, key_buf, sizeof(int));
if (x != ri.no)
{
- yaz_log(LOG_WARN, "isamb_pp_read. Got %d (expected %d)",
+ yaz_log(YLOG_WARN, "isamb_pp_read. Got %d (expected %d)",
x, ri.no);
exit(3);
}
}
if (ri.no != ri.max)
{
- yaz_log(LOG_WARN, "ri.max != ri.max (%d != %d)", ri.no, ri.max);
+ yaz_log(YLOG_WARN, "ri.max != ri.max (%d != %d)", ri.no, ri.max);
exit(3);
}
isamb_pp_close(pp);
if (isamc_p)
{
- yaz_log(LOG_WARN, "isamb_merge did not return empty list");
+ yaz_log(YLOG_WARN, "isamb_merge did not return empty list");
exit(3);
}
}
ISAMC_M method;
if (argc == 2)
- yaz_log_init_level(LOG_ALL);
+ yaz_log_init_level(YLOG_ALL);
/* setup method (attributes) */
method.compare_item = compare_item;
bfs = bfs_create(0, 0);
if (!bfs)
{
- yaz_log(LOG_WARN, "bfs_create failed");
+ yaz_log(YLOG_WARN, "bfs_create failed");
exit(1);
}
isb = isamb_open (bfs, "isamb", 1, &method, 0);
if (!isb)
{
- yaz_log(LOG_WARN, "isamb_open failed");
+ yaz_log(YLOG_WARN, "isamb_open failed");
exit(2);
}
tst_insert(isb, 1);