aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-07-06 12:48:31 -0700
committerGarrett D'Amore <garrett@damore.org>2018-07-06 17:45:06 -0700
commit71b749dc3f948504f561098b1533154c2db7ec5e (patch)
tree1f421094ddb29c7d0d2a72795b1e50ddbcd382b1 /tests
parent42b7c4cc25ee87c5838a53efee1ca6bccbe3e765 (diff)
downloadnng-71b749dc3f948504f561098b1533154c2db7ec5e.tar.gz
nng-71b749dc3f948504f561098b1533154c2db7ec5e.tar.bz2
nng-71b749dc3f948504f561098b1533154c2db7ec5e.zip
fixes #582 transport tests should run even with dynamic linking
Diffstat (limited to 'tests')
-rw-r--r--tests/trantest.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/trantest.h b/tests/trantest.h
index 92d1db09..2b181d22 100644
--- a/tests/trantest.h
+++ b/tests/trantest.h
@@ -146,15 +146,17 @@ trantest_init(trantest *tt, const char *addr)
{
trantest_next_address(tt->addr, addr);
-#if defined(NNG_HAVE_REQ0) && defined(NNG_HAVE_REP0) && defined(NNG_STATIC_LIB)
+#if defined(NNG_HAVE_REQ0) && defined(NNG_HAVE_REP0)
So(nng_req_open(&tt->reqsock) == 0);
So(nng_rep_open(&tt->repsock) == 0);
nni_url *url;
- So(nni_url_parse(&url, tt->addr) == 0);
+ So(nng_url_parse(&url, tt->addr) == 0);
+#if defined(NNG_STATIC_LIB)
tt->tran = nni_tran_find(url);
- nni_url_free(url);
So(tt->tran != NULL);
+#endif
+ nng_url_free(url);
#else
ConveySkip("Missing REQ or REP protocols");
#endif
@@ -218,11 +220,15 @@ trantest_listen(trantest *tt, nng_listener *lp)
void
trantest_scheme(trantest *tt)
{
+#if NNG_STATIC_LIB
Convey("Scheme is correct", {
size_t l = strlen(tt->tran->tran_scheme);
So(strncmp(tt->addr, tt->tran->tran_scheme, l) == 0);
So(strncmp(tt->addr + l, "://", 3) == 0);
})
+#else
+ (void) tt;
+#endif
}
void