aboutsummaryrefslogtreecommitdiff
path: root/tests/tcp.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-10-03 20:28:09 -0700
committerGarrett D'Amore <garrett@damore.org>2017-10-05 21:25:57 -0700
commitb0f31f578b0669b598d3ded3a625685b125bef1d (patch)
tree0044b1f6924700a4fe4e557826bb79796f9e94d0 /tests/tcp.c
parent557964482f2b9d4246a2943fb1bedc6074d01e0d (diff)
downloadnng-b0f31f578b0669b598d3ded3a625685b125bef1d.tar.gz
nng-b0f31f578b0669b598d3ded3a625685b125bef1d.tar.bz2
nng-b0f31f578b0669b598d3ded3a625685b125bef1d.zip
Improve UDP test coverage, fix numerous issues found.
We introduced richer, deeper tests for UDP functionality. These tests uncovered a number of issues which this commit fixes. The Windows IOCP code needs to support multiple aios on a single nni_win_event. A redesign of the IOCP handling addresses that. The POSIX UDP code also needed fixes; foremost among them is the fact that the UDP file descriptor is not placed into non-blocking mode, leading to potential hangs. A number of race conditions and bugs along the implementation of the above items were uncovered and fixed. To the best of our knowledge the current code is bug-free.
Diffstat (limited to 'tests/tcp.c')
-rw-r--r--tests/tcp.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/tcp.c b/tests/tcp.c
index 92e50a8b..54ce26b0 100644
--- a/tests/tcp.c
+++ b/tests/tcp.c
@@ -31,7 +31,7 @@ check_props_v4(nng_msg *msg, nng_listener l, nng_dialer d)
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 == (trantest_port - 1));
+ 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));
});
@@ -44,8 +44,6 @@ check_props_v4(nng_msg *msg, nng_listener l, nng_dialer d)
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(nng_dialer_getopt(d, NNG_OPT_REMADDR, &ra, &z) != 0);
});
return (0);