X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=client%2Fbertorture.c;h=edc24bbbeabe02209a00612f27318b982b8c8cbb;hp=0ec3b7e9f3e35c0bf674563fb03d88b1305328d7;hb=df7a36a7eadf9d8b797a1199fe5229d94e58fe1f;hpb=379504a233e3e2cc85bca1e7b6d864f1395aec7c diff --git a/client/bertorture.c b/client/bertorture.c index 0ec3b7e..edc24bb 100644 --- a/client/bertorture.c +++ b/client/bertorture.c @@ -1,7 +1,10 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2009 Index Data + * Copyright (C) 1995-2013 Index Data * See the file LICENSE for details. */ +#if HAVE_CONFIG_H +#include +#endif #include #if HAVE_SYS_TYPES_H @@ -26,6 +29,7 @@ static int stop = 0; +/* static int send_packet(const char *host) { char buf[PACKET_SIZE]; @@ -51,7 +55,9 @@ static int send_packet(const char *host) cs_close(cs); return 0; } +*/ +/* static void test_file(const char *fname) { Z_GDU *req; @@ -61,7 +67,7 @@ static void test_file(const char *fname) int fd =open(fname, O_RDONLY, 0666); if (fd == -1) { - yaz_log(LOG_ERRNO|LOG_FATAL, "open %s", fname); + yaz_log(YLOG_ERRNO|YLOG_FATAL, "open %s", fname); exit (1); } while (off < sizeof(buf)) @@ -69,7 +75,7 @@ static void test_file(const char *fname) ssize_t rd; rd = read(fd, buf+off, sizeof(buf)-off); if (rd == -1) { - yaz_log(LOG_ERRNO|LOG_FATAL, "read %s", fname); + yaz_log(YLOG_ERRNO|YLOG_FATAL, "read %s", fname); exit (1); } if (rd == 0) @@ -78,7 +84,7 @@ static void test_file(const char *fname) } if (close(fd) == -1) { - yaz_log(LOG_ERRNO|LOG_FATAL, "close %s", fname); + yaz_log(YLOG_ERRNO|YLOG_FATAL, "close %s", fname); exit (1); } odr_setbuf(odr, buf, off, 0); @@ -86,6 +92,7 @@ static void test_file(const char *fname) odr_destroy(odr); } +*/ static void test_random(int run, const char *fname, const char *fname2, int *estat) @@ -111,7 +118,6 @@ static void test_random(int run, const char *fname, const char *fname2, char *mbuf; ODR odr; - nmem_init(); odr = odr_createmem(ODR_DECODE); if (fname) { @@ -119,7 +125,7 @@ static void test_random(int run, const char *fname, const char *fname2, int fd =open(fname, O_TRUNC|O_CREAT|O_WRONLY, 0666); if (fd == -1) { - yaz_log(LOG_ERRNO|LOG_FATAL, "open %s", fname); + yaz_log(YLOG_ERRNO|YLOG_FATAL, "open %s", fname); exit (1); } while (sizeof(buf)-j-off > 0) @@ -127,14 +133,14 @@ static void test_random(int run, const char *fname, const char *fname2, ssize_t wrote; wrote = write(fd, buf+off+j, sizeof(buf)-j-off); if (wrote <= 0) { - yaz_log(LOG_ERRNO|LOG_FATAL, "write %s", fname); + yaz_log(YLOG_ERRNO|YLOG_FATAL, "write %s", fname); exit (1); } off += wrote; } if (close(fd) == -1) { - yaz_log(LOG_ERRNO|LOG_FATAL, "close %s", fname); + yaz_log(YLOG_ERRNO|YLOG_FATAL, "close %s", fname); exit (1); } } @@ -154,7 +160,6 @@ static void test_random(int run, const char *fname, const char *fname2, free(mbuf); odr_reset(odr); odr_destroy(odr); - nmem_exit(); } if (dumpfile && dumpfile != stdout) fclose(dumpfile);