aboutsummaryrefslogtreecommitdiff
path: root/tests/reqrep.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-10-19 15:16:25 -0700
committerGarrett D'Amore <garrett@damore.org>2017-10-19 17:56:49 -0700
commit4e668fdd5b5da0d46f97d835249dbe5f0ea319a7 (patch)
tree0aaad8a672024b3a510763150b167320be6f1f5b /tests/reqrep.c
parentd7e39a2423212a31c5ef62dcb0b7a5b4bf9f34df (diff)
downloadnng-4e668fdd5b5da0d46f97d835249dbe5f0ea319a7.tar.gz
nng-4e668fdd5b5da0d46f97d835249dbe5f0ea319a7.tar.bz2
nng-4e668fdd5b5da0d46f97d835249dbe5f0ea319a7.zip
fixes #84 Consider using msec for durations
There is now a public nng_duration type. We have also updated the zerotier work to work with the signed int64_t's that the latst ZeroTier dev branch is using.
Diffstat (limited to 'tests/reqrep.c')
-rw-r--r--tests/reqrep.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/reqrep.c b/tests/reqrep.c
index c31f0212..ada21875 100644
--- a/tests/reqrep.c
+++ b/tests/reqrep.c
@@ -31,8 +31,8 @@ TestMain("REQ/REP pattern", {
Convey("Resend time option id works", {
// Set timeout.
- So(nng_setopt_usec(
- req, NNG_OPT_REQ_RESENDTIME, 10000) == 0);
+ So(nng_setopt_ms(req, NNG_OPT_REQ_RESENDTIME, 10) ==
+ 0);
// Check invalid size
So(nng_setopt(req, NNG_OPT_REQ_RESENDTIME, "", 1) ==
NNG_EINVAL);
@@ -66,7 +66,7 @@ TestMain("REQ/REP pattern", {
});
Convey("Cannot set resend time", {
- So(nng_setopt_usec(rep, NNG_OPT_REQ_RESENDTIME, 100) ==
+ So(nng_setopt_ms(rep, NNG_OPT_REQ_RESENDTIME, 100) ==
NNG_ENOTSUP);
});
});
@@ -114,10 +114,10 @@ TestMain("REQ/REP pattern", {
});
Convey("Request cancellation works", {
- nng_msg *abc;
- nng_msg *def;
- nng_msg *cmd;
- uint64_t retry = 100000; // 100 ms
+ nng_msg * abc;
+ nng_msg * def;
+ nng_msg * cmd;
+ nng_duration retry = 100; // 100 ms
nng_socket req;
nng_socket rep;
@@ -131,7 +131,7 @@ TestMain("REQ/REP pattern", {
nng_close(req);
});
- So(nng_setopt_usec(req, NNG_OPT_REQ_RESENDTIME, retry) == 0);
+ So(nng_setopt_ms(req, NNG_OPT_REQ_RESENDTIME, retry) == 0);
So(nng_setopt_int(req, NNG_OPT_SENDBUF, 16) == 0);
So(nng_msg_alloc(&abc, 0) == 0);