aboutsummaryrefslogtreecommitdiff
path: root/tests/tcp.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-03 08:29:55 -0800
committerGarrett D'Amore <garrett@damore.org>2024-11-03 08:30:34 -0800
commit8249242a9325a27e57107d78bfa168e918cc4f7a (patch)
tree3fa7a7a0dd66c23684b731f6b2686e9b6ea7a574 /tests/tcp.c
parenta5807e45b1badfb5d0cb4f697e1873a8ece59a30 (diff)
downloadnng-8249242a9325a27e57107d78bfa168e918cc4f7a.tar.gz
nng-8249242a9325a27e57107d78bfa168e918cc4f7a.tar.bz2
nng-8249242a9325a27e57107d78bfa168e918cc4f7a.zip
Remove untyped nng_pipe_get, support for untyped sockaddr set.
This is a step on the path to removing unsafe untyped option accesses.
Diffstat (limited to 'tests/tcp.c')
-rw-r--r--tests/tcp.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/tcp.c b/tests/tcp.c
index 1e4cfe11..2c80035c 100644
--- a/tests/tcp.c
+++ b/tests/tcp.c
@@ -40,16 +40,12 @@ check_props_v4(nng_msg *msg)
So(la.s_in.sa_addr == htonl(0x7f000001));
// untyped
- z = sizeof(nng_sockaddr);
- So(nng_pipe_get(p, NNG_OPT_REMADDR, &ra, &z) == 0);
- So(z == sizeof(ra));
+ So(nng_pipe_get_addr(p, NNG_OPT_REMADDR, &ra) == 0);
So(ra.s_family == NNG_AF_INET);
So(ra.s_in.sa_port != 0);
So(ra.s_in.sa_addr == htonl(0x7f000001));
So(nng_pipe_get_size(p, NNG_OPT_REMADDR, &z) == NNG_EBADTYPE);
- z = 1;
- So(nng_pipe_get(p, NNG_OPT_REMADDR, &ra, &z) == NNG_EINVAL);
So(nng_pipe_get_bool(p, NNG_OPT_TCP_KEEPALIVE, &b) == 0);
So(b == false); // default
@@ -60,6 +56,5 @@ check_props_v4(nng_msg *msg)
return (0);
}
-TestMain("TCP Transport", {
- trantest_test_extended("tcp://127.0.0.1:", check_props_v4);
-})
+TestMain("TCP Transport",
+ { trantest_test_extended("tcp://127.0.0.1:", check_props_v4); })