From b9041bf78c06b126f90edbbc1a9873576a9090f7 Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Tue, 2 Apr 2019 18:52:48 +0200 Subject: [PATCH] Problem: missing information on assertion failure Solution: include sent and received counts on assertion failure --- tests/test_hwm_pubsub.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_hwm_pubsub.cpp b/tests/test_hwm_pubsub.cpp index a644c04b..d4b541aa 100644 --- a/tests/test_hwm_pubsub.cpp +++ b/tests/test_hwm_pubsub.cpp @@ -153,13 +153,16 @@ int test_blocking (int send_hwm_, int msg_cnt_, const char *endpoint) } else if (-1 == rc) { // if the PUB socket blocks due to HWM, errno should be EAGAIN: blocked_count++; - TEST_ASSERT_EQUAL_INT (EAGAIN, errno); + TEST_ASSERT_FAILURE_ERRNO (EAGAIN, -1); recv_count += receive (sub_socket, &is_termination); } } // if send_hwm_ < msg_cnt_, we should block at least once: - TEST_ASSERT_GREATER_THAN_INT (0, blocked_count); + char counts_string[128]; + snprintf (counts_string, sizeof counts_string - 1, + "sent = %i, received = %i", send_count, recv_count); + TEST_ASSERT_GREATER_THAN_INT_MESSAGE (0, blocked_count, counts_string); // dequeue SUB socket again, to make sure XPUB has space to send the termination message recv_count += receive (sub_socket, &is_termination);