mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-12 10:33:52 +01:00
Problem: missing information on assertion failure
Solution: include sent and received counts on assertion failure
This commit is contained in:
parent
d328f90bb7
commit
b9041bf78c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user