aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/bus0
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-11-21 22:11:21 -0800
committerGarrett D'Amore <garrett@damore.org>2020-11-23 22:20:12 -0800
commitd1218d7309475193b53911667911c4f59a1a7752 (patch)
tree6ea796998fb60d2cb8afa704faa77fe7fddd644c /src/protocol/bus0
parentb826bfc171d90f8bde7bd672c0ac14201b8b2742 (diff)
downloadnng-d1218d7309475193b53911667911c4f59a1a7752.tar.gz
nng-d1218d7309475193b53911667911c4f59a1a7752.tar.bz2
nng-d1218d7309475193b53911667911c4f59a1a7752.zip
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.
Diffstat (limited to 'src/protocol/bus0')
-rw-r--r--src/protocol/bus0/bug1247_test.c22
1 files changed, 9 insertions, 13 deletions
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 <string.h>
+#include <nuts.h>
-#include <nng/nng.h>
#include <nng/protocol/bus0/bus.h>
-#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 = {