aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-03-14 15:40:46 -0700
committerGarrett D'Amore <garrett@damore.org>2018-03-14 17:16:39 -0700
commit85ccb0066a86a3558ae81cd357463f8dc631f94b (patch)
tree15838902439f6ed188ffb70fe2170605f26894bc /tests
parentf4de6b5302df8befbd2b229b701d0bf9ca81a5fb (diff)
downloadnng-85ccb0066a86a3558ae81cd357463f8dc631f94b.tar.gz
nng-85ccb0066a86a3558ae81cd357463f8dc631f94b.tar.bz2
nng-85ccb0066a86a3558ae81cd357463f8dc631f94b.zip
fixes #289 nng_sockaddr could just be a union
fixes #290 sockaddr improvements
Diffstat (limited to 'tests')
-rw-r--r--tests/resolv.c66
-rw-r--r--tests/tcp.c14
-rw-r--r--tests/tcp6.c26
-rw-r--r--tests/tls.c14
-rw-r--r--tests/udp.c54
-rw-r--r--tests/ws.c14
-rw-r--r--tests/wss.c10
-rw-r--r--tests/wssfile.c12
-rw-r--r--tests/zt.c16
9 files changed, 112 insertions, 114 deletions
diff --git a/tests/resolv.c b/tests/resolv.c
index 9d83e6df..dfc599c0 100644
--- a/tests/resolv.c
+++ b/tests/resolv.c
@@ -61,9 +61,9 @@ ip6tostr(void *addr)
aio);
nng_aio_wait(aio);
So(nng_aio_result(aio) == 0);
- So(sa.s_un.s_in6.sa_family == NNG_AF_INET6);
- So(sa.s_un.s_in6.sa_port == ntohs(80));
- str = ip6tostr(&sa.s_un.s_in6.sa_addr);
+ So(sa.s_in6.sa_family == NNG_AF_INET6);
+ So(sa.s_in6.sa_port == ntohs(80));
+ str = ip6tostr(&sa.s_in6.sa_addr);
So(strcmp(str, "::1") == 0);
nng_aio_free(aio);
}
@@ -83,9 +83,9 @@ TestMain("Resolver", {
NNG_AF_INET, 1, aio);
nng_aio_wait(aio);
So(nng_aio_result(aio) == 0);
- So(sa.s_un.s_in.sa_family == NNG_AF_INET);
- So(sa.s_un.s_in.sa_port == ntohs(80));
- str = ip4tostr(&sa.s_un.s_in.sa_addr);
+ So(sa.s_in.sa_family == NNG_AF_INET);
+ So(sa.s_in.sa_port == ntohs(80));
+ str = ip4tostr(&sa.s_in.sa_addr);
So(strcmp(str, "8.8.8.8") == 0);
nng_aio_free(aio);
});
@@ -99,9 +99,9 @@ TestMain("Resolver", {
nni_plat_udp_resolv("8.8.4.4", "69", NNG_AF_INET, 1, aio);
nng_aio_wait(aio);
So(nng_aio_result(aio) == 0);
- So(sa.s_un.s_in.sa_family == NNG_AF_INET);
- So(sa.s_un.s_in.sa_port == ntohs(69));
- str = ip4tostr(&sa.s_un.s_in.sa_addr);
+ So(sa.s_in.sa_family == NNG_AF_INET);
+ So(sa.s_in.sa_port == ntohs(69));
+ str = ip4tostr(&sa.s_in.sa_addr);
So(strcmp(str, "8.8.4.4") == 0);
nng_aio_free(aio);
});
@@ -115,9 +115,9 @@ TestMain("Resolver", {
nni_plat_tcp_resolv("8.8.4.4", "80", NNG_AF_INET, 1, aio);
nng_aio_wait(aio);
So(nng_aio_result(aio) == 0);
- So(sa.s_un.s_in.sa_family == NNG_AF_INET);
- So(sa.s_un.s_in.sa_port == ntohs(80));
- str = ip4tostr(&sa.s_un.s_in.sa_addr);
+ So(sa.s_in.sa_family == NNG_AF_INET);
+ So(sa.s_in.sa_port == ntohs(80));
+ str = ip4tostr(&sa.s_in.sa_addr);
So(strcmp(str, "8.8.4.4") == 0);
nng_aio_free(aio);
});
@@ -140,9 +140,9 @@ TestMain("Resolver", {
nni_plat_tcp_resolv("::1", "80", NNG_AF_INET6, 1, aio);
nng_aio_wait(aio);
So(nng_aio_result(aio) == 0);
- So(sa.s_un.s_in6.sa_family == NNG_AF_INET6);
- So(sa.s_un.s_in6.sa_port == ntohs(80));
- str = ip6tostr(&sa.s_un.s_in6.sa_addr);
+ So(sa.s_in6.sa_family == NNG_AF_INET6);
+ So(sa.s_in6.sa_port == ntohs(80));
+ str = ip6tostr(&sa.s_in6.sa_addr);
So(strcmp(str, "::1") == 0);
nng_aio_free(aio);
});
@@ -157,9 +157,9 @@ TestMain("Resolver", {
nni_plat_tcp_resolv("8.8.4.4", "http", NNG_AF_INET, 1, aio);
nng_aio_wait(aio);
So(nng_aio_result(aio) == 0);
- So(sa.s_un.s_in.sa_family == NNG_AF_INET);
- So(sa.s_un.s_in.sa_port == ntohs(80));
- str = ip4tostr(&sa.s_un.s_in.sa_addr);
+ So(sa.s_in.sa_family == NNG_AF_INET);
+ So(sa.s_in.sa_port == ntohs(80));
+ str = ip4tostr(&sa.s_in.sa_addr);
So(strcmp(str, "8.8.4.4") == 0);
nng_aio_free(aio);
});
@@ -174,9 +174,9 @@ TestMain("Resolver", {
nni_plat_udp_resolv("8.8.4.4", "tftp", NNG_AF_INET, 1, aio);
nng_aio_wait(aio);
So(nng_aio_result(aio) == 0);
- So(sa.s_un.s_in.sa_family == NNG_AF_INET);
- So(sa.s_un.s_in.sa_port == ntohs(69));
- str = ip4tostr(&sa.s_un.s_in.sa_addr);
+ So(sa.s_in.sa_family == NNG_AF_INET);
+ So(sa.s_in.sa_port == ntohs(69));
+ str = ip4tostr(&sa.s_in.sa_addr);
So(strcmp(str, "8.8.4.4") == 0);
nng_aio_free(aio);
});
@@ -191,10 +191,10 @@ TestMain("Resolver", {
nni_plat_tcp_resolv("localhost", "80", NNG_AF_INET, 1, aio);
nng_aio_wait(aio);
So(nng_aio_result(aio) == 0);
- So(sa.s_un.s_in.sa_family == NNG_AF_INET);
- So(sa.s_un.s_in.sa_port == ntohs(80));
- So(sa.s_un.s_in.sa_addr == ntohl(0x7f000001));
- str = ip4tostr(&sa.s_un.s_in.sa_addr);
+ So(sa.s_in.sa_family == NNG_AF_INET);
+ So(sa.s_in.sa_port == ntohs(80));
+ So(sa.s_in.sa_addr == ntohl(0x7f000001));
+ str = ip4tostr(&sa.s_in.sa_addr);
So(strcmp(str, "127.0.0.1") == 0);
nng_aio_free(aio);
});
@@ -209,18 +209,18 @@ TestMain("Resolver", {
nni_plat_tcp_resolv("localhost", "80", NNG_AF_UNSPEC, 1, aio);
nng_aio_wait(aio);
So(nng_aio_result(aio) == 0);
- So((sa.s_un.s_family == NNG_AF_INET) ||
- (sa.s_un.s_family == NNG_AF_INET6));
- switch (sa.s_un.s_family) {
+ So((sa.s_family == NNG_AF_INET) ||
+ (sa.s_family == NNG_AF_INET6));
+ switch (sa.s_family) {
case NNG_AF_INET:
- So(sa.s_un.s_in.sa_port == ntohs(80));
- So(sa.s_un.s_in.sa_addr == ntohl(0x7f000001));
- str = ip4tostr(&sa.s_un.s_in.sa_addr);
+ So(sa.s_in.sa_port == ntohs(80));
+ So(sa.s_in.sa_addr == ntohl(0x7f000001));
+ str = ip4tostr(&sa.s_in.sa_addr);
So(strcmp(str, "127.0.0.1") == 0);
break;
case NNG_AF_INET6:
- So(sa.s_un.s_in6.sa_port == ntohs(80));
- str = ip6tostr(&sa.s_un.s_in6.sa_addr);
+ So(sa.s_in6.sa_port == ntohs(80));
+ str = ip6tostr(&sa.s_in6.sa_addr);
So(strcmp(str, "::1") == 0);
break;
}
diff --git a/tests/tcp.c b/tests/tcp.c
index 42be028d..10d777da 100644
--- a/tests/tcp.c
+++ b/tests/tcp.c
@@ -33,17 +33,17 @@ check_props_v4(nng_msg *msg)
z = sizeof(nng_sockaddr);
So(nng_pipe_getopt(p, NNG_OPT_LOCADDR, &la, &z) == 0);
So(z == sizeof(la));
- So(la.s_un.s_family == NNG_AF_INET);
- So(la.s_un.s_in.sa_port == htons(trantest_port - 1));
- So(la.s_un.s_in.sa_port != 0);
- So(la.s_un.s_in.sa_addr == htonl(0x7f000001));
+ So(la.s_family == NNG_AF_INET);
+ So(la.s_in.sa_port == htons(trantest_port - 1));
+ So(la.s_in.sa_port != 0);
+ So(la.s_in.sa_addr == htonl(0x7f000001));
z = sizeof(nng_sockaddr);
So(nng_pipe_getopt(p, NNG_OPT_REMADDR, &ra, &z) == 0);
So(z == sizeof(ra));
- So(ra.s_un.s_family == NNG_AF_INET);
- So(ra.s_un.s_in.sa_port != 0);
- So(ra.s_un.s_in.sa_addr == htonl(0x7f000001));
+ So(ra.s_family == NNG_AF_INET);
+ So(ra.s_in.sa_port != 0);
+ So(ra.s_in.sa_addr == htonl(0x7f000001));
return (0);
}
diff --git a/tests/tcp6.c b/tests/tcp6.c
index c00f00f2..07990a36 100644
--- a/tests/tcp6.c
+++ b/tests/tcp6.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staystail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -24,10 +24,10 @@ has_v6(void)
nni_plat_udp *u;
int rv;
- sa.s_un.s_in6.sa_family = NNG_AF_INET6;
- sa.s_un.s_in6.sa_port = 0;
- memset(sa.s_un.s_in6.sa_addr, 0, 16);
- sa.s_un.s_in6.sa_addr[15] = 1;
+ sa.s_in6.sa_family = NNG_AF_INET6;
+ sa.s_in6.sa_port = 0;
+ memset(sa.s_in6.sa_addr, 0, 16);
+ sa.s_in6.sa_addr[15] = 1;
rv = nni_plat_udp_open(&u, &sa);
if (rv == 0) {
@@ -52,10 +52,10 @@ check_props_v6(nng_msg *msg)
So(p > 0);
So(nng_pipe_getopt(p, NNG_OPT_LOCADDR, &la, &z) == 0);
So(z == sizeof(la));
- So(la.s_un.s_family == NNG_AF_INET6);
- // So(la.s_un.s_in.sa_port == (trantest_port - 1));
- So(la.s_un.s_in6.sa_port != 0);
- So(memcmp(la.s_un.s_in6.sa_addr, loopback, 16) == 0);
+ So(la.s_family == NNG_AF_INET6);
+ // So(la.s_in.sa_port == (trantest_port - 1));
+ So(la.s_in6.sa_port != 0);
+ So(memcmp(la.s_in6.sa_addr, loopback, 16) == 0);
});
Convey("IPv6 Remote address property works", {
@@ -65,9 +65,9 @@ check_props_v6(nng_msg *msg)
So(p > 0);
So(nng_pipe_getopt(p, NNG_OPT_REMADDR, &ra, &z) == 0);
So(z == sizeof(ra));
- So(ra.s_un.s_family == NNG_AF_INET6);
- So(ra.s_un.s_in6.sa_port != 0);
- So(memcmp(ra.s_un.s_in6.sa_addr, loopback, 16) == 0);
+ So(ra.s_family == NNG_AF_INET6);
+ So(ra.s_in6.sa_port != 0);
+ So(memcmp(ra.s_in6.sa_addr, loopback, 16) == 0);
});
Convey("Malformed TCPv6 addresses do not panic", {
diff --git a/tests/tls.c b/tests/tls.c
index f51fabef..f46467fe 100644
--- a/tests/tls.c
+++ b/tests/tls.c
@@ -118,17 +118,17 @@ check_props_v4(nng_msg *msg)
z = sizeof(nng_sockaddr);
So(nng_pipe_getopt(p, NNG_OPT_LOCADDR, &la, &z) == 0);
So(z == sizeof(la));
- So(la.s_un.s_family == NNG_AF_INET);
- So(la.s_un.s_in.sa_port == htons(trantest_port - 1));
- So(la.s_un.s_in.sa_port != 0);
- So(la.s_un.s_in.sa_addr == htonl(0x7f000001));
+ So(la.s_family == NNG_AF_INET);
+ So(la.s_in.sa_port == htons(trantest_port - 1));
+ So(la.s_in.sa_port != 0);
+ So(la.s_in.sa_addr == htonl(0x7f000001));
z = sizeof(nng_sockaddr);
So(nng_pipe_getopt(p, NNG_OPT_REMADDR, &ra, &z) == 0);
So(z == sizeof(ra));
- So(ra.s_un.s_family == NNG_AF_INET);
- So(ra.s_un.s_in.sa_port != 0);
- So(ra.s_un.s_in.sa_addr == htonl(0x7f000001));
+ So(ra.s_family == NNG_AF_INET);
+ So(ra.s_in.sa_port != 0);
+ So(ra.s_in.sa_addr == htonl(0x7f000001));
return (0);
}
diff --git a/tests/udp.c b/tests/udp.c
index f10446b9..b0def72a 100644
--- a/tests/udp.c
+++ b/tests/udp.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -39,13 +39,13 @@ TestMain("UDP support", {
p1 = trantest_port++;
p2 = trantest_port++;
- sa1.s_un.s_in.sa_family = NNG_AF_INET;
- sa1.s_un.s_in.sa_addr = loopback;
- sa1.s_un.s_in.sa_port = htons(p1);
+ sa1.s_in.sa_family = NNG_AF_INET;
+ sa1.s_in.sa_addr = loopback;
+ sa1.s_in.sa_port = htons(p1);
- sa2.s_un.s_in.sa_family = NNG_AF_INET;
- sa2.s_un.s_in.sa_addr = loopback;
- sa2.s_un.s_in.sa_port = htons(p2);
+ sa2.s_in.sa_family = NNG_AF_INET;
+ sa2.s_in.sa_addr = loopback;
+ sa2.s_in.sa_port = htons(p2);
So(nni_plat_udp_open(&u1, &sa1) == 0);
So(nni_plat_udp_open(&u2, &sa2) == 0);
@@ -89,10 +89,9 @@ TestMain("UDP support", {
So(nng_aio_count(aio2) == strlen(msg) + 1);
So(strcmp(msg, rbuf) == 0);
- So(from.s_un.s_in.sa_family ==
- sa1.s_un.s_in.sa_family);
- So(from.s_un.s_in.sa_port == sa1.s_un.s_in.sa_port);
- So(from.s_un.s_in.sa_addr == sa1.s_un.s_in.sa_addr);
+ So(from.s_in.sa_family == sa1.s_in.sa_family);
+ So(from.s_in.sa_port == sa1.s_in.sa_port);
+ So(from.s_in.sa_addr == sa1.s_in.sa_addr);
// Set up some calls that will ever complete, so
// we test cancellation, etc.
@@ -183,10 +182,9 @@ TestMain("UDP support", {
So(nng_aio_result(aio3) == 0);
So(nng_aio_result(aio4) == 0);
- So(from1.s_un.s_in.sa_family ==
- sa1.s_un.s_in.sa_family);
- So(from1.s_un.s_in.sa_port == sa1.s_un.s_in.sa_port);
- So(from1.s_un.s_in.sa_addr == sa1.s_un.s_in.sa_addr);
+ So(from1.s_in.sa_family == sa1.s_in.sa_family);
+ So(from1.s_in.sa_port == sa1.s_in.sa_port);
+ So(from1.s_in.sa_addr == sa1.s_in.sa_addr);
nng_aio_free(aio1);
nng_aio_free(aio2);
@@ -217,11 +215,11 @@ TestMain("UDP support", {
int rv;
nng_iov iov;
- sa.s_un.s_in6.sa_family = NNG_AF_INET6;
+ sa.s_in6.sa_family = NNG_AF_INET6;
// address is for google.com
inet_ntop(AF_INET6, "2607:f8b0:4007:804::200e",
- (void *) sa.s_un.s_in6.sa_addr, 16);
- sa.s_un.s_in6.sa_port = 80;
+ (void *) sa.s_in6.sa_addr, 16);
+ sa.s_in6.sa_port = 80;
So(nng_aio_alloc(&aio1, NULL, NULL) == 0);
iov.iov_buf = msg;
iov.iov_len = strlen(msg) + 1;
@@ -243,11 +241,11 @@ TestMain("UDP support", {
int rv;
nng_iov iov;
- sa.s_un.s_in6.sa_family = NNG_AF_INET6;
+ sa.s_in6.sa_family = NNG_AF_INET6;
// address is for google.com
inet_ntop(AF_INET6, "2607:f8b0:4007:804::200e",
- (void *) sa.s_un.s_in6.sa_addr, 16);
- sa.s_un.s_in6.sa_port = 80;
+ (void *) sa.s_in6.sa_addr, 16);
+ sa.s_in6.sa_port = 80;
So(nng_aio_alloc(&aio1, NULL, NULL) == 0);
iov.iov_buf = msg;
iov.iov_len = strlen(msg) + 1;
@@ -269,8 +267,8 @@ TestMain("UDP support", {
nng_sockaddr sa;
int rv;
- sa.s_un.s_path.sa_family = NNG_AF_IPC;
- strcpy(sa.s_un.s_path.sa_path, "/tmp/t");
+ sa.s_ipc.sa_family = NNG_AF_IPC;
+ strcpy(sa.s_ipc.sa_path, "/tmp/t");
So((rv = nni_plat_udp_open(&u, &sa)) != 0);
// Some platforms reject IPC addresses altogether (Windows),
// whereas others just say it's not supported with UDP.
@@ -286,10 +284,10 @@ TestMain("UDP support", {
nng_sockaddr sa;
uint16_t p1;
- p1 = trantest_port++;
- sa.s_un.s_in.sa_family = NNG_AF_INET;
- sa.s_un.s_in.sa_port = htons(p1);
- sa.s_un.s_in.sa_addr = htonl(0x7f000001);
+ p1 = trantest_port++;
+ sa.s_in.sa_family = NNG_AF_INET;
+ sa.s_in.sa_port = htons(p1);
+ sa.s_in.sa_addr = htonl(0x7f000001);
So(nni_plat_udp_open(&u1, &sa) == 0);
So(nni_plat_udp_open(&u2, &sa) == NNG_EADDRINUSE);
nni_plat_udp_close(u1);
diff --git a/tests/ws.c b/tests/ws.c
index 4a8bd7a7..32175e9c 100644
--- a/tests/ws.c
+++ b/tests/ws.c
@@ -37,17 +37,17 @@ check_props_v4(nng_msg *msg)
z = sizeof(nng_sockaddr);
So(nng_pipe_getopt(p, NNG_OPT_LOCADDR, &la, &z) == 0);
So(z == sizeof(la));
- So(la.s_un.s_family == NNG_AF_INET);
- So(la.s_un.s_in.sa_port == htons(trantest_port - 1));
- So(la.s_un.s_in.sa_port != 0);
- So(la.s_un.s_in.sa_addr == htonl(0x7f000001));
+ So(la.s_family == NNG_AF_INET);
+ So(la.s_in.sa_port == htons(trantest_port - 1));
+ So(la.s_in.sa_port != 0);
+ So(la.s_in.sa_addr == htonl(0x7f000001));
z = sizeof(nng_sockaddr);
So(nng_pipe_getopt(p, NNG_OPT_REMADDR, &ra, &z) == 0);
So(z == sizeof(ra));
- So(ra.s_un.s_family == NNG_AF_INET);
- So(ra.s_un.s_in.sa_port != 0);
- So(ra.s_un.s_in.sa_addr == htonl(0x7f000001));
+ So(ra.s_family == NNG_AF_INET);
+ So(ra.s_in.sa_port != 0);
+ So(ra.s_in.sa_addr == htonl(0x7f000001));
// Request Header
z = 0;
diff --git a/tests/wss.c b/tests/wss.c
index 96dc9bd9..58df8cbf 100644
--- a/tests/wss.c
+++ b/tests/wss.c
@@ -106,21 +106,21 @@ validloopback(nng_sockaddr *sa)
memset(ipv6, 0, sizeof(ipv6));
ipv6[15] = 1;
- switch (sa->s_un.s_family) {
+ switch (sa->s_family) {
case NNG_AF_INET:
- if (sa->s_un.s_in.sa_port == 0) {
+ if (sa->s_in.sa_port == 0) {
return (0);
}
- if (sa->s_un.s_in.sa_addr != htonl(0x7f000001)) {
+ if (sa->s_in.sa_addr != htonl(0x7f000001)) {
return (0);
}
return (1);
case NNG_AF_INET6:
- if (sa->s_un.s_in6.sa_port == 0) {
+ if (sa->s_in6.sa_port == 0) {
return (0);
}
- if (memcmp(sa->s_un.s_in6.sa_addr, ipv6, sizeof(ipv6)) != 0) {
+ if (memcmp(sa->s_in6.sa_addr, ipv6, sizeof(ipv6)) != 0) {
return (0);
}
return (1);
diff --git a/tests/wssfile.c b/tests/wssfile.c
index 8b5b0126..15f7008e 100644
--- a/tests/wssfile.c
+++ b/tests/wssfile.c
@@ -11,8 +11,8 @@
#include "convey.h"
#include "nng.h"
#include "protocol/pair1/pair.h"
-#include "transport/ws/websocket.h"
#include "supplemental/tls/tls.h"
+#include "transport/ws/websocket.h"
#include "trantest.h"
@@ -107,21 +107,21 @@ validloopback(nng_sockaddr *sa)
memset(ipv6, 0, sizeof(ipv6));
ipv6[15] = 1;
- switch (sa->s_un.s_family) {
+ switch (sa->s_family) {
case NNG_AF_INET:
- if (sa->s_un.s_in.sa_port == 0) {
+ if (sa->s_in.sa_port == 0) {
return (0);
}
- if (sa->s_un.s_in.sa_addr != htonl(0x7f000001)) {
+ if (sa->s_in.sa_addr != htonl(0x7f000001)) {
return (0);
}
return (1);
case NNG_AF_INET6:
- if (sa->s_un.s_in6.sa_port == 0) {
+ if (sa->s_in6.sa_port == 0) {
return (0);
}
- if (memcmp(sa->s_un.s_in6.sa_addr, ipv6, sizeof(ipv6)) != 0) {
+ if (memcmp(sa->s_in6.sa_addr, ipv6, sizeof(ipv6)) != 0) {
return (0);
}
return (1);
diff --git a/tests/zt.c b/tests/zt.c
index 1952ef1b..3344f32b 100644
--- a/tests/zt.c
+++ b/tests/zt.c
@@ -53,10 +53,10 @@ check_props(nng_msg *msg)
z = sizeof(nng_sockaddr);
So(nng_pipe_getopt(p, NNG_OPT_LOCADDR, &la, &z) == 0);
So(z == sizeof(la));
- So(la.s_un.s_family == NNG_AF_ZT);
- So(la.s_un.s_zt.sa_port == (trantest_port - 1));
- So(la.s_un.s_zt.sa_nwid == 0xa09acf02337b057bull);
- So(la.s_un.s_zt.sa_nodeid != 0);
+ So(la.s_family == NNG_AF_ZT);
+ So(la.s_zt.sa_port == (trantest_port - 1));
+ So(la.s_zt.sa_nwid == 0xa09acf02337b057bull);
+ So(la.s_zt.sa_nodeid != 0);
});
Convey("Remote address property works", {
@@ -66,14 +66,14 @@ check_props(nng_msg *msg)
z = sizeof(nng_sockaddr);
So(nng_pipe_getopt(p, NNG_OPT_REMADDR, &ra, &z) == 0);
So(z == sizeof(ra));
- So(ra.s_un.s_family == NNG_AF_ZT);
- So(ra.s_un.s_zt.sa_port != 0);
- So(ra.s_un.s_zt.sa_nwid == 0xa09acf02337b057bull);
+ So(ra.s_family == NNG_AF_ZT);
+ So(ra.s_zt.sa_port != 0);
+ So(ra.s_zt.sa_nwid == 0xa09acf02337b057bull);
z = sizeof(mynode);
So(nng_pipe_getopt(p, NNG_OPT_ZT_NODE, &mynode, &z) == 0);
So(mynode != 0);
- So(ra.s_un.s_zt.sa_nodeid == mynode);
+ So(ra.s_zt.sa_nodeid == mynode);
});
Convey("NWID property works", {