summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2019-01-05 16:30:02 -0800
committerGarrett D'Amore <garrett@damore.org>2019-01-06 12:12:27 -0800
commit6d0027fae75e4810d66eb4c5817255ffa517e158 (patch)
tree9bd36c16cf293e4335ab0650e226a335029012ad /tests
parent68c6310ee83078d6ad6af0c9ccddef11b8f8b7c2 (diff)
downloadnng-6d0027fae75e4810d66eb4c5817255ffa517e158.tar.gz
nng-6d0027fae75e4810d66eb4c5817255ffa517e158.tar.bz2
nng-6d0027fae75e4810d66eb4c5817255ffa517e158.zip
fixes #839 TCP listener_start API should use constant sockaddr
Diffstat (limited to 'tests')
-rw-r--r--tests/tcpsupp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/tcpsupp.c b/tests/tcpsupp.c
index ede6a76f..1f91a60c 100644
--- a/tests/tcpsupp.c
+++ b/tests/tcpsupp.c
@@ -1,5 +1,5 @@
//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2019 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
@@ -34,14 +34,19 @@ TestMain("Supplemental TCP", {
Convey("Listener listens (wildcard)", {
nng_sockaddr sa;
uint32_t ip;
+ size_t sz;
memcpy(&ip, loopback, 4);
sa.s_in.sa_family = NNG_AF_INET;
sa.s_in.sa_addr = ip;
sa.s_in.sa_port = 0;
+ sz = sizeof(sa);
So(nng_tcp_listener_listen(l, &sa) == 0);
+ So(nng_tcp_listener_getopt(
+ l, NNG_OPT_LOCADDR, &sa, &sz) == 0);
+ So(sz == sizeof(sa));
So(sa.s_in.sa_port != 0);
So(sa.s_in.sa_addr == ip);