aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/migrating/nng1.md6
-rw-r--r--docs/ref/api/stats.md28
-rw-r--r--include/nng/nng.h31
-rw-r--r--src/core/list.h7
-rw-r--r--src/core/stats.c62
-rw-r--r--src/core/stats_test.c24
-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
23 files changed, 317 insertions, 305 deletions
diff --git a/docs/migrating/nng1.md b/docs/migrating/nng1.md
index b0afb888..9da86d48 100644
--- a/docs/migrating/nng1.md
+++ b/docs/migrating/nng1.md
@@ -48,3 +48,9 @@ options must be set on the endpoint (dialer or listener) using the appropriate
`nng_dialer_set` or `nng_listener_set` option. This likely means that it is necessary
to allocate and configure the endpoint before attaching it to the socket. This will
also afford a much more fine-grained level of control over transport options.
+
+## Statistics Use Constified Pointers
+
+A number of the statistics functions take, or return, `const nng_stat *` instead
+of plain `nng_stat *`. The ABI has not changed, but it may be necessary to declare
+certain methods variables `const` to avoid warnings about misuse of `const`.
diff --git a/docs/ref/api/stats.md b/docs/ref/api/stats.md
index d2505a57..47d65491 100644
--- a/docs/ref/api/stats.md
+++ b/docs/ref/api/stats.md
@@ -54,8 +54,8 @@ The {{i:`nng_stats_free`}} function deallocates the snapshot referenced by _stat
## Traversing the Tree
```c
-nng_stat *nng_stat_child(nng_stat *stat);
-nng_stat *nng_stat_next(nng_stat *stat);
+const nng_stat *nng_stat_child(const nng_stat *stat);
+const nng_stat *nng_stat_next(const nng_stat *stat);
```
Traversing the tree of statistics is done using the {{i:`nng_stat_child`}} and
@@ -70,10 +70,10 @@ or `NULL` if _stat_ has no more siblings to the right.
## Finding a Statistic
```c
-nng_stat *nng_stat_find(nng_stat *stat, const char *name);
-nng_stat *nng_stat_find_dialer(nng_stat *stat, nng_dialer dialer);
-nng_stat *nng_stat_find_listener(nng_stat *stat, nng_dialer listener);
-nng_stat *nng_stat_find_socket(nng_stat *stat, nng_dialer socket);
+const nng_stat *nng_stat_find(const nng_stat *stat, const char *name);
+const nng_stat *nng_stat_find_dialer(const nng_stat *stat, nng_dialer dialer);
+const nng_stat *nng_stat_find_listener(const nng_stat *stat, nng_dialer listener);
+const nng_stat *nng_stat_find_socket(const nng_stat *stat, nng_dialer socket);
```
Sometimes it is easiest to search for a specific statistic, matching by name,
@@ -95,8 +95,8 @@ that they can find the desired object.
## Statistic Identification
```c
-const char *nng_stat_name(nng_stat *stat);
-const char *nng_stat_desc(nng_stat *stat);
+const char *nng_stat_name(const nng_stat *stat);
+const char *nng_stat_desc(const nng_stat *stat);
```
Every statistic has a name, returned by {{i:`nng_stat_name`}}, and a description, returned by
@@ -105,7 +105,7 @@ Every statistic has a name, returned by {{i:`nng_stat_name`}}, and a description
## Statistic Type
```c
-int nng_stat_type(nng_stat *stat);
+int nng_stat_type(const nng_stat *stat);
```
The function {{i:`nng_stat_type`}} returns the type of the statistic.
@@ -151,9 +151,9 @@ function can be used to obtain that value.
## Statistic Value
```c
-uint64_t nng_stat_value(nng_stat *stat);
-const char *nng_stat_string(nng_stat *stat);
-bool nng_stat_bool(nng_stat *stat);
+uint64_t nng_stat_value(const nng_stat *stat);
+const char *nng_stat_string(const nng_stat *stat);
+bool nng_stat_bool(const nng_stat *stat);
```
These functions return the value associated with the statistic.
@@ -173,7 +173,7 @@ is not of type `NNG_STAT_STRING`, then `NULL` is returned.
## Statistic Units
```c
-int nng_stat_unit(nng_stat *stat);
+int nng_stat_unit(const nng_stat *stat);
```
For statistics of type [`NNG_STAT_COUNTER`][NNG_STAT_COUNTER] or [`NNG_STAT_LEVEL`][NNG_STAT_LEVEL],
@@ -189,7 +189,7 @@ The following units may be returned from {{i:`nng_stat_unit`}} for such a statis
## Statistic Timestamp
```c
-uint64_t nng_stat_timestamp(nng_stat *stat);
+uint64_t nng_stat_timestamp(const nng_stat *stat);
```
Statistics have a timestamp indicating when the value was sampled,
diff --git a/include/nng/nng.h b/include/nng/nng.h
index f41afb8e..a637723c 100644
--- a/include/nng/nng.h
+++ b/include/nng/nng.h
@@ -966,41 +966,42 @@ NNG_DECL void nng_stats_free(nng_stat *);
// nng_stats_dump is a debugging function that dumps the entire set of
// statistics to stdout.
-NNG_DECL void nng_stats_dump(nng_stat *);
+NNG_DECL void nng_stats_dump(const nng_stat *);
// nng_stat_next finds the next sibling for the current stat. If there
// are no more siblings, it returns NULL.
-NNG_DECL nng_stat *nng_stat_next(nng_stat *);
+NNG_DECL const nng_stat *nng_stat_next(const nng_stat *);
// nng_stat_child finds the first child of the current stat. If no children
// exist, then NULL is returned.
-NNG_DECL nng_stat *nng_stat_child(nng_stat *);
+NNG_DECL const nng_stat *nng_stat_child(const nng_stat *);
// nng_stat_name is used to determine the name of the statistic.
// This is a human-readable name. Statistic names, as well as the presence
// or absence or semantic of any particular statistic are not part of any
// stable API, and may be changed without notice in future updates.
-NNG_DECL const char *nng_stat_name(nng_stat *);
+NNG_DECL const char *nng_stat_name(const nng_stat *);
// nng_stat_type is used to determine the type of the statistic.
// Counters generally increment, and therefore changes in the value over
// time are likely more interesting than the actual level. Level
// values reflect some absolute state however, and should be presented to the
// user as is.
-NNG_DECL int nng_stat_type(nng_stat *);
+NNG_DECL int nng_stat_type(const nng_stat *);
// nng_stat_find is used to find a specific named statistic within
// a statistic tree. NULL is returned if no such statistic exists.
-NNG_DECL nng_stat *nng_stat_find(nng_stat *, const char *);
+NNG_DECL const nng_stat *nng_stat_find(const nng_stat *, const char *);
// nng_stat_find_socket is used to find the stats for the given socket.
-NNG_DECL nng_stat *nng_stat_find_socket(nng_stat *, nng_socket);
+NNG_DECL const nng_stat *nng_stat_find_socket(const nng_stat *, nng_socket);
// nng_stat_find_dialer is used to find the stats for the given dialer.
-NNG_DECL nng_stat *nng_stat_find_dialer(nng_stat *, nng_dialer);
+NNG_DECL const nng_stat *nng_stat_find_dialer(const nng_stat *, nng_dialer);
// nng_stat_find_listener is used to find the stats for the given listener.
-NNG_DECL nng_stat *nng_stat_find_listener(nng_stat *, nng_listener);
+NNG_DECL const nng_stat *nng_stat_find_listener(
+ const nng_stat *, nng_listener);
enum nng_stat_type_enum {
NNG_STAT_SCOPE = 0, // Stat is for scoping, and carries no value
@@ -1014,7 +1015,7 @@ enum nng_stat_type_enum {
// nng_stat_unit provides information about the unit for the statistic,
// such as NNG_UNIT_BYTES or NNG_UNIT_BYTES. If no specific unit is
// applicable, such as a relative priority, then NN_UNIT_NONE is returned.
-NNG_DECL int nng_stat_unit(nng_stat *);
+NNG_DECL int nng_stat_unit(const nng_stat *);
enum nng_unit_enum {
NNG_UNIT_NONE = 0, // No special units
@@ -1027,24 +1028,24 @@ enum nng_unit_enum {
// nng_stat_value returns the actual value of the statistic.
// Statistic values reflect their value at the time that the corresponding
// snapshot was updated, and are undefined until an update is performed.
-NNG_DECL uint64_t nng_stat_value(nng_stat *);
+NNG_DECL uint64_t nng_stat_value(const nng_stat *);
// nng_stat_bool returns the boolean value of the statistic.
-NNG_DECL bool nng_stat_bool(nng_stat *);
+NNG_DECL bool nng_stat_bool(const nng_stat *);
// nng_stat_string returns the string associated with a string statistic,
// or NULL if the statistic is not part of the string. The value returned
// is valid until the associated statistic is freed.
-NNG_DECL const char *nng_stat_string(nng_stat *);
+NNG_DECL const char *nng_stat_string(const nng_stat *);
// nng_stat_desc returns a human-readable description of the statistic.
// This may be useful for display in diagnostic interfaces, etc.
-NNG_DECL const char *nng_stat_desc(nng_stat *);
+NNG_DECL const char *nng_stat_desc(const nng_stat *);
// nng_stat_timestamp returns a timestamp (milliseconds) when the statistic
// was captured. The base offset is the same as used by nng_clock().
// We don't use nng_time though, because that's in the supplemental header.
-NNG_DECL uint64_t nng_stat_timestamp(nng_stat *);
+NNG_DECL uint64_t nng_stat_timestamp(const nng_stat *);
// Device functionality. This connects two sockets together in a device,
// which means that messages from one side are forwarded to the other.
diff --git a/src/core/list.h b/src/core/list.h
index d3c703bb..28720564 100644
--- a/src/core/list.h
+++ b/src/core/list.h
@@ -1,5 +1,5 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
+// Copyright 2024 Garrett D'Amore <garrett@damore.org>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -58,7 +58,8 @@ extern int nni_list_empty(nni_list *);
extern int nni_list_node_active(nni_list_node *);
extern void nni_list_node_remove(nni_list_node *);
-#define NNI_LIST_FOREACH(l, it) \
- for (it = nni_list_first(l); it != NULL; it = nni_list_next(l, it))
+#define NNI_LIST_FOREACH(l, it) \
+ for (it = nni_list_first(l); it != NULL; \
+ it = nni_list_next(l, (void *) it))
#endif // CORE_LIST_H
diff --git a/src/core/stats.c b/src/core/stats.c
index 5fa9ca41..c049d611 100644
--- a/src/core/stats.c
+++ b/src/core/stats.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
@@ -396,28 +396,28 @@ nng_stats_get(nng_stat **statp)
#endif
}
-nng_stat *
-nng_stat_parent(nng_stat *stat)
+const nng_stat *
+nng_stat_parent(const nng_stat *stat)
{
return (stat->s_parent);
}
-nng_stat *
-nng_stat_next(nng_stat *stat)
+const nng_stat *
+nng_stat_next(const nng_stat *stat)
{
#if NNG_ENABLE_STATS
if (stat->s_parent == NULL) {
return (NULL); // Root node, no siblings.
}
- return (nni_list_next(&stat->s_parent->s_children, stat));
+ return (nni_list_next(&stat->s_parent->s_children, (void *) stat));
#else
NNI_ARG_UNUSED(stat);
return (NULL);
#endif
}
-nng_stat *
-nng_stat_child(nng_stat *stat)
+const nng_stat *
+nng_stat_child(const nng_stat *stat)
{
#if NNG_ENABLE_STATS
return (nni_list_first(&stat->s_children));
@@ -428,7 +428,7 @@ nng_stat_child(nng_stat *stat)
}
const char *
-nng_stat_name(nni_stat *stat)
+nng_stat_name(const nng_stat *stat)
{
#if NNG_ENABLE_STATS
return (stat->s_info->si_name);
@@ -439,7 +439,7 @@ nng_stat_name(nni_stat *stat)
}
uint64_t
-nng_stat_value(nni_stat *stat)
+nng_stat_value(const nng_stat *stat)
{
#if NNG_ENABLE_STATS
return (stat->s_val.sv_value);
@@ -450,7 +450,7 @@ nng_stat_value(nni_stat *stat)
}
bool
-nng_stat_bool(nni_stat *stat)
+nng_stat_bool(const nng_stat *stat)
{
#if NNG_ENABLE_STATS
return (stat->s_val.sv_bool);
@@ -461,7 +461,7 @@ nng_stat_bool(nni_stat *stat)
}
const char *
-nng_stat_string(nng_stat *stat)
+nng_stat_string(const nng_stat *stat)
{
#if NNG_ENABLE_STATS
if (stat->s_info->si_type != NNG_STAT_STRING) {
@@ -475,7 +475,7 @@ nng_stat_string(nng_stat *stat)
}
uint64_t
-nng_stat_timestamp(nng_stat *stat)
+nng_stat_timestamp(const nng_stat *stat)
{
#if NNG_ENABLE_STATS
return ((uint64_t) stat->s_timestamp);
@@ -486,7 +486,7 @@ nng_stat_timestamp(nng_stat *stat)
}
int
-nng_stat_type(nng_stat *stat)
+nng_stat_type(const nng_stat *stat)
{
#if NNG_ENABLE_STATS
return (stat->s_info->si_type);
@@ -497,7 +497,7 @@ nng_stat_type(nng_stat *stat)
}
int
-nng_stat_unit(nng_stat *stat)
+nng_stat_unit(const nng_stat *stat)
{
#if NNG_ENABLE_STATS
return (stat->s_info->si_unit);
@@ -508,7 +508,7 @@ nng_stat_unit(nng_stat *stat)
}
const char *
-nng_stat_desc(nng_stat *stat)
+nng_stat_desc(const nng_stat *stat)
{
#if NNG_ENABLE_STATS
return (stat->s_info->si_desc);
@@ -518,11 +518,11 @@ nng_stat_desc(nng_stat *stat)
#endif
}
-nng_stat *
-nng_stat_find(nng_stat *stat, const char *name)
+const nng_stat *
+nng_stat_find(const nng_stat *stat, const char *name)
{
#if NNG_ENABLE_STATS
- nng_stat *child;
+ const nng_stat *child;
if (stat == NULL) {
return (NULL);
}
@@ -530,7 +530,7 @@ nng_stat_find(nng_stat *stat, const char *name)
return (stat);
}
NNI_LIST_FOREACH (&stat->s_children, child) {
- nng_stat *result;
+ const nng_stat *result;
if ((result = nng_stat_find(child, name)) != NULL) {
return (result);
}
@@ -542,8 +542,8 @@ nng_stat_find(nng_stat *stat, const char *name)
return (NULL);
}
-nng_stat *
-nng_stat_find_scope(nng_stat *stat, const char *name, int id)
+const nng_stat *
+nng_stat_find_scope(const nng_stat *stat, const char *name, int id)
{
#if NNG_ENABLE_STATS
nng_stat *child;
@@ -556,7 +556,7 @@ nng_stat_find_scope(nng_stat *stat, const char *name, int id)
return (stat);
}
NNI_LIST_FOREACH (&stat->s_children, child) {
- nng_stat *result;
+ const nng_stat *result;
if ((result = nng_stat_find_scope(child, name, id)) != NULL) {
return (result);
}
@@ -569,27 +569,27 @@ nng_stat_find_scope(nng_stat *stat, const char *name, int id)
return (NULL);
}
-nng_stat *
-nng_stat_find_socket(nng_stat *stat, nng_socket s)
+const nng_stat *
+nng_stat_find_socket(const nng_stat *stat, nng_socket s)
{
return (nng_stat_find_scope(stat, "socket", nng_socket_id(s)));
}
-nng_stat *
-nng_stat_find_dialer(nng_stat *stat, nng_dialer d)
+const nng_stat *
+nng_stat_find_dialer(const nng_stat *stat, nng_dialer d)
{
return (nng_stat_find_scope(stat, "dialer", nng_dialer_id(d)));
}
-nng_stat *
-nng_stat_find_listener(nng_stat *stat, nng_listener l)
+const nng_stat *
+nng_stat_find_listener(const nng_stat *stat, nng_listener l)
{
return (nng_stat_find_scope(stat, "listener", nng_listener_id(l)));
}
#ifdef NNG_ENABLE_STATS
void
-stat_sprint_scope(nni_stat *stat, char **scope, int *lenp)
+stat_sprint_scope(const nni_stat *stat, char **scope, int *lenp)
{
if (stat->s_parent != NULL) {
stat_sprint_scope(stat->s_parent, scope, lenp);
@@ -606,7 +606,7 @@ stat_sprint_scope(nni_stat *stat, char **scope, int *lenp)
#endif
void
-nng_stats_dump(nng_stat *stat)
+nng_stats_dump(const nng_stat *stat)
{
#ifdef NNG_ENABLE_STATS
static char buf[128]; // to minimize recursion, not thread safe
diff --git a/src/core/stats_test.c b/src/core/stats_test.c
index ba4198ab..e15b4001 100644
--- a/src/core/stats_test.c
+++ b/src/core/stats_test.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
@@ -16,12 +16,12 @@ void
test_stats_socket(void)
{
#ifdef NNG_ENABLE_STATS
- nng_socket s1;
- nng_socket s2;
- nng_stat *st1;
- nng_stat *st2;
- nng_stat *item;
- nng_stat *stats;
+ nng_socket s1;
+ nng_socket s2;
+ const nng_stat *st1;
+ const nng_stat *st2;
+ const nng_stat *item;
+ nng_stat *stats;
NUTS_OPEN(s1);
NUTS_OPEN(s2);
@@ -63,11 +63,11 @@ void
test_stats_dump(void)
{
#ifdef NNG_ENABLE_STATS
- nng_socket s1;
- nng_socket s2;
- nng_stat *st1;
- nng_stat *st2;
- nng_stat *stats;
+ nng_socket s1;
+ nng_socket s2;
+ const nng_stat *st1;
+ const nng_stat *st2;
+ nng_stat *stats;
NUTS_OPEN(s1);
NUTS_OPEN(s2);
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));