From 6d0027fae75e4810d66eb4c5817255ffa517e158 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 5 Jan 2019 16:30:02 -0800 Subject: fixes #839 TCP listener_start API should use constant sockaddr --- tests/tcpsupp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') 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. +// Copyright 2019 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // 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); -- cgit v1.2.3-70-g09d2