X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fapi%2Ft6.c;h=52ae5e2c7f5886fd1201e6c54cfc2b1b17191eae;hb=8593daa76347981fac84c670ddf2880b1d4502c1;hp=28a4c476f359dc194fd3e4a5019bd305460f27cb;hpb=9b5460b01c5758f993296f3de90ea7622644ae15;p=idzebra-moved-to-github.git diff --git a/test/api/t6.c b/test/api/t6.c index 28a4c47..52ae5e2 100644 --- a/test/api/t6.c +++ b/test/api/t6.c @@ -1,5 +1,5 @@ -/* $Id: t6.c,v 1.2 2004-08-13 13:16:52 adam Exp $ - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 +/* $Id: t6.c,v 1.6 2004-12-02 11:28:20 adam Exp $ + Copyright (C) 2003,2004 Index Data Aps This file is part of the Zebra server. @@ -20,34 +20,18 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +/** t6.c Insert a number of randomly generated words */ + +#include "testlib.h" -#include -#include -#include -/* read zebra.cfg from env var srcdir if it exists; otherwise current dir */ -static ZebraService start_service() -{ - char cfg[256]; - char *srcdir = getenv("srcdir"); - sprintf(cfg, "%.200s%szebra6.cfg", srcdir ? srcdir : "", srcdir ? "/" : ""); - return zebra_start(cfg); -} - int main(int argc, char **argv) { int i; - ZebraService zs; - ZebraHandle zh; - - yaz_log_init_file("t6.log"); + ZebraService zs = start_up(0, argc, argv); + ZebraHandle zh = zebra_open(zs); - nmem_init (); - srand(17); - zs = start_service(); - zh = zebra_open(zs); zebra_select_database(zh, "Default"); zebra_init(zh); zebra_close(zh); @@ -76,12 +60,9 @@ int main(int argc, char **argv) strcat(rec_buf, ""); zebra_add_record (zh, rec_buf, strlen(rec_buf)); - zebra_end_trans (zh); + zebra_end_trans(zh); zebra_close(zh); } - zebra_stop(zs); - nmem_exit (); - xmalloc_trav ("x"); - exit (0); + return close_down(0 /*zh*/, zs, 0); }