aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-03 08:38:22 -0800
committerGarrett D'Amore <garrett@damore.org>2024-11-03 08:49:33 -0800
commit4367013d8b56105edd0d27d0b9b6da2becab9717 (patch)
tree1bc6abaaff5b010adc415b3ab25698b59e73f353 /tests
parent8249242a9325a27e57107d78bfa168e918cc4f7a (diff)
downloadnng-4367013d8b56105edd0d27d0b9b6da2becab9717.tar.gz
nng-4367013d8b56105edd0d27d0b9b6da2becab9717.tar.bz2
nng-4367013d8b56105edd0d27d0b9b6da2becab9717.zip
Remove untyped stream option functions.
The underlying stream APIs have no need for untyped accessors. Another step on the road to removal of NNI_TYPE_OPAQUE.
Diffstat (limited to 'tests')
-rw-r--r--tests/tcpsupp.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/tests/tcpsupp.c b/tests/tcpsupp.c
index be947129..d7d5c38d 100644
--- a/tests/tcpsupp.c
+++ b/tests/tcpsupp.c
@@ -97,7 +97,6 @@ TestMain("Supplemental TCP", {
char buf1[5];
char buf2[5];
bool on;
- size_t sz;
So(nng_aio_alloc(&aio1, NULL, NULL) ==
0);
@@ -110,19 +109,14 @@ TestMain("Supplemental TCP", {
});
on = false;
- sz = sizeof(on);
- So(nng_stream_get(c1,
- NNG_OPT_TCP_NODELAY, &on,
- &sz) == 0);
- So(sz == sizeof(on));
+ So(nng_stream_get_bool(c1,
+ NNG_OPT_TCP_NODELAY, &on) == 0);
So(on == true);
on = false;
- sz = sizeof(on);
- So(nng_stream_get(c1,
- NNG_OPT_TCP_KEEPALIVE, &on,
- &sz) == 0);
- So(sz == sizeof(on));
+ So(nng_stream_get_bool(c1,
+ NNG_OPT_TCP_KEEPALIVE,
+ &on) == 0);
// This relies on send completing for
// for just 5 bytes, and on recv doing
@@ -153,11 +147,9 @@ TestMain("Supplemental TCP", {
So(memcmp(buf1, buf2, 5) == 0);
Convey("Socket name matches", {
- sz = sizeof(sa2);
- So(nng_stream_get(c2,
- NNG_OPT_LOCADDR, &sa2,
- &sz) == 0);
- So(sz == sizeof(sa2));
+ So(nng_stream_get_addr(c2,
+ NNG_OPT_LOCADDR,
+ &sa2) == 0);
So(sa2.s_in.sa_family ==
NNG_AF_INET);
@@ -168,11 +160,9 @@ TestMain("Supplemental TCP", {
});
Convey("Peer name matches", {
- sz = sizeof(sa2);
- So(nng_stream_get(c1,
- NNG_OPT_REMADDR, &sa2,
- &sz) == 0);
- So(sz == sizeof(sa2));
+ So(nng_stream_get_addr(c1,
+ NNG_OPT_REMADDR,
+ &sa2) == 0);
So(sa2.s_in.sa_family ==
NNG_AF_INET);
So(sa2.s_in.sa_addr ==