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. --- tests/testutil.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/testutil.h') diff --git a/tests/testutil.h b/tests/testutil.h index 008c8061..16e665f2 100644 --- a/tests/testutil.h +++ b/tests/testutil.h @@ -1,5 +1,5 @@ // -// Copyright 2019 Staysail Systems, Inc. +// Copyright 2020 Staysail Systems, Inc. // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -50,6 +50,10 @@ extern void testutil_scratch_addr(const char *, size_t, char *); // are fully connected. extern int testutil_marry(nng_socket, nng_socket); +// testutil_marry_ex is like testutil_marry, but returns the pipes that +// were connected. The pipe pointers may be NULL if not needed. +extern int testutil_marry_ex(nng_socket, nng_socket, nng_pipe *, nng_pipe *); + // TEST_NNG_PASS tests for NNG success. It reports the failure if it // did not. #define TEST_NNG_PASS(cond) \ -- cgit v1.2.3-70-g09d2