projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 4.2.58
[yaz-moved-to-github.git]
/
client
/
bertorture.c
diff --git
a/client/bertorture.c
b/client/bertorture.c
index
d2a4b2f
..
edc24bb
100644
(file)
--- a/
client/bertorture.c
+++ b/
client/bertorture.c
@@
-1,9
+1,10
@@
-/*
- * Copyright (C) 1995-2005, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
* See the file LICENSE for details.
- *
- * $Id: bertorture.c,v 1.4 2005-06-25 15:46:01 adam Exp $
*/
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <signal.h>
#if HAVE_SYS_TYPES_H
#include <signal.h>
#if HAVE_SYS_TYPES_H
@@
-28,6
+29,7
@@
static int stop = 0;
static int stop = 0;
+/*
static int send_packet(const char *host)
{
char buf[PACKET_SIZE];
static int send_packet(const char *host)
{
char buf[PACKET_SIZE];
@@
-53,7
+55,9
@@
static int send_packet(const char *host)
cs_close(cs);
return 0;
}
cs_close(cs);
return 0;
}
+*/
+/*
static void test_file(const char *fname)
{
Z_GDU *req;
static void test_file(const char *fname)
{
Z_GDU *req;
@@
-63,7
+67,7
@@
static void test_file(const char *fname)
int fd =open(fname, O_RDONLY, 0666);
if (fd == -1)
{
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))
exit (1);
}
while (off < sizeof(buf))
@@
-71,7
+75,7
@@
static void test_file(const char *fname)
ssize_t rd;
rd = read(fd, buf+off, sizeof(buf)-off);
if (rd == -1) {
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)
exit (1);
}
if (rd == 0)
@@
-80,7
+84,7
@@
static void test_file(const char *fname)
}
if (close(fd) == -1)
{
}
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);
exit (1);
}
odr_setbuf(odr, buf, off, 0);
@@
-88,6
+92,7
@@
static void test_file(const char *fname)
odr_destroy(odr);
}
odr_destroy(odr);
}
+*/
static void test_random(int run, const char *fname, const char *fname2,
int *estat)
static void test_random(int run, const char *fname, const char *fname2,
int *estat)
@@
-113,7
+118,6
@@
static void test_random(int run, const char *fname, const char *fname2,
char *mbuf;
ODR odr;
char *mbuf;
ODR odr;
- nmem_init();
odr = odr_createmem(ODR_DECODE);
if (fname)
{
odr = odr_createmem(ODR_DECODE);
if (fname)
{
@@
-121,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)
{
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)
exit (1);
}
while (sizeof(buf)-j-off > 0)
@@
-129,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) {
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)
{
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);
}
}
exit (1);
}
}
@@
-156,7
+160,6
@@
static void test_random(int run, const char *fname, const char *fname2,
free(mbuf);
odr_reset(odr);
odr_destroy(odr);
free(mbuf);
odr_reset(odr);
odr_destroy(odr);
- nmem_exit();
}
if (dumpfile && dumpfile != stdout)
fclose(dumpfile);
}
if (dumpfile && dumpfile != stdout)
fclose(dumpfile);
@@
-224,6
+227,7
@@
int main(int argc, char **argv)
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab