diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-08-14 21:58:02 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-08-14 21:58:02 -0700 |
| commit | b47a223bfb2c7114154504ec8d6cdac5abd0b884 (patch) | |
| tree | a9f70f7e3ca9d00a77fb2026daf5f1c3ba0cf013 /tests/sock.c | |
| parent | 6655557fca28408e0eeac3ba80b9e2bbdeada389 (diff) | |
| download | nng-b47a223bfb2c7114154504ec8d6cdac5abd0b884.tar.gz nng-b47a223bfb2c7114154504ec8d6cdac5abd0b884.tar.bz2 nng-b47a223bfb2c7114154504ec8d6cdac5abd0b884.zip | |
Convert duration to usec.
Diffstat (limited to 'tests/sock.c')
| -rw-r--r-- | tests/sock.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/sock.c b/tests/sock.c index 31d48333..d33b0c81 100644 --- a/tests/sock.c +++ b/tests/sock.c @@ -60,7 +60,7 @@ TestMain("Socket Operations", { now = nng_clock(); So(now > 0); - So(nng_setopt_duration(s1, NNG_OPT_RCVTIMEO, to) == 0); + So(nng_setopt_usec(s1, NNG_OPT_RCVTIMEO, to) == 0); So(nng_recvmsg(s1, &msg, 0) == NNG_ETIMEDOUT); So(msg == NULL); So(nng_clock() >= (now + to)); @@ -84,7 +84,7 @@ TestMain("Socket Operations", { So(msg != NULL); now = nng_clock(); - So(nng_setopt_duration(s1, NNG_OPT_SNDTIMEO, to) == 0); + So(nng_setopt_usec(s1, NNG_OPT_SNDTIMEO, to) == 0); So(nng_sendmsg(s1, msg, 0) == NNG_ETIMEDOUT); So(nng_clock() >= (now + to)); So(nng_clock() < (now + (to * 2))); @@ -96,7 +96,7 @@ TestMain("Socket Operations", { int64_t v = 0; size_t sz; - So(nng_setopt_duration(s1, NNG_OPT_SNDTIMEO, to) == 0); + So(nng_setopt_usec(s1, NNG_OPT_SNDTIMEO, to) == 0); Convey("Short size is not copied", { sz = 0; @@ -129,8 +129,8 @@ TestMain("Socket Operations", { }); Convey("Negative timeout fails", { - So(nng_setopt_duration(s1, NNG_OPT_RCVTIMEO, - -5) == NNG_EINVAL); + So(nng_setopt_usec(s1, NNG_OPT_RCVTIMEO, -5) == + NNG_EINVAL); }); Convey("Short timeout fails", { @@ -256,10 +256,10 @@ TestMain("Socket Operations", { So(nng_setopt_int(s1, NNG_OPT_SNDBUF, 1) == 0); So(nng_setopt_int(s2, NNG_OPT_SNDBUF, 1) == 0); - So(nng_setopt_duration(s1, NNG_OPT_SNDTIMEO, to) == 0); - So(nng_setopt_duration(s1, NNG_OPT_RCVTIMEO, to) == 0); - So(nng_setopt_duration(s2, NNG_OPT_SNDTIMEO, to) == 0); - So(nng_setopt_duration(s2, NNG_OPT_RCVTIMEO, to) == 0); + So(nng_setopt_usec(s1, NNG_OPT_SNDTIMEO, to) == 0); + So(nng_setopt_usec(s1, NNG_OPT_RCVTIMEO, to) == 0); + So(nng_setopt_usec(s2, NNG_OPT_SNDTIMEO, to) == 0); + So(nng_setopt_usec(s2, NNG_OPT_RCVTIMEO, to) == 0); So(nng_listen(s1, a, NULL, 0) == 0); So(nng_dial(s2, a, NULL, 0) == 0); |
