diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-09-07 11:33:05 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-10-06 13:59:35 -0700 |
| commit | 34be2c20a62e94e3a2815dd869609554b3922477 (patch) | |
| tree | 55eb5ae8aec9d9213f502bffda50abaa11b06bc2 /tests | |
| parent | 74adece2303ab7c2b05459c7ff24b362e9660068 (diff) | |
| download | nng-34be2c20a62e94e3a2815dd869609554b3922477.tar.gz nng-34be2c20a62e94e3a2815dd869609554b3922477.tar.bz2 nng-34be2c20a62e94e3a2815dd869609554b3922477.zip | |
Remove the legacy transport registration functions.
This also allows to remove most of the transport headers.
Only zerotier.h sticks around, and only for now. (We expect to
eject it into a separate module.)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ipc.c | 15 | ||||
| -rw-r--r-- | tests/multistress.c | 3 | ||||
| -rw-r--r-- | tests/reqstress.c | 3 | ||||
| -rw-r--r-- | tests/tls.c | 10 | ||||
| -rw-r--r-- | tests/trantest.h | 7 | ||||
| -rw-r--r-- | tests/ws.c | 13 | ||||
| -rw-r--r-- | tests/wss.c | 6 |
7 files changed, 13 insertions, 44 deletions
diff --git a/tests/ipc.c b/tests/ipc.c index 4f5de38b..4011f2ae 100644 --- a/tests/ipc.c +++ b/tests/ipc.c @@ -19,7 +19,6 @@ #include <nng/nng.h> #include <nng/protocol/reqrep0/req.h> -#include <nng/transport/ipc/ipc.h> #include "convey.h" #include "trantest.h" @@ -49,10 +48,8 @@ check_props(nng_msg *msg) So(nng_pipe_get(p, NNG_OPT_REMADDR, &ra, &z) == NNG_EINVAL); #ifdef _WIN32 - So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_UID, &id) == - NNG_ENOTSUP); - So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_GID, &id) == - NNG_ENOTSUP); + So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_UID, &id) == NNG_ENOTSUP); + So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_GID, &id) == NNG_ENOTSUP); So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_ZONEID, &id) == NNG_ENOTSUP); So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_PID, &id) == 0); @@ -68,8 +65,7 @@ check_props(nng_msg *msg) So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_PID, &id) == 0); So(id == (uint64_t) getpid()); #else - So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_PID, &id) == - NNG_ENOTSUP); + So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_PID, &id) == NNG_ENOTSUP); #endif #ifdef NNG_HAVE_GETPEERUCRED @@ -83,6 +79,5 @@ check_props(nng_msg *msg) return (0); } -TestMain("IPC Transport", { - trantest_test_extended("ipc:///tmp/nng_ipc_test_%u", check_props); -}) +TestMain("IPC Transport", + { trantest_test_extended("ipc:///tmp/nng_ipc_test_%u", check_props); }) diff --git a/tests/multistress.c b/tests/multistress.c index 5511fcc4..e58b94d7 100644 --- a/tests/multistress.c +++ b/tests/multistress.c @@ -24,9 +24,6 @@ #include <nng/protocol/reqrep0/req.h> #include <nng/protocol/survey0/respond.h> #include <nng/protocol/survey0/survey.h> -#include <nng/transport/inproc/inproc.h> -#include <nng/transport/ipc/ipc.h> -#include <nng/transport/tcp/tcp.h> #include "convey.h" #include "stubs.h" diff --git a/tests/reqstress.c b/tests/reqstress.c index 6696eace..de31e987 100644 --- a/tests/reqstress.c +++ b/tests/reqstress.c @@ -16,9 +16,6 @@ #include <nng/protocol/bus0/bus.h> #include <nng/protocol/reqrep0/rep.h> #include <nng/protocol/reqrep0/req.h> -#include <nng/transport/inproc/inproc.h> -#include <nng/transport/ipc/ipc.h> -#include <nng/transport/tcp/tcp.h> #include "convey.h" #include "stubs.h" diff --git a/tests/tls.c b/tests/tls.c index c3a4a46b..c218a5a6 100644 --- a/tests/tls.c +++ b/tests/tls.c @@ -1,6 +1,6 @@ // // Copyright 2018 Capitar IT Group BV <info@capitar.com> -// Copyright 2022 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -17,7 +17,6 @@ #include <nng/nng.h> #include <nng/protocol/pair1/pair.h> #include <nng/supplemental/tls/tls.h> -#include <nng/transport/tls/tls.h> #include "convey.h" #include "stubs.h" @@ -289,14 +288,10 @@ TestMain("TLS Transport", { trantest_test(&tt); - Convey("We can register the TLS transport", - { So(nng_tls_register() == 0); }); - Convey("We cannot connect to wild cards", { nng_socket s; char addr[NNG_MAXADDRLEN]; - So(nng_tls_register() == 0); So(nng_pair_open(&s) == 0); Reset({ nng_close(s); }); trantest_next_address(addr, "tls+tcp://*:"); @@ -310,7 +305,6 @@ TestMain("TLS Transport", { nng_listener l; nng_dialer d; - So(nng_tls_register() == 0); So(nng_pair_open(&s1) == 0); So(nng_pair_open(&s2) == 0); Reset({ @@ -337,7 +331,6 @@ TestMain("TLS Transport", { nng_dialer d; char *addr; - So(nng_tls_register() == 0); So(nng_pair_open(&s1) == 0); So(nng_pair_open(&s2) == 0); Reset({ @@ -359,7 +352,6 @@ TestMain("TLS Transport", { Convey("Malformed TLS addresses do not panic", { nng_socket s1; - So(nng_tls_register() == 0); So(nng_pair_open(&s1) == 0); Reset({ nng_close(s1); }); diff --git a/tests/trantest.h b/tests/trantest.h index 9176c543..2434171a 100644 --- a/tests/trantest.h +++ b/tests/trantest.h @@ -54,13 +54,6 @@ extern void trantest_test(trantest *tt); extern void trantest_test_extended(const char *addr, trantest_proptest_t f); extern void trantest_test_all(const char *addr); -#ifndef NNG_TRANSPORT_ZEROTIER -#define nng_zt_register notransport -#endif -#ifndef NNG_TRANSPORT_WSS -#define nng_wss_register notransport -#endif - int notransport(void) { @@ -1,5 +1,5 @@ // -// Copyright 2022 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -14,7 +14,6 @@ #include <nng/nng.h> #include <nng/protocol/pair1/pair.h> -#include <nng/transport/ws/websocket.h> #include "convey.h" #include "stubs.h" @@ -27,7 +26,7 @@ check_props_v4(nng_msg *msg) size_t z; nng_sockaddr la; nng_sockaddr ra; - char * buf; + char *buf; size_t len; p = nng_msg_get_pipe(msg); @@ -49,8 +48,7 @@ check_props_v4(nng_msg *msg) // Request Header z = 0; buf = NULL; - So(nng_pipe_get(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) == - NNG_EINVAL); + So(nng_pipe_get(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) == NNG_EINVAL); So(z > 0); len = z; So((buf = nng_alloc(len)) != NULL); @@ -81,6 +79,5 @@ check_props_v4(nng_msg *msg) return (0); } -TestMain("WebSocket Transport", { - trantest_test_extended("ws://127.0.0.1:", check_props_v4); -}) +TestMain("WebSocket Transport", + { trantest_test_extended("ws://127.0.0.1:", check_props_v4); }) diff --git a/tests/wss.c b/tests/wss.c index 6d7bc003..660ede3b 100644 --- a/tests/wss.c +++ b/tests/wss.c @@ -15,7 +15,6 @@ #include <nng/nng.h> #include <nng/protocol/pair1/pair.h> #include <nng/supplemental/tls/tls.h> -#include <nng/transport/ws/websocket.h> #include "convey.h" #include "stubs.h" @@ -136,7 +135,7 @@ check_props(nng_msg *msg) size_t z; nng_sockaddr la; nng_sockaddr ra; - char * buf; + char *buf; size_t len; p = nng_msg_get_pipe(msg); @@ -155,8 +154,7 @@ check_props(nng_msg *msg) // Request header z = 0; buf = NULL; - So(nng_pipe_get(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) == - NNG_EINVAL); + So(nng_pipe_get(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) == NNG_EINVAL); So(z > 0); len = z; So((buf = nng_alloc(len)) != NULL); |
