aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-06-25 15:48:44 -0700
committerGarrett D'Amore <garrett@damore.org>2017-06-25 15:48:44 -0700
commit9f762db90aefdc95839707013a89ca3680ad3f34 (patch)
tree0fe5581a46a37a96f3f29abea1be96caeac8aeb0
parentbaba9825f11aa6759fccecbf92b4d25fb41be5ec (diff)
downloadnng-9f762db90aefdc95839707013a89ca3680ad3f34.tar.gz
nng-9f762db90aefdc95839707013a89ca3680ad3f34.tar.bz2
nng-9f762db90aefdc95839707013a89ca3680ad3f34.zip
Make reqrep test more robust; sock test faster.
-rw-r--r--tests/reqrep.c6
-rw-r--r--tests/sock.c6
2 files changed, 5 insertions, 7 deletions
diff --git a/tests/reqrep.c b/tests/reqrep.c
index 52269711..d4040bdb 100644
--- a/tests/reqrep.c
+++ b/tests/reqrep.c
@@ -133,19 +133,17 @@ Main({
So(nng_msg_alloc(&def, 0) == 0);
So(nng_msg_append(def, "def", 4) == 0);
+ So(nng_listen(rep, addr, NULL, NNG_FLAG_SYNCH) == 0);
So(nng_dial(req, addr, NULL, 0) == 0);
So(nng_sendmsg(req, abc, 0) == 0);
So(nng_sendmsg(req, def, 0) == 0);
-
- So(nng_listen(rep, addr, NULL, NNG_FLAG_SYNCH) == 0);
-
So(nng_recvmsg(rep, &cmd, 0) == 0);
So(cmd != NULL);
+
So(nng_sendmsg(rep, cmd, 0) == 0);
So(nng_recvmsg(rep, &cmd, 0) == 0);
So(nng_sendmsg(rep, cmd, 0) == 0);
-
So(nng_recvmsg(req, &cmd, 0) == 0);
So(nng_msg_len(cmd) == 4);
diff --git a/tests/sock.c b/tests/sock.c
index c43b6fc1..6c6d5b06 100644
--- a/tests/sock.c
+++ b/tests/sock.c
@@ -39,7 +39,7 @@ Main({
Convey("Recv with no pipes times out correctly", {
nng_msg *msg = NULL;
- int64_t when = 500000;
+ int64_t when = 100000;
uint64_t now;
now = nni_clock();
@@ -63,7 +63,7 @@ Main({
Convey("Send with no pipes times out correctly", {
nng_msg *msg = NULL;
- int64_t when = 500000;
+ int64_t when = 100000;
uint64_t now;
// We cheat to get access to the core's clock.
@@ -168,7 +168,7 @@ Main({
So(nng_setopt(sock2, NNG_OPT_RCVTIMEO, &second, sizeof (second)) == 0);
So(nng_listen(sock, "inproc://test1", NULL, NNG_FLAG_SYNCH) == 0);
- So(nng_dial(sock2, "inproc://test1", NULL, 0) == 0);
+ So(nng_dial(sock2, "inproc://test1", NULL, NNG_FLAG_SYNCH) == 0);
So(nng_send(sock, "abc", 4, 0) == 0);
So(nng_recv(sock2 , &buf, &sz, NNG_FLAG_ALLOC) == 0);