diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-10-30 14:04:25 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-10-30 14:04:25 -0700 |
| commit | b3a0d5864a71319dc85721288b9935a2a701b29e (patch) | |
| tree | 7b2f21a3454b3f67a18c4ba96a7a583fea0654aa /tests | |
| parent | 296d74dc8dbe880072c07f52365bbf43ed5684fa (diff) | |
| download | nng-b3a0d5864a71319dc85721288b9935a2a701b29e.tar.gz nng-b3a0d5864a71319dc85721288b9935a2a701b29e.tar.bz2 nng-b3a0d5864a71319dc85721288b9935a2a701b29e.zip | |
fixes #136 consider eliminating nng_shutdown
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/pipeline.c | 4 | ||||
| -rw-r--r-- | tests/sock.c | 24 |
2 files changed, 2 insertions, 26 deletions
diff --git a/tests/pipeline.c b/tests/pipeline.c index a7718dd6..31f02798 100644 --- a/tests/pipeline.c +++ b/tests/pipeline.c @@ -79,7 +79,7 @@ TestMain("PIPELINE (PUSH/PULL) pattern", { So(nng_listen(pull, addr, NULL, 0) == 0); So(nng_dial(push, addr, NULL, 0) == 0); So(nng_dial(what, addr, NULL, 0) == 0); - So(nng_shutdown(what) == 0); + So(nng_close(what) == 0); nng_msleep(20); @@ -146,7 +146,7 @@ TestMain("PIPELINE (PUSH/PULL) pattern", { So(nng_dial(pull1, addr, NULL, 0) == 0); So(nng_dial(pull2, addr, NULL, 0) == 0); So(nng_dial(pull3, addr, NULL, 0) == 0); - So(nng_shutdown(pull3) == 0); + So(nng_close(pull3) == 0); // So pull3 might not be done accepting yet, but pull1 // and pull2 definitely are, because otherwise the diff --git a/tests/sock.c b/tests/sock.c index 341bd263..cbe3d012 100644 --- a/tests/sock.c +++ b/tests/sock.c @@ -32,30 +32,6 @@ TestMain("Socket Operations", { Reset({ nng_close(s1); }); - Convey("And we can shut it down", { - char * buf; - size_t sz; - So(nng_shutdown(s1) == 0); - So(nng_shutdown(s1) == NNG_ECLOSED); - Convey("It can't receive", { - So(nng_recv(s1, &buf, &sz, NNG_FLAG_ALLOC) == - NNG_ECLOSED); - }); - Convey("It can't send", - { So(nng_send(s1, "", 0, 0) == NNG_ECLOSED); }); - Convey("Cannot create endpoints", { - nng_dialer d; - nng_listener l; - char * a = "inproc://closed"; - So(nng_dialer_create(&d, s1, a) == - NNG_ECLOSED); - So(nng_listener_create(&l, s1, a) == - NNG_ECLOSED); - So(nng_dial(s1, a, &d, 0) == NNG_ECLOSED); - So(nng_listen(s1, a, &l, 0) == NNG_ECLOSED); - }); - }); - Convey("It's type & peer are still PAIR", { So(nng_protocol(s1) == NNG_PROTO_PAIR); So(nng_peer(s1) == NNG_PROTO_PAIR); |
