summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-03-23 16:36:38 -0600
committerJens Axboe <axboe@kernel.dk>2022-03-23 16:36:38 -0600
commitac60e50cb537a29ab502285af08da374b358248e (patch)
tree6de680f853bf2d03072c50bc4d8c898060f51946
parentb86fdae82f033acf40ba86b4158c9ca2539cde61 (diff)
downloadliburing-ac60e50cb537a29ab502285af08da374b358248e.tar.gz
liburing-ac60e50cb537a29ab502285af08da374b358248e.tar.bz2
test/msg-recvall: fix test
We should expect just half of the requested amount for a DGRAM socket. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/recv-msgall.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/test/recv-msgall.c b/test/recv-msgall.c
index 02af1b2..d77434d 100644
--- a/test/recv-msgall.c
+++ b/test/recv-msgall.c
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: MIT */
/*
- * Test MSG_WAITALL
+ * Test MSG_WAITALL with datagram sockets, with a send splice into two.
*/
#include <errno.h>
#include <stdio.h>
@@ -92,7 +92,7 @@ static int do_recv(struct io_uring *ring)
fprintf(stderr, "failed cqe: %d\n", cqe->res);
goto err;
}
- if (cqe->res != MAX_MSG * sizeof(int)) {
+ if (cqe->res != MAX_MSG * sizeof(int) / 2) {
fprintf(stderr, "got wrong length: %d\n", cqe->res);
goto err;
}
@@ -137,18 +137,6 @@ static void *recv_fn(void *data)
}
pthread_mutex_unlock(&rd->mutex);
ret = do_recv(&ring);
- if (!ret) {
- int i;
-
- for (i = 0; i < MAX_MSG; i++) {
- if (buf[i] != i) {
- fprintf(stderr, "found %d at %d\n", buf[i], i);
- ret = 1;
- break;
- }
- }
- }
-
close(sock);
io_uring_queue_exit(&ring);
err:
@@ -266,7 +254,7 @@ int main(int argc, char *argv[])
ret = test(0);
if (ret) {
fprintf(stderr, "test recv failed\n");
- // return ret;
+ return ret;
}
ret = test(1);