From 6d92c73e5cdf93fe70b0646e78a250e01a8d2f65 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 11 Jan 2020 13:15:40 -0800 Subject: XREQ and others race on TTL. The TTL in these cases should have been atomic. To facilitate things we actually introduce an atomic int for convenience. We also introduce a convenience nni_msg_must_append_u32() and nni_msg_header_must_append_u32(), so that we can eliminate some failure tests that cannot ever happen. Combined with a new test for xreq, we have 100% coverage for xreq and more coverage for the other REQ/REP protocols. --- src/protocol/reqrep0/rep_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/protocol/reqrep0/rep_test.c') diff --git a/src/protocol/reqrep0/rep_test.c b/src/protocol/reqrep0/rep_test.c index f339e68d..7c6d6ba0 100644 --- a/src/protocol/reqrep0/rep_test.c +++ b/src/protocol/reqrep0/rep_test.c @@ -117,7 +117,7 @@ test_rep_poll_readable(void) TEST_CHECK(testutil_pollfd(fd) == true); - // and receiving makes it no longer pollable + // and receiving makes it no longer ready TEST_NNG_PASS(nng_recvmsg(rep, &msg, 0)); nng_msg_free(msg); TEST_CHECK(testutil_pollfd(fd) == false); @@ -129,7 +129,7 @@ test_rep_poll_readable(void) } void -test_rep_context_not_pollable(void) +test_rep_context_no_poll(void) { int fd; nng_socket req; @@ -439,7 +439,7 @@ TEST_LIST = { { "rep send bad state", test_rep_send_bad_state }, { "rep poll readable", test_rep_poll_readable }, { "rep poll writable", test_rep_poll_writeable }, - { "rep context not pollable", test_rep_context_not_pollable }, + { "rep context does not poll", test_rep_context_no_poll }, { "rep validate peer", test_rep_validate_peer }, { "rep double recv", test_rep_double_recv }, { "rep close pipe before send", test_rep_close_pipe_before_send }, -- cgit v1.2.3-70-g09d2