aboutsummaryrefslogtreecommitdiff
path: root/src/sp/protocol
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-10-20 17:01:10 -0700
committerGarrett D'Amore <garrett@damore.org>2024-10-20 17:01:10 -0700
commit693773195dcd877164314d6b4c37cbd980cbb6ab (patch)
tree3c6014205fb75d1e39227ac505dab8964e57a815 /src/sp/protocol
parent5830408d11fb19aaf78cb47016ea1692e8f6d2ed (diff)
downloadnng-693773195dcd877164314d6b4c37cbd980cbb6ab.tar.gz
nng-693773195dcd877164314d6b4c37cbd980cbb6ab.tar.bz2
nng-693773195dcd877164314d6b4c37cbd980cbb6ab.zip
Use `const` for nng_stat when possible.
This should help the compiler enforce checks, and may result in better optimizations.
Diffstat (limited to 'src/sp/protocol')
-rw-r--r--src/sp/protocol/bus0/bus_test.c12
-rw-r--r--src/sp/protocol/pair0/pair0_test.c28
-rw-r--r--src/sp/protocol/pair1/pair1_poly_test.c24
-rw-r--r--src/sp/protocol/pair1/pair1_test.c38
-rw-r--r--src/sp/protocol/pipeline0/pull_test.c22
-rw-r--r--src/sp/protocol/pipeline0/push_test.c46
-rw-r--r--src/sp/protocol/pubsub0/pub_test.c22
-rw-r--r--src/sp/protocol/pubsub0/sub_test.c42
-rw-r--r--src/sp/protocol/pubsub0/xsub_test.c24
-rw-r--r--src/sp/protocol/reqrep0/rep_test.c10
-rw-r--r--src/sp/protocol/reqrep0/req_test.c14
-rw-r--r--src/sp/protocol/reqrep0/xrep_test.c32
-rw-r--r--src/sp/protocol/reqrep0/xreq_test.c26
-rw-r--r--src/sp/protocol/survey0/respond_test.c46
-rw-r--r--src/sp/protocol/survey0/survey_test.c10
-rw-r--r--src/sp/protocol/survey0/xrespond_test.c32
-rw-r--r--src/sp/protocol/survey0/xsurvey_test.c36
17 files changed, 234 insertions, 230 deletions
diff --git a/src/sp/protocol/bus0/bus_test.c b/src/sp/protocol/bus0/bus_test.c
index 6a214972..a832d9dd 100644
--- a/src/sp/protocol/bus0/bus_test.c
+++ b/src/sp/protocol/bus0/bus_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2021 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
@@ -70,7 +70,7 @@ test_bus_device(void)
{
nng_socket s1, s2, s3;
nng_socket none = NNG_SOCKET_INITIALIZER;
- nng_aio *aio;
+ nng_aio *aio;
NUTS_PASS(nng_bus0_open_raw(&s1));
NUTS_PASS(nng_bus0_open(&s2));
@@ -101,10 +101,10 @@ test_bus_device(void)
static void
test_bus_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat *stats;
- nng_stat *reject;
- char *addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
NUTS_PASS(nng_bus0_open(&s1));
diff --git a/src/sp/protocol/pair0/pair0_test.c b/src/sp/protocol/pair0/pair0_test.c
index 0bce1bb7..83d72c0c 100644
--- a/src/sp/protocol/pair0/pair0_test.c
+++ b/src/sp/protocol/pair0/pair0_test.c
@@ -22,7 +22,7 @@ test_identity(void)
{
nng_socket s;
int p;
- char * n;
+ char *n;
NUTS_PASS(nng_pair0_open(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p));
@@ -43,7 +43,7 @@ test_cooked(void)
{
nng_socket s1;
nng_socket c1;
- nng_msg * msg;
+ nng_msg *msg;
NUTS_PASS(nng_pair0_open(&s1));
NUTS_PASS(nng_pair0_open(&c1));
@@ -75,7 +75,7 @@ test_faithful(void)
nng_socket s1;
nng_socket c1;
nng_socket c2;
- nng_msg * msg;
+ nng_msg *msg;
const char *addr = "inproc://pair0_mono_faithful";
NUTS_PASS(nng_pair0_open(&s1));
@@ -116,7 +116,7 @@ test_back_pressure(void)
nng_socket c1;
int i;
int rv;
- nng_msg * msg;
+ nng_msg *msg;
nng_duration to = 100;
NUTS_PASS(nng_pair0_open(&s1));
@@ -147,7 +147,7 @@ void
test_send_no_peer(void)
{
nng_socket s1;
- nng_msg * msg;
+ nng_msg *msg;
nng_duration to = 100;
NUTS_PASS(nng_pair0_open(&s1));
@@ -203,8 +203,8 @@ void
test_pair0_send_closed_aio(void)
{
nng_socket s1;
- nng_aio * aio;
- nng_msg * msg;
+ nng_aio *aio;
+ nng_msg *msg;
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
NUTS_PASS(nng_msg_alloc(&msg, 0));
@@ -241,10 +241,10 @@ test_pair0_raw(void)
void
test_pair0_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char * addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
NUTS_PASS(nng_pair0_open(&s1));
@@ -295,7 +295,8 @@ test_pair0_send_buffer(void)
NUTS_FAIL(nng_socket_get(s, NNG_OPT_SENDBUF, &b, &sz), NNG_EINVAL);
NUTS_FAIL(nng_socket_set_int(s, NNG_OPT_SENDBUF, -1), NNG_EINVAL);
NUTS_FAIL(nng_socket_set_int(s, NNG_OPT_SENDBUF, 100000), NNG_EINVAL);
- NUTS_FAIL(nng_socket_set_bool(s, NNG_OPT_SENDBUF, false), NNG_EBADTYPE);
+ NUTS_FAIL(
+ nng_socket_set_bool(s, NNG_OPT_SENDBUF, false), NNG_EBADTYPE);
NUTS_FAIL(nng_socket_set(s, NNG_OPT_SENDBUF, &b, 1), NNG_EINVAL);
NUTS_PASS(nng_socket_set_int(s, NNG_OPT_SENDBUF, 100));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_SENDBUF, &v));
@@ -319,7 +320,8 @@ test_pair0_recv_buffer(void)
NUTS_FAIL(nng_socket_get(s, NNG_OPT_RECVBUF, &b, &sz), NNG_EINVAL);
NUTS_FAIL(nng_socket_set_int(s, NNG_OPT_RECVBUF, -1), NNG_EINVAL);
NUTS_FAIL(nng_socket_set_int(s, NNG_OPT_RECVBUF, 100000), NNG_EINVAL);
- NUTS_FAIL(nng_socket_set_bool(s, NNG_OPT_RECVBUF, false), NNG_EBADTYPE);
+ NUTS_FAIL(
+ nng_socket_set_bool(s, NNG_OPT_RECVBUF, false), NNG_EBADTYPE);
NUTS_FAIL(nng_socket_set(s, NNG_OPT_RECVBUF, &b, 1), NNG_EINVAL);
NUTS_PASS(nng_socket_set_int(s, NNG_OPT_RECVBUF, 100));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_RECVBUF, &v));
diff --git a/src/sp/protocol/pair1/pair1_poly_test.c b/src/sp/protocol/pair1/pair1_poly_test.c
index 3aabb248..895dd935 100644
--- a/src/sp/protocol/pair1/pair1_poly_test.c
+++ b/src/sp/protocol/pair1/pair1_poly_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2017 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -22,7 +22,7 @@ test_poly_identity(void)
{
nng_socket s;
int p;
- char * n;
+ char *n;
NUTS_PASS(nng_pair1_open_poly(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p));
@@ -43,7 +43,7 @@ test_poly_best_effort(void)
{
nng_socket s1;
nng_socket c1;
- nng_msg * msg;
+ nng_msg *msg;
NUTS_PASS(nng_pair1_open_poly(&s1));
NUTS_PASS(nng_pair1_open(&c1));
@@ -70,7 +70,7 @@ test_poly_cooked(void)
nng_socket s1;
nng_socket c1;
nng_socket c2;
- nng_msg * msg;
+ nng_msg *msg;
bool v;
nng_pipe p1;
nng_pipe p2;
@@ -146,7 +146,7 @@ test_poly_default(void)
nng_socket s1;
nng_socket c1;
nng_socket c2;
- nng_msg * msg;
+ nng_msg *msg;
NUTS_PASS(nng_pair1_open_poly(&s1));
NUTS_PASS(nng_pair1_open(&c1));
@@ -211,7 +211,7 @@ test_poly_recv_no_header(void)
{
nng_socket s;
nng_socket c;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_pair1_open_poly(&s));
NUTS_PASS(nng_pair1_open(&c));
@@ -234,7 +234,7 @@ test_poly_recv_garbage(void)
{
nng_socket s;
nng_socket c;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_pair1_open_poly(&s));
NUTS_PASS(nng_pair1_open(&c));
@@ -259,7 +259,7 @@ test_poly_ttl(void)
{
nng_socket s1;
nng_socket c1;
- nng_msg * msg;
+ nng_msg *msg;
uint32_t val;
int ttl;
@@ -327,10 +327,10 @@ test_poly_ttl(void)
void
test_poly_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char * addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
diff --git a/src/sp/protocol/pair1/pair1_test.c b/src/sp/protocol/pair1/pair1_test.c
index 83c96478..ea80d80c 100644
--- a/src/sp/protocol/pair1/pair1_test.c
+++ b/src/sp/protocol/pair1/pair1_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2017 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -22,7 +22,7 @@ test_mono_identity(void)
{
nng_socket s;
int p;
- char * n;
+ char *n;
NUTS_PASS(nng_pair1_open(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p));
@@ -43,7 +43,7 @@ test_mono_cooked(void)
{
nng_socket s1;
nng_socket c1;
- nng_msg * msg;
+ nng_msg *msg;
NUTS_PASS(nng_pair1_open(&s1));
NUTS_PASS(nng_pair1_open(&c1));
@@ -75,7 +75,7 @@ test_mono_faithful(void)
nng_socket s1;
nng_socket c1;
nng_socket c2;
- nng_msg * msg;
+ nng_msg *msg;
const char *addr = "inproc://pair1_mono_faithful";
NUTS_PASS(nng_pair1_open(&s1));
@@ -116,7 +116,7 @@ test_mono_back_pressure(void)
nng_socket c1;
int i;
int rv;
- nng_msg * msg;
+ nng_msg *msg;
nng_duration to = 100;
NUTS_PASS(nng_pair1_open(&s1));
@@ -147,7 +147,7 @@ void
test_send_no_peer(void)
{
nng_socket s1;
- nng_msg * msg;
+ nng_msg *msg;
nng_duration to = 100;
NUTS_PASS(nng_pair1_open(&s1));
@@ -214,7 +214,7 @@ test_mono_raw_header(void)
{
nng_socket s1;
nng_socket c1;
- nng_msg * msg;
+ nng_msg *msg;
uint32_t v;
NUTS_PASS(nng_pair1_open_raw(&s1));
@@ -269,8 +269,8 @@ void
test_pair1_send_closed_aio(void)
{
nng_socket s1;
- nng_aio * aio;
- nng_msg * msg;
+ nng_aio *aio;
+ nng_msg *msg;
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
NUTS_PASS(nng_msg_alloc(&msg, 0));
@@ -309,7 +309,7 @@ test_pair1_ttl(void)
{
nng_socket s1;
nng_socket c1;
- nng_msg * msg;
+ nng_msg *msg;
uint32_t val;
int ttl;
@@ -377,10 +377,10 @@ test_pair1_ttl(void)
void
test_pair1_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char * addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
NUTS_PASS(nng_pair1_open(&s1));
@@ -409,7 +409,7 @@ test_pair1_recv_no_header(void)
{
nng_socket s;
nng_socket c;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_pair1_open(&s));
NUTS_PASS(nng_pair1_open(&c));
@@ -432,7 +432,7 @@ test_pair1_recv_garbage(void)
{
nng_socket s;
nng_socket c;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_pair1_open(&s));
NUTS_PASS(nng_pair1_open(&c));
@@ -479,7 +479,8 @@ test_pair1_send_buffer(void)
NUTS_FAIL(nng_socket_get(s, NNG_OPT_SENDBUF, &b, &sz), NNG_EINVAL);
NUTS_FAIL(nng_socket_set_int(s, NNG_OPT_SENDBUF, -1), NNG_EINVAL);
NUTS_FAIL(nng_socket_set_int(s, NNG_OPT_SENDBUF, 100000), NNG_EINVAL);
- NUTS_FAIL(nng_socket_set_bool(s, NNG_OPT_SENDBUF, false), NNG_EBADTYPE);
+ NUTS_FAIL(
+ nng_socket_set_bool(s, NNG_OPT_SENDBUF, false), NNG_EBADTYPE);
NUTS_FAIL(nng_socket_set(s, NNG_OPT_SENDBUF, &b, 1), NNG_EINVAL);
NUTS_PASS(nng_socket_set_int(s, NNG_OPT_SENDBUF, 100));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_SENDBUF, &v));
@@ -503,7 +504,8 @@ test_pair1_recv_buffer(void)
NUTS_FAIL(nng_socket_get(s, NNG_OPT_RECVBUF, &b, &sz), NNG_EINVAL);
NUTS_FAIL(nng_socket_set_int(s, NNG_OPT_RECVBUF, -1), NNG_EINVAL);
NUTS_FAIL(nng_socket_set_int(s, NNG_OPT_RECVBUF, 100000), NNG_EINVAL);
- NUTS_FAIL(nng_socket_set_bool(s, NNG_OPT_RECVBUF, false), NNG_EBADTYPE);
+ NUTS_FAIL(
+ nng_socket_set_bool(s, NNG_OPT_RECVBUF, false), NNG_EBADTYPE);
NUTS_FAIL(nng_socket_set(s, NNG_OPT_RECVBUF, &b, 1), NNG_EINVAL);
NUTS_PASS(nng_socket_set_int(s, NNG_OPT_RECVBUF, 100));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_RECVBUF, &v));
diff --git a/src/sp/protocol/pipeline0/pull_test.c b/src/sp/protocol/pipeline0/pull_test.c
index 25066093..be11a42d 100644
--- a/src/sp/protocol/pipeline0/pull_test.c
+++ b/src/sp/protocol/pipeline0/pull_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 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
@@ -14,7 +14,7 @@ test_pull_identity(void)
{
nng_socket s;
int p;
- char * n;
+ char *n;
NUTS_PASS(nng_pull0_open(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p));
@@ -104,7 +104,7 @@ test_pull_close_pending(void)
nng_socket pull;
nng_socket push;
nng_pipe p1, p2;
- char * addr;
+ char *addr;
NUTS_ADDR(addr, "inproc");
@@ -136,10 +136,10 @@ test_pull_close_pending(void)
void
test_pull_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char * addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
@@ -168,7 +168,7 @@ static void
test_pull_recv_aio_stopped(void)
{
nng_socket s;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_pull0_open(&s));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -185,7 +185,7 @@ static void
test_pull_close_recv(void)
{
nng_socket s;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_pull0_open(&s));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -202,7 +202,7 @@ static void
test_pull_recv_nonblock(void)
{
nng_socket s;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_pull0_open(&s));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -220,7 +220,7 @@ static void
test_pull_recv_cancel(void)
{
nng_socket s;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_pull0_open(&s));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
diff --git a/src/sp/protocol/pipeline0/push_test.c b/src/sp/protocol/pipeline0/push_test.c
index 9bdd9635..15574732 100644
--- a/src/sp/protocol/pipeline0/push_test.c
+++ b/src/sp/protocol/pipeline0/push_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 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
@@ -14,7 +14,7 @@ test_push_identity(void)
{
nng_socket s;
int p;
- char * n;
+ char *n;
NUTS_PASS(nng_push0_open(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p));
@@ -34,7 +34,7 @@ static void
test_push_cannot_recv(void)
{
nng_socket s;
- nng_msg * m = NULL;
+ nng_msg *m = NULL;
NUTS_PASS(nng_push0_open(&s));
NUTS_FAIL(nng_recvmsg(s, &m, 0), NNG_ENOTSUP);
@@ -210,10 +210,10 @@ test_push_poll_truncate(void)
void
test_push_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char * addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
@@ -242,8 +242,8 @@ static void
test_push_send_aio_stopped(void)
{
nng_socket s;
- nng_aio * aio;
- nng_msg * m;
+ nng_aio *aio;
+ nng_msg *m;
NUTS_PASS(nng_push0_open(&s));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -263,8 +263,8 @@ static void
test_push_close_send(void)
{
nng_socket s;
- nng_aio * aio;
- nng_msg * m;
+ nng_aio *aio;
+ nng_msg *m;
NUTS_PASS(nng_push0_open(&s));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -284,8 +284,8 @@ static void
test_push_send_nonblock(void)
{
nng_socket s;
- nng_aio * aio;
- nng_msg * m;
+ nng_aio *aio;
+ nng_msg *m;
NUTS_PASS(nng_push0_open(&s));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -306,8 +306,8 @@ static void
test_push_send_timeout(void)
{
nng_socket s;
- nng_aio * aio;
- nng_msg * m;
+ nng_aio *aio;
+ nng_msg *m;
NUTS_PASS(nng_push0_open(&s));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -328,8 +328,8 @@ static void
test_push_send_cancel(void)
{
nng_socket s;
- nng_aio * aio;
- nng_msg * m;
+ nng_aio *aio;
+ nng_msg *m;
NUTS_PASS(nng_push0_open(&s));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -352,8 +352,8 @@ test_push_send_late_unbuffered(void)
{
nng_socket s;
nng_socket pull;
- nng_aio * aio;
- nng_msg * m;
+ nng_aio *aio;
+ nng_msg *m;
NUTS_PASS(nng_push0_open(&s));
NUTS_PASS(nng_pull0_open(&pull));
@@ -375,14 +375,13 @@ test_push_send_late_unbuffered(void)
nng_aio_free(aio);
}
-
static void
test_push_send_late_buffered(void)
{
nng_socket s;
nng_socket pull;
- nng_aio * aio;
- nng_msg * m;
+ nng_aio *aio;
+ nng_msg *m;
NUTS_PASS(nng_push0_open(&s));
NUTS_PASS(nng_pull0_open(&pull));
@@ -493,7 +492,8 @@ test_push_send_buffer(void)
NUTS_FAIL(nng_socket_get(s, NNG_OPT_SENDBUF, &b, &sz), NNG_EINVAL);
NUTS_FAIL(nng_socket_set_int(s, NNG_OPT_SENDBUF, -1), NNG_EINVAL);
NUTS_FAIL(nng_socket_set_int(s, NNG_OPT_SENDBUF, 100000), NNG_EINVAL);
- NUTS_FAIL(nng_socket_set_bool(s, NNG_OPT_SENDBUF, false), NNG_EBADTYPE);
+ NUTS_FAIL(
+ nng_socket_set_bool(s, NNG_OPT_SENDBUF, false), NNG_EBADTYPE);
NUTS_FAIL(nng_socket_set(s, NNG_OPT_SENDBUF, &b, 1), NNG_EINVAL);
NUTS_PASS(nng_socket_set_int(s, NNG_OPT_SENDBUF, 100));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_SENDBUF, &v));
diff --git a/src/sp/protocol/pubsub0/pub_test.c b/src/sp/protocol/pubsub0/pub_test.c
index a430b610..462decd2 100644
--- a/src/sp/protocol/pubsub0/pub_test.c
+++ b/src/sp/protocol/pubsub0/pub_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 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
@@ -14,7 +14,7 @@ test_pub_identity(void)
{
nng_socket s;
int p;
- char * n;
+ char *n;
NUTS_PASS(nng_pub0_open(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p));
@@ -103,10 +103,10 @@ test_pub_send_no_pipes(void)
void
test_pub_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char *addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
@@ -166,7 +166,7 @@ test_sub_recv_ctx_closed(void)
{
nng_socket sub;
nng_ctx ctx;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_ctx_open(&ctx, sub));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -183,7 +183,7 @@ test_sub_ctx_recv_aio_stopped(void)
{
nng_socket sub;
nng_ctx ctx;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -203,7 +203,7 @@ test_sub_close_context_recv(void)
{
nng_socket sub;
nng_ctx ctx;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_ctx_open(&ctx, sub));
@@ -223,7 +223,7 @@ test_sub_ctx_recv_nonblock(void)
{
nng_socket sub;
nng_ctx ctx;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_ctx_open(&ctx, sub));
@@ -243,7 +243,7 @@ test_sub_ctx_recv_cancel(void)
{
nng_socket sub;
nng_ctx ctx;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_ctx_open(&ctx, sub));
diff --git a/src/sp/protocol/pubsub0/sub_test.c b/src/sp/protocol/pubsub0/sub_test.c
index b830ae80..a332a0a7 100644
--- a/src/sp/protocol/pubsub0/sub_test.c
+++ b/src/sp/protocol/pubsub0/sub_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 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
@@ -14,7 +14,7 @@ test_sub_identity(void)
{
nng_socket s;
int p;
- char * n;
+ char *n;
NUTS_PASS(nng_sub0_open(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p));
@@ -45,8 +45,8 @@ test_sub_context_cannot_send(void)
{
nng_socket sub;
nng_ctx ctx;
- nng_msg * m;
- nng_aio * aio;
+ nng_msg *m;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_ctx_open(&ctx, sub));
@@ -121,8 +121,8 @@ test_sub_recv_late(void)
int fd;
nng_socket pub;
nng_socket sub;
- nng_aio * aio;
- nng_msg * msg;
+ nng_aio *aio;
+ nng_msg *msg;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_pub0_open(&pub));
@@ -179,10 +179,10 @@ test_sub_context_no_poll(void)
void
test_sub_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char * addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
@@ -212,7 +212,7 @@ test_sub_recv_ctx_closed(void)
{
nng_socket sub;
nng_ctx ctx;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_ctx_open(&ctx, sub));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -229,7 +229,7 @@ test_sub_ctx_recv_aio_stopped(void)
{
nng_socket sub;
nng_ctx ctx;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -249,7 +249,7 @@ test_sub_close_context_recv(void)
{
nng_socket sub;
nng_ctx ctx;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_ctx_open(&ctx, sub));
@@ -269,7 +269,7 @@ test_sub_ctx_recv_nonblock(void)
{
nng_socket sub;
nng_ctx ctx;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_ctx_open(&ctx, sub));
@@ -289,7 +289,7 @@ test_sub_ctx_recv_cancel(void)
{
nng_socket sub;
nng_ctx ctx;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_ctx_open(&ctx, sub));
@@ -413,7 +413,7 @@ test_sub_drop_new(void)
{
nng_socket sub;
nng_socket pub;
- nng_msg * msg;
+ nng_msg *msg;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_pub0_open(&pub));
@@ -439,7 +439,7 @@ test_sub_drop_old(void)
{
nng_socket sub;
nng_socket pub;
- nng_msg * msg;
+ nng_msg *msg;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_pub0_open(&pub));
@@ -485,7 +485,7 @@ test_sub_filter(void)
NUTS_PASS(nng_send(pub, "def", 3, 0));
NUTS_PASS(nng_send(pub, "de", 2, 0)); // will not go through
NUTS_PASS(nng_send(pub, "abc123", 6, 0));
- NUTS_PASS(nng_send(pub, "xzy", 3, 0)); // does not match
+ NUTS_PASS(nng_send(pub, "xzy", 3, 0)); // does not match
NUTS_PASS(nng_send(pub, "ghi-drop", 7, 0)); // dropped by unsub
NUTS_PASS(nng_send(pub, "jkl-mno", 6, 0));
@@ -517,9 +517,9 @@ test_sub_multi_context(void)
nng_socket pub;
nng_ctx c1;
nng_ctx c2;
- nng_aio * aio1;
- nng_aio * aio2;
- nng_msg * m;
+ nng_aio *aio1;
+ nng_aio *aio2;
+ nng_msg *m;
NUTS_PASS(nng_sub0_open(&sub));
NUTS_PASS(nng_pub0_open(&pub));
diff --git a/src/sp/protocol/pubsub0/xsub_test.c b/src/sp/protocol/pubsub0/xsub_test.c
index 19815661..9f2be2be 100644
--- a/src/sp/protocol/pubsub0/xsub_test.c
+++ b/src/sp/protocol/pubsub0/xsub_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 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
@@ -14,7 +14,7 @@ test_xsub_identity(void)
{
nng_socket s;
int p;
- char * n;
+ char *n;
NUTS_PASS(nng_sub0_open_raw(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p));
@@ -93,8 +93,8 @@ test_xsub_recv_late(void)
int fd;
nng_socket pub;
nng_socket sub;
- nng_aio * aio;
- nng_msg * msg;
+ nng_aio *aio;
+ nng_msg *msg;
NUTS_PASS(nng_sub0_open_raw(&sub));
NUTS_PASS(nng_pub0_open(&pub));
@@ -146,10 +146,10 @@ test_xsub_no_context(void)
void
test_xsub_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char * addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
@@ -178,7 +178,7 @@ static void
test_xsub_recv_closed(void)
{
nng_socket sub;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open_raw(&sub));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
NUTS_CLOSE(sub);
@@ -192,7 +192,7 @@ static void
test_xsub_close_recv(void)
{
nng_socket sub;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open_raw(&sub));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -209,7 +209,7 @@ static void
test_xsub_recv_nonblock(void)
{
nng_socket sub;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open_raw(&sub));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -341,7 +341,7 @@ static void
test_xsub_recv_aio_stopped(void)
{
nng_socket sub;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open_raw(&sub));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
diff --git a/src/sp/protocol/reqrep0/rep_test.c b/src/sp/protocol/reqrep0/rep_test.c
index 57da9cac..1a535998 100644
--- a/src/sp/protocol/reqrep0/rep_test.c
+++ b/src/sp/protocol/reqrep0/rep_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 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
@@ -137,10 +137,10 @@ test_rep_context_no_poll(void)
void
test_rep_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat *stats;
- nng_stat *reject;
- char *addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
NUTS_PASS(nng_rep0_open(&s1));
diff --git a/src/sp/protocol/reqrep0/req_test.c b/src/sp/protocol/reqrep0/req_test.c
index c115c8e7..31175cfd 100644
--- a/src/sp/protocol/reqrep0/req_test.c
+++ b/src/sp/protocol/reqrep0/req_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2023 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
@@ -233,7 +233,7 @@ test_req_resend_reconnect(void)
// the retry from loss of our original peer.
NUTS_PASS(nng_socket_set_ms(req, NNG_OPT_REQ_RESENDTIME, 60 * SECOND));
// And make sure the tick runs faster than our timeout!
- NUTS_PASS(nng_socket_set_ms(req, NNG_OPT_REQ_RESENDTICK, SECOND/10));
+ NUTS_PASS(nng_socket_set_ms(req, NNG_OPT_REQ_RESENDTICK, SECOND / 10));
NUTS_MARRY(rep1, req);
@@ -272,7 +272,7 @@ test_req_resend_disconnect(void)
// the retry from loss of our original peer.
NUTS_PASS(nng_socket_set_ms(req, NNG_OPT_REQ_RESENDTIME, 60 * SECOND));
// And make sure the tick runs faster than our timeout!
- NUTS_PASS(nng_socket_set_ms(req, NNG_OPT_REQ_RESENDTICK, SECOND/10));
+ NUTS_PASS(nng_socket_set_ms(req, NNG_OPT_REQ_RESENDTICK, SECOND / 10));
NUTS_MARRY(rep1, req);
NUTS_SEND(req, "ping");
@@ -974,10 +974,10 @@ test_req_ctx_recv_close_socket(void)
static void
test_req_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat *stats;
- nng_stat *reject;
- char *addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
diff --git a/src/sp/protocol/reqrep0/xrep_test.c b/src/sp/protocol/reqrep0/xrep_test.c
index 6f1564eb..cee5952f 100644
--- a/src/sp/protocol/reqrep0/xrep_test.c
+++ b/src/sp/protocol/reqrep0/xrep_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 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
@@ -14,8 +14,8 @@ test_xrep_identity(void)
{
nng_socket s;
int p1, p2;
- char * n1;
- char * n2;
+ char *n1;
+ char *n2;
NUTS_PASS(nng_rep0_open_raw(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p1));
@@ -87,7 +87,7 @@ test_xrep_poll_readable(void)
int fd;
nng_socket req;
nng_socket rep;
- nng_msg * msg;
+ nng_msg *msg;
NUTS_PASS(nng_req0_open(&req));
NUTS_PASS(nng_rep0_open_raw(&rep));
@@ -120,10 +120,10 @@ test_xrep_poll_readable(void)
static void
test_xrep_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char *addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
@@ -154,8 +154,8 @@ test_xrep_close_pipe_before_send(void)
nng_socket rep;
nng_socket req;
nng_pipe p;
- nng_aio * aio1;
- nng_msg * m;
+ nng_aio *aio1;
+ nng_msg *m;
NUTS_PASS(nng_rep0_open_raw(&rep));
NUTS_PASS(nng_req0_open(&req));
@@ -186,7 +186,7 @@ test_xrep_close_pipe_during_send(void)
nng_socket rep;
nng_socket req;
nng_pipe p;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_rep0_open_raw(&rep));
NUTS_PASS(nng_req0_open_raw(&req));
@@ -226,7 +226,7 @@ test_xrep_close_during_recv(void)
{
nng_socket rep;
nng_socket req;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_rep0_open_raw(&rep));
NUTS_PASS(nng_req0_open_raw(&req));
@@ -255,7 +255,7 @@ static void
test_xrep_recv_aio_stopped(void)
{
nng_socket rep;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_rep0_open_raw(&rep));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -273,7 +273,7 @@ test_xrep_send_no_header(void)
{
nng_socket rep;
nng_socket req;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_req0_open_raw(&req));
NUTS_PASS(nng_rep0_open_raw(&rep));
@@ -297,7 +297,7 @@ test_xrep_recv_garbage(void)
{
nng_socket rep;
nng_socket req;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_rep0_open_raw(&rep));
NUTS_PASS(nng_req0_open_raw(&req));
@@ -355,7 +355,7 @@ test_xrep_ttl_drop(void)
{
nng_socket rep;
nng_socket req;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_rep0_open_raw(&rep));
NUTS_PASS(nng_req0_open_raw(&req));
diff --git a/src/sp/protocol/reqrep0/xreq_test.c b/src/sp/protocol/reqrep0/xreq_test.c
index 8c850cba..c2d6c9ed 100644
--- a/src/sp/protocol/reqrep0/xreq_test.c
+++ b/src/sp/protocol/reqrep0/xreq_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 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
@@ -14,8 +14,8 @@ test_xreq_identity(void)
{
nng_socket s;
int p1, p2;
- char * n1;
- char * n2;
+ char *n1;
+ char *n2;
NUTS_PASS(nng_req0_open_raw(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p1));
@@ -84,7 +84,7 @@ test_xreq_poll_readable(void)
int fd;
nng_socket req;
nng_socket rep;
- nng_msg * msg;
+ nng_msg *msg;
NUTS_PASS(nng_req0_open_raw(&req));
NUTS_PASS(nng_rep0_open(&rep));
@@ -129,10 +129,10 @@ test_xreq_poll_readable(void)
static void
test_xreq_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char * addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
@@ -161,7 +161,7 @@ static void
test_xreq_recv_aio_stopped(void)
{
nng_socket req;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_req0_open_raw(&req));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -179,7 +179,7 @@ test_xreq_recv_garbage(void)
{
nng_socket rep;
nng_socket req;
- nng_msg * m;
+ nng_msg *m;
uint32_t req_id;
NUTS_PASS(nng_rep0_open_raw(&rep));
@@ -216,7 +216,7 @@ test_xreq_recv_header(void)
{
nng_socket rep;
nng_socket req;
- nng_msg * m;
+ nng_msg *m;
nng_pipe p1, p2;
uint32_t id;
@@ -258,7 +258,7 @@ test_xreq_close_during_recv(void)
{
nng_socket rep;
nng_socket req;
- nng_msg * m;
+ nng_msg *m;
nng_pipe p1;
nng_pipe p2;
@@ -289,7 +289,7 @@ test_xreq_close_pipe_during_send(void)
{
nng_socket rep;
nng_socket req;
- nng_msg * m;
+ nng_msg *m;
nng_pipe p1;
nng_pipe p2;
diff --git a/src/sp/protocol/survey0/respond_test.c b/src/sp/protocol/survey0/respond_test.c
index 15762f05..92e9bf81 100644
--- a/src/sp/protocol/survey0/respond_test.c
+++ b/src/sp/protocol/survey0/respond_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 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
@@ -14,7 +14,7 @@ test_resp_identity(void)
{
nng_socket s;
int p;
- char * n;
+ char *n;
NUTS_PASS(nng_respondent0_open(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p));
@@ -34,7 +34,7 @@ void
test_resp_send_bad_state(void)
{
nng_socket resp;
- nng_msg * msg = NULL;
+ nng_msg *msg = NULL;
NUTS_PASS(nng_respondent0_open(&resp));
NUTS_PASS(nng_msg_alloc(&msg, 0));
@@ -85,7 +85,7 @@ test_resp_poll_readable(void)
int fd;
nng_socket surv;
nng_socket resp;
- nng_msg * msg;
+ nng_msg *msg;
NUTS_PASS(nng_surveyor0_open(&surv));
NUTS_PASS(nng_respondent0_open(&resp));
@@ -135,10 +135,10 @@ test_resp_context_no_poll(void)
void
test_resp_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char * addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
@@ -167,8 +167,8 @@ void
test_resp_double_recv(void)
{
nng_socket s1;
- nng_aio * aio1;
- nng_aio * aio2;
+ nng_aio *aio1;
+ nng_aio *aio2;
NUTS_PASS(nng_respondent0_open(&s1));
NUTS_PASS(nng_aio_alloc(&aio1, NULL, NULL));
@@ -191,8 +191,8 @@ test_resp_close_pipe_before_send(void)
nng_socket resp;
nng_socket surv;
nng_pipe p;
- nng_aio * aio1;
- nng_msg * m;
+ nng_aio *aio1;
+ nng_msg *m;
NUTS_PASS(nng_respondent0_open(&resp));
NUTS_PASS(nng_surveyor0_open(&surv));
@@ -223,7 +223,7 @@ test_resp_close_pipe_during_send(void)
nng_socket resp;
nng_socket surv;
nng_pipe p = NNG_PIPE_INITIALIZER;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_respondent0_open(&resp));
NUTS_PASS(nng_surveyor0_open_raw(&surv));
@@ -263,7 +263,7 @@ test_resp_ctx_recv_aio_stopped(void)
{
nng_socket resp;
nng_ctx ctx;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_respondent0_open(&resp));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -284,9 +284,9 @@ test_resp_close_pipe_context_send(void)
nng_socket resp;
nng_socket surv;
nng_pipe p = NNG_PIPE_INITIALIZER;
- nng_msg * m;
+ nng_msg *m;
nng_ctx ctx[10];
- nng_aio * aio[10];
+ nng_aio *aio[10];
int i;
NUTS_PASS(nng_respondent0_open(&resp));
@@ -343,9 +343,9 @@ test_resp_close_context_send(void)
{
nng_socket resp;
nng_socket surv;
- nng_msg * m;
+ nng_msg *m;
nng_ctx ctx[10];
- nng_aio * aio[10];
+ nng_aio *aio[10];
int i;
NUTS_PASS(nng_respondent0_open(&resp));
@@ -399,7 +399,7 @@ test_resp_ctx_recv_nonblock(void)
{
nng_socket resp;
nng_ctx ctx;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_respondent0_open(&resp));
NUTS_PASS(nng_ctx_open(&ctx, resp));
@@ -420,8 +420,8 @@ test_resp_ctx_send_nonblock(void)
nng_socket resp;
nng_socket surv;
nng_ctx ctx;
- nng_aio * aio;
- nng_msg * msg;
+ nng_aio *aio;
+ nng_msg *msg;
NUTS_PASS(nng_surveyor0_open(&surv));
NUTS_PASS(nng_respondent0_open(&resp));
@@ -455,7 +455,7 @@ test_resp_recv_garbage(void)
{
nng_socket resp;
nng_socket surv;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_respondent0_open(&resp));
NUTS_PASS(nng_surveyor0_open_raw(&surv));
@@ -513,7 +513,7 @@ test_resp_ttl_drop(void)
{
nng_socket resp;
nng_socket surv;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_respondent0_open(&resp));
NUTS_PASS(nng_surveyor0_open_raw(&surv));
diff --git a/src/sp/protocol/survey0/survey_test.c b/src/sp/protocol/survey0/survey_test.c
index 94a7922a..c5f699da 100644
--- a/src/sp/protocol/survey0/survey_test.c
+++ b/src/sp/protocol/survey0/survey_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2021 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
@@ -600,10 +600,10 @@ test_surv_context_multi(void)
static void
test_surv_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat *stats;
- nng_stat *reject;
- char *addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
NUTS_PASS(nng_surveyor0_open(&s1));
diff --git a/src/sp/protocol/survey0/xrespond_test.c b/src/sp/protocol/survey0/xrespond_test.c
index ec5e99a3..b8d29b9a 100644
--- a/src/sp/protocol/survey0/xrespond_test.c
+++ b/src/sp/protocol/survey0/xrespond_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 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
@@ -14,8 +14,8 @@ test_xresp_identity(void)
{
nng_socket s;
int p1, p2;
- char * n1;
- char * n2;
+ char *n1;
+ char *n2;
NUTS_PASS(nng_respondent0_open_raw(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p1));
@@ -87,7 +87,7 @@ test_xresp_poll_readable(void)
int fd;
nng_socket surv;
nng_socket resp;
- nng_msg * msg;
+ nng_msg *msg;
NUTS_PASS(nng_surveyor0_open(&surv));
NUTS_PASS(nng_respondent0_open_raw(&resp));
@@ -120,10 +120,10 @@ test_xresp_poll_readable(void)
static void
test_xresp_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char * addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
@@ -154,8 +154,8 @@ test_xresp_close_pipe_before_send(void)
nng_socket resp;
nng_socket surv;
nng_pipe p;
- nng_aio * aio1;
- nng_msg * m;
+ nng_aio *aio1;
+ nng_msg *m;
NUTS_PASS(nng_respondent0_open_raw(&resp));
NUTS_PASS(nng_surveyor0_open(&surv));
@@ -186,7 +186,7 @@ test_xresp_close_pipe_during_send(void)
nng_socket resp;
nng_socket surv;
nng_pipe p;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_respondent_open_raw(&resp));
NUTS_PASS(nng_surveyor0_open_raw(&surv));
@@ -226,7 +226,7 @@ test_xresp_close_during_recv(void)
{
nng_socket resp;
nng_socket surv;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_respondent0_open_raw(&resp));
NUTS_PASS(nng_surveyor0_open_raw(&surv));
@@ -255,7 +255,7 @@ static void
test_xresp_recv_aio_stopped(void)
{
nng_socket resp;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_respondent0_open_raw(&resp));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -273,7 +273,7 @@ test_xresp_send_no_header(void)
{
nng_socket resp;
nng_socket surv;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_surveyor0_open_raw(&surv));
NUTS_PASS(nng_respondent0_open_raw(&resp));
@@ -297,7 +297,7 @@ test_xresp_recv_garbage(void)
{
nng_socket resp;
nng_socket surv;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_respondent0_open_raw(&resp));
NUTS_PASS(nng_surveyor0_open_raw(&surv));
@@ -355,7 +355,7 @@ test_xresp_ttl_drop(void)
{
nng_socket resp;
nng_socket surv;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_respondent0_open_raw(&resp));
NUTS_PASS(nng_surveyor0_open_raw(&surv));
diff --git a/src/sp/protocol/survey0/xsurvey_test.c b/src/sp/protocol/survey0/xsurvey_test.c
index f8e9d401..3b874afe 100644
--- a/src/sp/protocol/survey0/xsurvey_test.c
+++ b/src/sp/protocol/survey0/xsurvey_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 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
@@ -14,7 +14,7 @@ test_xsurveyor_identity(void)
{
nng_socket s;
int p;
- char * n;
+ char *n;
NUTS_PASS(nng_surveyor0_open_raw(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p));
@@ -83,7 +83,7 @@ test_xsurvey_poll_readable(void)
int fd;
nng_socket surv;
nng_socket resp;
- nng_msg * msg;
+ nng_msg *msg;
NUTS_PASS(nng_surveyor0_open_raw(&surv));
NUTS_PASS(nng_respondent0_open(&resp));
@@ -114,7 +114,7 @@ test_xsurvey_poll_readable(void)
NUTS_SLEEP(100);
- NUTS_TRUE(nuts_poll_fd(fd) );
+ NUTS_TRUE(nuts_poll_fd(fd));
// and receiving makes it no longer ready
NUTS_PASS(nng_recvmsg(surv, &msg, 0));
@@ -128,10 +128,10 @@ test_xsurvey_poll_readable(void)
static void
test_xsurvey_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char *addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
@@ -160,7 +160,7 @@ static void
test_xsurvey_recv_aio_stopped(void)
{
nng_socket surv;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_surveyor0_open_raw(&surv));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -178,7 +178,7 @@ test_xsurvey_recv_garbage(void)
{
nng_socket resp;
nng_socket surv;
- nng_msg * m;
+ nng_msg *m;
uint32_t req_id;
NUTS_PASS(nng_respondent0_open_raw(&resp));
@@ -215,7 +215,7 @@ test_xsurvey_recv_header(void)
{
nng_socket resp;
nng_socket surv;
- nng_msg * m;
+ nng_msg *m;
nng_pipe p;
uint32_t id;
@@ -257,7 +257,7 @@ test_xsurvey_close_during_recv(void)
{
nng_socket resp;
nng_socket surv;
- nng_msg * m;
+ nng_msg *m;
nng_pipe p1;
nng_pipe p2;
@@ -288,7 +288,7 @@ test_xsurvey_close_pipe_during_send(void)
{
nng_socket resp;
nng_socket surv;
- nng_msg * m;
+ nng_msg *m;
nng_pipe p1;
nng_pipe p2;
@@ -340,11 +340,11 @@ test_xsurvey_ttl_option(void)
NUTS_TRUE(v == 3);
NUTS_TRUE(sz == sizeof(v));
- NUTS_FAIL(nng_socket_set(s, opt, "", 1) , NNG_EINVAL);
+ NUTS_FAIL(nng_socket_set(s, opt, "", 1), NNG_EINVAL);
sz = 1;
- NUTS_FAIL(nng_socket_get(s, opt, &v, &sz) , NNG_EINVAL);
- NUTS_FAIL(nng_socket_set_bool(s, opt, true) , NNG_EBADTYPE);
- NUTS_FAIL(nng_socket_get_bool(s, opt, &b) , NNG_EBADTYPE);
+ NUTS_FAIL(nng_socket_get(s, opt, &v, &sz), NNG_EINVAL);
+ NUTS_FAIL(nng_socket_set_bool(s, opt, true), NNG_EBADTYPE);
+ NUTS_FAIL(nng_socket_get_bool(s, opt, &b), NNG_EBADTYPE);
NUTS_CLOSE(s);
}
@@ -355,7 +355,7 @@ test_xsurvey_broadcast(void)
nng_socket resp1;
nng_socket resp2;
nng_socket surv;
- nng_msg * m;
+ nng_msg *m;
NUTS_PASS(nng_respondent0_open(&resp1));
NUTS_PASS(nng_respondent0_open(&resp2));