aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ipc.c15
-rw-r--r--tests/multistress.c3
-rw-r--r--tests/reqstress.c3
-rw-r--r--tests/tls.c10
-rw-r--r--tests/trantest.h7
-rw-r--r--tests/ws.c13
-rw-r--r--tests/wss.c6
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)
{
diff --git a/tests/ws.c b/tests/ws.c
index b4e08718..d2ae7f9b 100644
--- a/tests/ws.c
+++ b/tests/ws.c
@@ -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);