diff mbox series

[liburing,1/6] test/zc: improve error messages

Message ID 094a2939de904ea81e65277e10662a1db6e2a068.1659622771.git.asml.silence@gmail.com (mailing list archive)
State New
Headers show
Series improve zeoropy testing | expand

Commit Message

Pavel Begunkov Aug. 4, 2022, 2:20 p.m. UTC
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 test/send-zerocopy.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c
index 6fa0535..c04e905 100644
--- a/test/send-zerocopy.c
+++ b/test/send-zerocopy.c
@@ -676,7 +676,7 @@  static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se
 
 	ret = io_uring_submit(ring);
 	if (ret != nr_reqs) {
-		fprintf(stderr, "submit failed %i expected %i\n", ret, nr_reqs);
+		fprintf(stderr, "submit failed, got %i expected %i\n", ret, nr_reqs);
 		return 1;
 	}
 
@@ -704,14 +704,15 @@  static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se
 
 	ret = recv(sock_server, rx_buffer, send_size, 0);
 	if (ret != send_size) {
-		fprintf(stderr, "recv less than expected or recv failed %i\n", ret);
+		fprintf(stderr, "recv less than expected or recv failed, "
+			"got %i, errno %i\n", ret, errno);
 		return 1;
 	}
 
 	for (i = 0; i < send_size; i++) {
 		if (buf[i] != rx_buffer[i]) {
-			fprintf(stderr, "botched data, first byte %i, %u vs %u\n",
-				i, buf[i], rx_buffer[i]);
+			fprintf(stderr, "botched data, first mismated byte %i, "
+				"%u vs %u\n", i, buf[i], rx_buffer[i]);
 		}
 	}
 	return 0;