diff options
Diffstat (limited to 'tests/reqrep.c')
| -rw-r--r-- | tests/reqrep.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/tests/reqrep.c b/tests/reqrep.c index 537d45c8..c31f0212 100644 --- a/tests/reqrep.c +++ b/tests/reqrep.c @@ -13,9 +13,6 @@ #include <string.h> -extern const char *nng_opt_req_resendtime; -extern int nng_optid_req_resendtime; - TestMain("REQ/REP pattern", { int rv; const char *addr = "inproc://test"; @@ -32,19 +29,13 @@ TestMain("REQ/REP pattern", { }); Convey("Resend time option id works", { - int opt; - const char *name; - opt = nng_option_lookup(nng_opt_req_resendtime); - So(opt >= 0); - So(opt == nng_optid_req_resendtime); - name = nng_option_name(opt); - So(name != NULL); - So(strcmp(name, nng_opt_req_resendtime) == 0); // Set timeout. - So(nng_setopt_usec(req, opt, 10000) == 0); + So(nng_setopt_usec( + req, NNG_OPT_REQ_RESENDTIME, 10000) == 0); // Check invalid size - So(nng_setopt(req, opt, name, 1) == NNG_EINVAL); + So(nng_setopt(req, NNG_OPT_REQ_RESENDTIME, "", 1) == + NNG_EINVAL); }); Convey("Recv with no send fails", { @@ -75,8 +66,8 @@ TestMain("REQ/REP pattern", { }); Convey("Cannot set resend time", { - So(nng_setopt_usec(rep, nng_optid_req_resendtime, - 100) == NNG_ENOTSUP); + So(nng_setopt_usec(rep, NNG_OPT_REQ_RESENDTIME, 100) == + NNG_ENOTSUP); }); }); @@ -140,8 +131,8 @@ TestMain("REQ/REP pattern", { nng_close(req); }); - So(nng_setopt_usec(req, nng_optid_req_resendtime, retry) == 0); - So(nng_setopt_int(req, nng_optid_sendbuf, 16) == 0); + So(nng_setopt_usec(req, NNG_OPT_REQ_RESENDTIME, retry) == 0); + So(nng_setopt_int(req, NNG_OPT_SENDBUF, 16) == 0); So(nng_msg_alloc(&abc, 0) == 0); So(nng_msg_append(abc, "abc", 4) == 0); |
