X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fapi%2Ftestlib.c;h=755d7bc27246dc842029013bf0cf5fe23883a0a5;hb=d94e1b43a4a350167e0949c38907dd8c35aa408c;hp=5735254660ff6260580aecd743b07834bb5e4581;hpb=9aacfd0955fc70f27165254a2844618c85e8600d;p=idzebra-moved-to-github.git diff --git a/test/api/testlib.c b/test/api/testlib.c index 5735254..755d7bc 100644 --- a/test/api/testlib.c +++ b/test/api/testlib.c @@ -1,4 +1,4 @@ -/* $Id: testlib.c,v 1.38 2006-09-08 09:56:40 adam Exp $ +/* $Id: testlib.c,v 1.40 2006-11-10 12:57:49 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -89,7 +89,7 @@ ZebraService tl_start_up(char *cfgname, int argc, char **argv) /** * get_srcdir: return env srcdir or . (if does does not exist) */ -const char *tl_get_srcdir() +const char *tl_get_srcdir(void) { const char *srcdir = getenv("srcdir"); if (!srcdir || ! *srcdir) @@ -148,7 +148,14 @@ int tl_init_data(ZebraHandle zh, const char **recs) if (zebra_begin_trans (zh, 1) != ZEBRA_OK) return 0; for (i = 0; recs[i]; i++) - zebra_add_record(zh, recs[i], strlen(recs[i])); + { + if (zebra_add_record(zh, recs[i], strlen(recs[i])) != ZEBRA_OK) + { + if (zebra_end_trans(zh) != ZEBRA_OK) + return 0; + return 0; + } + } if (zebra_end_trans(zh) != ZEBRA_OK) return 0; zebra_commit(zh);