summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/survey.c11
-rw-r--r--tests/tcp.c7
2 files changed, 9 insertions, 9 deletions
diff --git a/tests/survey.c b/tests/survey.c
index 7a5929ba..a749b0b1 100644
--- a/tests/survey.c
+++ b/tests/survey.c
@@ -18,7 +18,6 @@
So(memcmp(nng_msg_body(m), s, strlen(s)) == 0)
Main({
- int rv;
const char *addr = "inproc://test";
nni_init();
@@ -47,7 +46,6 @@ Main({
Convey("Survey without responder times out", {
uint64_t expire = 50000;
nng_msg *msg;
- int rv;
So(nng_setopt(surv, NNG_OPT_SURVEYTIME, &expire, sizeof (expire)) == 0);
So(nng_msg_alloc(&msg, 0) == 0);
@@ -84,10 +82,10 @@ Main({
nng_socket *sock;
uint64_t expire;
- So((rv = nng_open(&surv, NNG_PROTO_SURVEYOR)) == 0);
+ So(nng_open(&surv, NNG_PROTO_SURVEYOR) == 0);
So(surv != NULL);
- So((rv = nng_open(&resp, NNG_PROTO_RESPONDENT)) == 0);
+ So(nng_open(&resp, NNG_PROTO_RESPONDENT) == 0);
So(resp != NULL);
@@ -106,7 +104,7 @@ Main({
// earlier dial to have completed *fully*. This is a
// hack that only works because our listen logic is
// single threaded.
- So((rv = nng_open(&sock, NNG_PROTO_RESPONDENT)) == 0);
+ So(nng_open(&sock, NNG_PROTO_RESPONDENT) == 0);
So(nng_dial(sock, addr, NULL, NNG_FLAG_SYNCH) == 0);
nng_close(sock);
@@ -133,8 +131,7 @@ Main({
Convey("And goes to non-survey state", {
rtimeo = 200000;
So(nng_setopt(surv, NNG_OPT_RCVTIMEO, &rtimeo, sizeof (rtimeo)) == 0);
- rv = nng_recvmsg(surv, &msg, 0);
- So(rv== NNG_ESTATE);
+ So(nng_recvmsg(surv, &msg, 0) == NNG_ESTATE);
})
})
})
diff --git a/tests/tcp.c b/tests/tcp.c
index ea97454e..4cc9070e 100644
--- a/tests/tcp.c
+++ b/tests/tcp.c
@@ -14,6 +14,8 @@
// Inproc tests.
TestMain("TCP Transport", {
+ int rv;
+
nni_init();
trantest_test_all("tcp://127.0.0.1:4450");
@@ -37,8 +39,9 @@ TestMain("TCP Transport", {
nng_close(s2);
nng_close(s1);
})
- So(nng_listen(s1, "tcp://*:5599", NULL, NNG_FLAG_SYNCH) == 0);
- So(nng_dial(s2, "tcp://127.0.0.1:5599", NULL, NNG_FLAG_SYNCH) == 0);
+ So(nng_listen(s1, "tcp://*:5771", NULL, NNG_FLAG_SYNCH) == 0);
+ So(nng_dial(s2, "tcp://127.0.0.1:5771", NULL, NNG_FLAG_SYNCH) == 0);
+ fflush(stdout);
})
nni_fini();