summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorasomers <asomers@FreeBSD.org>2017-05-30 15:33:27 +0000
committerasomers <asomers@FreeBSD.org>2017-05-30 15:33:27 +0000
commitea97006e7c47f392eabb2e83ba83f2fe612b48c0 (patch)
tree811f3e73d0f9cc61e5379073f8f7fbd5804f9d25 /tests
parentde397ab94c0ae9b023ad4c6e02e762c52aaa9dc0 (diff)
downloadFreeBSD-src-ea97006e7c47f392eabb2e83ba83f2fe612b48c0.zip
FreeBSD-src-ea97006e7c47f392eabb2e83ba83f2fe612b48c0.tar.gz
MFC r318593:
Fix build of AIO tests with -DDEBUG Also, redefine some constants for clarity. No functional change.
Diffstat (limited to 'tests')
-rw-r--r--tests/sys/aio/aio_kqueue_test.c5
-rw-r--r--tests/sys/aio/lio_kqueue_test.c18
2 files changed, 13 insertions, 10 deletions
diff --git a/tests/sys/aio/aio_kqueue_test.c b/tests/sys/aio/aio_kqueue_test.c
index 08d57f8..1e98d78 100644
--- a/tests/sys/aio/aio_kqueue_test.c
+++ b/tests/sys/aio/aio_kqueue_test.c
@@ -163,7 +163,8 @@ main (int argc, char *argv[])
printf("kevent %d %d errno %d return.ident %p "
"return.data %p return.udata %p %p\n",
i, result, error,
- kq_returned.ident, kq_returned.data,
+ (void*)kq_returned.ident,
+ (void*)kq_returned.data,
kq_returned.udata,
kq_iocb);
#endif
@@ -171,7 +172,7 @@ main (int argc, char *argv[])
if (kq_iocb)
break;
#ifdef DEBUG
- printf("Try again left %d out of %d %d\n",
+ printf("Try again left %d out of %lu %d\n",
pending, nitems(iocb), cancel);
#endif
}
diff --git a/tests/sys/aio/lio_kqueue_test.c b/tests/sys/aio/lio_kqueue_test.c
index 5178a1d..fdbe72a 100644
--- a/tests/sys/aio/lio_kqueue_test.c
+++ b/tests/sys/aio/lio_kqueue_test.c
@@ -55,7 +55,8 @@
#define PATH_TEMPLATE "aio.XXXXXXXXXX"
#define LIO_MAX 5
-#define MAX_IOCBS LIO_MAX * 16
+#define IOCBS_PER_LIO 16
+#define MAX_IOCBS (LIO_MAX * IOCBS_PER_LIO)
#define MAX_RUNS 300
int
@@ -103,9 +104,9 @@ main(int argc, char *argv[])
#endif
for (j = 0; j < LIO_MAX; j++) {
lio[j] =
- malloc(sizeof(struct aiocb *) * MAX_IOCBS/LIO_MAX);
- for (i = 0; i < MAX_IOCBS / LIO_MAX; i++) {
- k = (MAX_IOCBS / LIO_MAX * j) + i;
+ malloc(sizeof(struct aiocb *) * IOCBS_PER_LIO);
+ for (i = 0; i < IOCBS_PER_LIO; i++) {
+ k = (IOCBS_PER_LIO * j) + i;
lio[j][i] = iocb[k] =
calloc(1, sizeof(struct aiocb));
iocb[k]->aio_nbytes = sizeof(buffer);
@@ -115,7 +116,7 @@ main(int argc, char *argv[])
= iocb[k]->aio_nbytes * k * (run + 1);
#ifdef DEBUG
- printf("hello iocb[k] %d\n",
+ printf("hello iocb[k] %ld\n",
iocb[k]->aio_offset);
#endif
iocb[k]->aio_lio_opcode = LIO_WRITE;
@@ -125,11 +126,11 @@ main(int argc, char *argv[])
sig.sigev_notify = SIGEV_KEVENT;
time(&time1);
result = lio_listio(LIO_NOWAIT, lio[j],
- MAX_IOCBS / LIO_MAX, &sig);
+ IOCBS_PER_LIO, &sig);
error = errno;
time(&time2);
#ifdef DEBUG
- printf("Time %d %d %d result -> %d\n",
+ printf("Time %ld %ld %ld result -> %d\n",
time1, time2, time2-time1, result);
#endif
if (result != 0) {
@@ -169,7 +170,8 @@ main(int argc, char *argv[])
printf("kevent %d %d errno %d return.ident %p "
"return.data %p return.udata %p %p\n",
i, result, error,
- kq_returned.ident, kq_returned.data,
+ (void*)kq_returned.ident,
+ (void*)kq_returned.data,
kq_returned.udata,
lio[j]);
#endif
OpenPOWER on IntegriCloud