From 313cbe0abffd02b33b379ba1057b4735d3573ad3 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 7 Sep 2024 14:34:55 -0700 Subject: Drop the legacy listener option functions --- tests/zt.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/zt.c b/tests/zt.c index b2aca7e7..c4e350b4 100644 --- a/tests/zt.c +++ b/tests/zt.c @@ -13,8 +13,8 @@ #include #include "convey.h" -#include "trantest.h" #include "stubs.h" +#include "trantest.h" // zerotier tests. @@ -151,7 +151,7 @@ TestMain("ZeroTier Transport", { Convey("And it can be started...", { mkdir(path1, 0700); - So(nng_listener_setopt(l, NNG_OPT_ZT_HOME, path1, + So(nng_listener_set(l, NNG_OPT_ZT_HOME, path1, strlen(path1) + 1) == 0); So(nng_listener_start(l, 0) == 0); @@ -171,14 +171,14 @@ TestMain("ZeroTier Transport", { ids[0] = 0x622514484aull; ids[1] = 0x622514484aull; - So(nng_listener_setopt(l, NNG_OPT_ZT_ORBIT, - ids, sizeof(ids)) == 0); + So(nng_listener_set(l, NNG_OPT_ZT_ORBIT, ids, + sizeof(ids)) == 0); }); Convey("And we can deorbit anything", { uint64_t id; id = 0x12345678; - So(nng_listener_setopt(l, NNG_OPT_ZT_DEORBIT, - &id, sizeof(id)) == 0); + So(nng_listener_set(l, NNG_OPT_ZT_DEORBIT, &id, + sizeof(id)) == 0); }); }); }); @@ -218,16 +218,15 @@ TestMain("ZeroTier Transport", { So(nng_listener_create(&l, s, addr) == 0); - So(nng_listener_get_uint64(l, NNG_OPT_ZT_NODE, &node1) == - 0); + So(nng_listener_get_uint64(l, NNG_OPT_ZT_NODE, &node1) == 0); So(node1 != 0); Convey("Connection refused works", { snprintf(addr, sizeof(addr), "zt://%llx." NWID ":%u", (unsigned long long) node1, 42u); So(nng_dialer_create(&d, s, addr) == 0); - So(nng_dialer_get_uint64( - d, NNG_OPT_ZT_NODE, &node2) == 0); + So(nng_dialer_get_uint64(d, NNG_OPT_ZT_NODE, &node2) == + 0); So(node2 == node1); So(nng_dialer_start(d, 0) == NNG_ECONNREFUSED); }); @@ -257,7 +256,7 @@ TestMain("ZeroTier Transport", { }); So(nng_listener_create(&l, s1, addr1) == 0); - So(nng_listener_setopt( + So(nng_listener_set( l, NNG_OPT_ZT_HOME, path1, strlen(path1) + 1) == 0); So(nng_listener_start(l, 0) == 0); -- cgit v1.2.3-70-g09d2