From d1218d7309475193b53911667911c4f59a1a7752 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 21 Nov 2020 22:11:21 -0800 Subject: New NUTS test framework (NNG Unit Test Support). This is based on testutil/acutest, but is cleaner and fixes some short-comings. We will be adding more support for additional common paradigms to better facilitate transport tests. While here we added some more test cases, and fixed a possible symbol collision in the the stats framework (due to Linux use of a macro definition of "si_value" in a standard OS header). Test coverage may regress slightly as we are no longer using some of the legacy APIs. --- src/protocol/bus0/bug1247_test.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src/protocol/bus0') diff --git a/src/protocol/bus0/bug1247_test.c b/src/protocol/bus0/bug1247_test.c index 6f418f53..bbc6958b 100644 --- a/src/protocol/bus0/bug1247_test.c +++ b/src/protocol/bus0/bug1247_test.c @@ -7,30 +7,26 @@ // found online at https://opensource.org/licenses/MIT. // -#include +#include -#include #include -#include "acutest.h" -#include "testutil.h" - void test_bug1247(void) { nng_socket bus1, bus2; - char addr[64]; + char * addr; - testutil_scratch_addr("tcp", sizeof(addr), addr); + NUTS_ADDR(addr, "tcp"); - TEST_NNG_PASS(nng_bus0_open(&bus1)); - TEST_NNG_PASS(nng_bus0_open(&bus2)); + NUTS_PASS(nng_bus0_open(&bus1)); + NUTS_PASS(nng_bus0_open(&bus2)); - TEST_NNG_PASS(nng_listen(bus1, addr, NULL, 0)); - TEST_NNG_FAIL(nng_listen(bus2, addr, NULL, 0), NNG_EADDRINUSE); + NUTS_PASS(nng_listen(bus1, addr, NULL, 0)); + NUTS_FAIL(nng_listen(bus2, addr, NULL, 0), NNG_EADDRINUSE); - TEST_NNG_PASS(nng_close(bus2)); - TEST_NNG_PASS(nng_close(bus1)); + NUTS_PASS(nng_close(bus2)); + NUTS_PASS(nng_close(bus1)); } TEST_LIST = { -- cgit v1.2.3-70-g09d2