aboutsummaryrefslogtreecommitdiff
path: root/tests/bus.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-20 01:19:06 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-20 01:19:06 -0800
commitcb7e65fd5004fd24a7c23137e849c2828d2de6c3 (patch)
tree3de27fee15b13faf6ef649ea9760f173555b1bdc /tests/bus.c
parenta26375dc1ec12c41aaedf3e374175d37a1ae84e9 (diff)
downloadnng-cb7e65fd5004fd24a7c23137e849c2828d2de6c3.tar.gz
nng-cb7e65fd5004fd24a7c23137e849c2828d2de6c3.tar.bz2
nng-cb7e65fd5004fd24a7c23137e849c2828d2de6c3.zip
fixes #18 Sockets should be uint32_t's (handles) not pointers.
Diffstat (limited to 'tests/bus.c')
-rw-r--r--tests/bus.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/tests/bus.c b/tests/bus.c
index bb8531bd..6703fa0e 100644
--- a/tests/bus.c
+++ b/tests/bus.c
@@ -18,16 +18,14 @@
So(memcmp(nng_msg_body(m), s, strlen(s)) == 0)
Main({
- int rv;
const char *addr = "inproc://test";
nni_init();
Test("BUS pattern", {
Convey("We can create a BUS socket", {
- nng_socket *bus;
+ nng_socket bus;
So(nng_open(&bus, NNG_PROTO_BUS) == 0);
- So(bus != NULL);
Reset({
nng_close(bus);
@@ -40,20 +38,15 @@ Main({
})
Convey("We can create a linked BUS topology", {
- nng_socket *bus1;
- nng_socket *bus2;
- nng_socket *bus3;
+ nng_socket bus1;
+ nng_socket bus2;
+ nng_socket bus3;
uint64_t rtimeo;
- So((rv = nng_open(&bus1, NNG_PROTO_BUS)) == 0);
- So(bus1 != NULL);
-
- So((rv = nng_open(&bus2, NNG_PROTO_BUS)) == 0);
- So(bus2 != NULL);
-
- So((rv = nng_open(&bus3, NNG_PROTO_BUS)) == 0);
- So(bus3 != NULL);
-
+ So(nng_open(&bus1, NNG_PROTO_BUS) == 0);
+ So(nng_open(&bus2, NNG_PROTO_BUS) == 0);
+ So(nng_open(&bus3, NNG_PROTO_BUS) == 0);
+
Reset({
nng_close(bus1);
nng_close(bus2);