aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/aio.c11
-rw-r--r--tests/base64.c4
-rw-r--r--tests/bufsz.c18
-rw-r--r--tests/bus.c13
-rw-r--r--tests/compat_block.c4
-rw-r--r--tests/compat_bug777.c4
-rw-r--r--tests/compat_bus.c4
-rw-r--r--tests/compat_cmsg.c6
-rw-r--r--tests/compat_device.c10
-rw-r--r--tests/compat_iovec.c4
-rw-r--r--tests/compat_msg.c4
-rw-r--r--tests/compat_options.c7
-rw-r--r--tests/compat_pair.c4
-rw-r--r--tests/compat_pipeline.c4
-rw-r--r--tests/compat_poll.c6
-rw-r--r--tests/compat_reqrep.c4
-rw-r--r--tests/compat_reqttl.c6
-rw-r--r--tests/compat_shutdown.c6
-rw-r--r--tests/compat_survey.c4
-rw-r--r--tests/compat_surveyttl.c6
-rw-r--r--tests/compat_tcp.c8
-rw-r--r--tests/compat_testutil.c2
-rw-r--r--tests/compat_ws.c6
-rw-r--r--tests/cplusplus_pair.cc4
-rw-r--r--tests/device.c11
-rw-r--r--tests/errors.c8
-rw-r--r--tests/httpclient.c15
-rw-r--r--tests/httpserver.c11
-rw-r--r--tests/idhash.c4
-rw-r--r--tests/inproc.c3
-rw-r--r--tests/ipc.c8
-rw-r--r--tests/ipcperms.c21
-rw-r--r--tests/ipcwinsec.c14
-rw-r--r--tests/message.c6
-rw-r--r--tests/multistress.c37
-rw-r--r--tests/nonblock.c18
-rw-r--r--tests/options.c7
-rw-r--r--tests/pair1.c13
-rw-r--r--tests/pipe.c15
-rw-r--r--tests/pipeline.c13
-rw-r--r--tests/platform.c7
-rw-r--r--tests/pollfd.c12
-rw-r--r--tests/pubsub.c13
-rw-r--r--tests/reconnect.c13
-rw-r--r--tests/reqctx.c13
-rw-r--r--tests/reqpoll.c10
-rw-r--r--tests/reqrep.c14
-rw-r--r--tests/reqstress.c21
-rw-r--r--tests/resolv.c4
-rw-r--r--tests/respondpoll.c10
-rw-r--r--tests/scalability.c14
-rw-r--r--tests/sha1.c10
-rw-r--r--tests/sock.c17
-rw-r--r--tests/stats.c17
-rw-r--r--tests/survey.c14
-rw-r--r--tests/surveyctx.c13
-rw-r--r--tests/surveypoll.c10
-rw-r--r--tests/synch.c6
-rw-r--r--tests/tcp.c15
-rw-r--r--tests/tcp6.c10
-rw-r--r--tests/tls.c22
-rw-r--r--tests/transport.c11
-rw-r--r--tests/trantest.h16
-rw-r--r--tests/udp.c8
-rw-r--r--tests/url.c6
-rw-r--r--tests/ws.c18
-rw-r--r--tests/wss.c20
-rw-r--r--tests/wssfile.c21
-rw-r--r--tests/zt.c8
69 files changed, 357 insertions, 369 deletions
diff --git a/tests/aio.c b/tests/aio.c
index 0efc013a..9bb7de19 100644
--- a/tests/aio.c
+++ b/tests/aio.c
@@ -8,16 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
+#include <string.h>
-#include "protocol/pair1/pair.h"
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/supplemental/util/platform.h>
+#include "convey.h"
#include "stubs.h"
-#include <string.h>
-
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
So(nng_msg_len(m) == strlen(s)); \
diff --git a/tests/base64.c b/tests/base64.c
index 6641928a..1781c5ef 100644
--- a/tests/base64.c
+++ b/tests/base64.c
@@ -9,11 +9,9 @@
//
#include <string.h>
+#include <nng/nng.h>
#include "convey.h"
-
-#include "nng.h"
-
#include "supplemental/base64/base64.h"
typedef struct testcase {
diff --git a/tests/bufsz.c b/tests/bufsz.c
index b7128ed4..da6a14cb 100644
--- a/tests/bufsz.c
+++ b/tests/bufsz.c
@@ -8,21 +8,19 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "compat/nanomsg/nn.h"
-#include "convey.h"
-#include "nng.h"
-#include "trantest.h"
-
-#include "protocol/pubsub0/sub.h"
+#include <string.h>
-#include "protocol/pair1/pair.h"
+#include <nng/compat/nanomsg/nn.h>
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/protocol/pubsub0/sub.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/supplemental/util/platform.h>
+#include "trantest.h"
+#include "convey.h"
#include "stubs.h"
-#include <string.h>
-
#define SECONDS(x) ((x) *1000)
TestMain("Buffer Options", {
diff --git a/tests/bus.c b/tests/bus.c
index 88137b81..96e7ede3 100644
--- a/tests/bus.c
+++ b/tests/bus.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Garrett D'Amore <garrett@damore.org>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -8,15 +8,14 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
+#include <string.h>
-#include "protocol/bus0/bus.h"
+#include <nng/nng.h>
+#include <nng/protocol/bus0/bus.h>
+#include "convey.h"
#include "stubs.h"
-#include <string.h>
-
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
So(nng_msg_len(m) == strlen(s)); \
diff --git a/tests/compat_block.c b/tests/compat_block.c
index 1524803e..a0a1fd1a 100644
--- a/tests/compat_block.c
+++ b/tests/compat_block.c
@@ -20,8 +20,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
#include "compat_testutil.h"
/* This test checks whether blocking on send/recv works as expected. */
diff --git a/tests/compat_bug777.c b/tests/compat_bug777.c
index be7ed6cd..638c41b2 100644
--- a/tests/compat_bug777.c
+++ b/tests/compat_bug777.c
@@ -21,8 +21,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
#include "compat_testutil.h"
int main (NN_UNUSED int argc, NN_UNUSED const char *argv[])
diff --git a/tests/compat_bus.c b/tests/compat_bus.c
index eab41b47..70506047 100644
--- a/tests/compat_bus.c
+++ b/tests/compat_bus.c
@@ -20,8 +20,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/bus.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/bus.h>
#include "compat_testutil.h"
#define SOCKET_ADDRESS_A "inproc://a"
diff --git a/tests/compat_cmsg.c b/tests/compat_cmsg.c
index 774049b2..06d67467 100644
--- a/tests/compat_cmsg.c
+++ b/tests/compat_cmsg.c
@@ -22,9 +22,9 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/tcp.h>
-#include <nanomsg/reqrep.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/tcp.h>
+#include <nng/compat/nanomsg/reqrep.h>
#include "compat_testutil.h"
diff --git a/tests/compat_device.c b/tests/compat_device.c
index 5c4068d9..3c96e5b9 100644
--- a/tests/compat_device.c
+++ b/tests/compat_device.c
@@ -21,11 +21,11 @@
* IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/bus.h>
-#include <nanomsg/pair.h>
-#include <nanomsg/pipeline.h>
-#include <nanomsg/inproc.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/bus.h>
+#include <nng/compat/nanomsg/pair.h>
+#include <nng/compat/nanomsg/pipeline.h>
+#include <nng/compat/nanomsg/inproc.h>
#include "compat_testutil.h"
#define SOCKET_ADDRESS_A "inproc://a"
diff --git a/tests/compat_iovec.c b/tests/compat_iovec.c
index c579642a..54f078aa 100644
--- a/tests/compat_iovec.c
+++ b/tests/compat_iovec.c
@@ -20,8 +20,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
#include "compat_testutil.h"
diff --git a/tests/compat_msg.c b/tests/compat_msg.c
index 50a6004b..c2efb2cc 100644
--- a/tests/compat_msg.c
+++ b/tests/compat_msg.c
@@ -23,8 +23,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
#include "compat_testutil.h"
diff --git a/tests/compat_options.c b/tests/compat_options.c
index 307c0e1c..305ae128 100644
--- a/tests/compat_options.c
+++ b/tests/compat_options.c
@@ -8,11 +8,10 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-
-#include "compat/nanomsg/nn.h"
-#include "compat/nanomsg/reqrep.h"
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/reqrep.h>
+#include "convey.h"
#include "compat_testutil.h"
#include <string.h>
diff --git a/tests/compat_pair.c b/tests/compat_pair.c
index a0bc22f4..000944c1 100644
--- a/tests/compat_pair.c
+++ b/tests/compat_pair.c
@@ -20,8 +20,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
#include "compat_testutil.h"
diff --git a/tests/compat_pipeline.c b/tests/compat_pipeline.c
index fda3ae54..679f08f7 100644
--- a/tests/compat_pipeline.c
+++ b/tests/compat_pipeline.c
@@ -21,8 +21,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pipeline.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pipeline.h>
#include "compat_testutil.h"
#define SOCKET_ADDRESS "inproc://a"
diff --git a/tests/compat_poll.c b/tests/compat_poll.c
index ce9ec0f6..3431f5f2 100644
--- a/tests/compat_poll.c
+++ b/tests/compat_poll.c
@@ -33,9 +33,9 @@
#include <sys/select.h>
#endif
#include "compat_testutil.h"
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
-#include <nanomsg/inproc.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
+#include <nng/compat/nanomsg/inproc.h>
/* Test of polling via NN_SNDFD/NN_RCVFD mechanism. */
diff --git a/tests/compat_reqrep.c b/tests/compat_reqrep.c
index 893eceac..7bd7bf7b 100644
--- a/tests/compat_reqrep.c
+++ b/tests/compat_reqrep.c
@@ -22,8 +22,8 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/reqrep.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/reqrep.h>
#include "compat_testutil.h"
diff --git a/tests/compat_reqttl.c b/tests/compat_reqttl.c
index dc525255..939ca567 100644
--- a/tests/compat_reqttl.c
+++ b/tests/compat_reqttl.c
@@ -23,9 +23,9 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/reqrep.h>
-#include <nanomsg/tcp.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/reqrep.h>
+#include <nng/compat/nanomsg/tcp.h>
#include "compat_testutil.h"
diff --git a/tests/compat_shutdown.c b/tests/compat_shutdown.c
index 452aa2cc..84d4d244 100644
--- a/tests/compat_shutdown.c
+++ b/tests/compat_shutdown.c
@@ -21,9 +21,9 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/tcp.h>
-#include <nanomsg/reqrep.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/tcp.h>
+#include <nng/compat/nanomsg/reqrep.h>
#include "compat_testutil.h"
int main (int argc, const char *argv[])
diff --git a/tests/compat_survey.c b/tests/compat_survey.c
index 2d1fe0a0..645021eb 100644
--- a/tests/compat_survey.c
+++ b/tests/compat_survey.c
@@ -21,8 +21,8 @@
DEALINGS IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/survey.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/survey.h>
#include "compat_testutil.h"
diff --git a/tests/compat_surveyttl.c b/tests/compat_surveyttl.c
index 6d9f614d..00915da4 100644
--- a/tests/compat_surveyttl.c
+++ b/tests/compat_surveyttl.c
@@ -23,9 +23,9 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/survey.h>
-#include <nanomsg/tcp.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/survey.h>
+#include <nng/compat/nanomsg/tcp.h>
#include "compat_testutil.h"
diff --git a/tests/compat_tcp.c b/tests/compat_tcp.c
index 95ceb546..0fce4f08 100644
--- a/tests/compat_tcp.c
+++ b/tests/compat_tcp.c
@@ -22,10 +22,10 @@
IN THE SOFTWARE.
*/
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
-#include <nanomsg/pubsub.h>
-#include <nanomsg/tcp.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
+#include <nng/compat/nanomsg/pubsub.h>
+#include <nng/compat/nanomsg/tcp.h>
#include "compat_testutil.h"
diff --git a/tests/compat_testutil.c b/tests/compat_testutil.c
index ef17cb3f..7db03bf0 100644
--- a/tests/compat_testutil.c
+++ b/tests/compat_testutil.c
@@ -32,7 +32,7 @@
#include <stdlib.h>
#include <string.h>
-#include <nanomsg/nn.h>
+#include <nng/compat/nanomsg/nn.h>
#include "compat_testutil.h"
int test_socket_impl(char *file, int line, int family, int protocol);
diff --git a/tests/compat_ws.c b/tests/compat_ws.c
index 5dcfa277..67cd9b94 100644
--- a/tests/compat_ws.c
+++ b/tests/compat_ws.c
@@ -31,9 +31,9 @@
// We have improved the maximum receive size test, and verified that option
// setting for the frame type conforms to NNG constraints.
-#include <nanomsg/nn.h>
-#include <nanomsg/pair.h>
-#include <nanomsg/ws.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/pair.h>
+#include <nng/compat/nanomsg/ws.h>
#include "compat_testutil.h"
diff --git a/tests/cplusplus_pair.cc b/tests/cplusplus_pair.cc
index 02f57eaa..92387ce3 100644
--- a/tests/cplusplus_pair.cc
+++ b/tests/cplusplus_pair.cc
@@ -7,8 +7,8 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "nng.h"
-#include "protocol/pair1/pair.h"
+#include "nng/nng.h"
+#include "nng/protocol/pair1/pair.h"
#include <cstring>
#include <iostream>
diff --git a/tests/device.c b/tests/device.c
index b1f97123..0ff784cc 100644
--- a/tests/device.c
+++ b/tests/device.c
@@ -8,13 +8,14 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
-
-#include <string.h>
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
diff --git a/tests/errors.c b/tests/errors.c
index 06747c24..0cade6a4 100644
--- a/tests/errors.c
+++ b/tests/errors.c
@@ -1,5 +1,5 @@
//
-// Copyright 2016 Garrett D'Amore <garrett@damore.org>
+// Copyright 2018 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
@@ -7,11 +7,13 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
#include <errno.h>
#include <string.h>
+#include <nng/nng.h>
+
+#include "convey.h"
+
TestMain("Error messages work", {
Convey("Known errors work", {
So(strcmp(nng_strerror(NNG_ECLOSED), "Object closed") == 0);
diff --git a/tests/httpclient.c b/tests/httpclient.c
index 75ecbae9..46950528 100644
--- a/tests/httpclient.c
+++ b/tests/httpclient.c
@@ -8,19 +8,24 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
+// Basic HTTP client tests.
+
#ifndef _WIN32
#include <arpa/inet.h>
#endif
-// Basic HTTP client tests.
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+#include <nng/supplemental/tls/tls.h>
+
#include "core/nng_impl.h"
-#include "supplemental/http/http.h"
+
#include "supplemental/sha1/sha1.c"
#include "supplemental/sha1/sha1.h"
-#include "supplemental/tls/tls.h"
+
+#include "convey.h"
+#include "trantest.h"
const uint8_t example_sum[20] = { 0x0e, 0x97, 0x3b, 0x59, 0xf4, 0x76, 0x00,
0x7f, 0xd1, 0x0f, 0x87, 0xf3, 0x47, 0xc3, 0x95, 0x60, 0x65, 0x51, 0x6f,
diff --git a/tests/httpserver.c b/tests/httpserver.c
index 1bf88f12..c7530f88 100644
--- a/tests/httpserver.c
+++ b/tests/httpserver.c
@@ -8,8 +8,6 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
#ifdef _WIN32
#define strdup _strdup
@@ -17,10 +15,15 @@
#include <arpa/inet.h>
#endif
+#include "trantest.h"
+
// Basic HTTP server tests.
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+#include <nng/supplemental/tls/tls.h>
+
#include "core/nng_impl.h"
-#include "supplemental/http/http.h"
-#include "supplemental/tls/tls.h"
+#include "convey.h"
const char *doc1 = "<html><body>Someone <b>is</b> home!</body</html>";
const char *doc2 = "This is a text file.";
diff --git a/tests/idhash.c b/tests/idhash.c
index 72f1a44f..60a7133a 100644
--- a/tests/idhash.c
+++ b/tests/idhash.c
@@ -9,10 +9,10 @@
//
#include "core/idhash.c"
-#include "convey.h"
-
#include "core/nng_impl.h"
+#include "convey.h"
+
#define STRESSLOAD 50000
#define NVALUES 1000
diff --git a/tests/inproc.c b/tests/inproc.c
index 6691802a..3a3a2b60 100644
--- a/tests/inproc.c
+++ b/tests/inproc.c
@@ -9,9 +9,10 @@
//
#include "convey.h"
-#include "core/nng_impl.h"
#include "trantest.h"
+#include "core/nng_impl.h"
+
// Inproc tests.
TestMain("Inproc Transport", {
diff --git a/tests/ipc.c b/tests/ipc.c
index 5956b5d3..be37338e 100644
--- a/tests/ipc.c
+++ b/tests/ipc.c
@@ -8,8 +8,6 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
#ifdef _WIN32
#else
#include <unistd.h>
@@ -18,7 +16,11 @@
#endif
#endif
-#include "transport/ipc/ipc.h"
+#include <nng/nng.h>
+#include <nng/transport/ipc/ipc.h>
+
+#include "convey.h"
+#include "trantest.h"
// Inproc tests.
static int
diff --git a/tests/ipcperms.c b/tests/ipcperms.c
index 6d083d00..5f4a847c 100644
--- a/tests/ipcperms.c
+++ b/tests/ipcperms.c
@@ -8,17 +8,6 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
-
-#include "nng.h"
-
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "transport/ipc/ipc.h"
-
-#include "stubs.h"
-
#ifndef _WIN32
#include <errno.h>
#include <string.h>
@@ -28,6 +17,15 @@
#include <unistd.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/transport/ipc/ipc.h>
+
+#include "convey.h"
+#include "stubs.h"
+#include "trantest.h"
+
#define ADDR "/tmp/ipc_perms_test"
#if defined(__sun)
@@ -40,7 +38,6 @@
#ifdef _WIN32
TestMain("IPC Permissions", {
-
atexit(nng_fini);
Convey("Given a socket and an IPC listener", {
nng_socket s;
diff --git a/tests/ipcwinsec.c b/tests/ipcwinsec.c
index 1c226c7c..d6b28c1b 100644
--- a/tests/ipcwinsec.c
+++ b/tests/ipcwinsec.c
@@ -8,16 +8,14 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
-
-#include "nng.h"
-
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "transport/ipc/ipc.h"
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/transport/ipc/ipc.h>
+#include "convey.h"
#include "stubs.h"
+#include "trantest.h"
#define ADDR "/tmp/ipc_winsec_test"
diff --git a/tests/message.c b/tests/message.c
index e9f990ae..4c0af912 100644
--- a/tests/message.c
+++ b/tests/message.c
@@ -8,10 +8,12 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+
#include "convey.h"
-#include "nng.h"
-#include <string.h>
static uint8_t dat123[] = { 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3 };
TestMain("Message Tests", {
diff --git a/tests/multistress.c b/tests/multistress.c
index d39d2896..a3b32c3b 100644
--- a/tests/multistress.c
+++ b/tests/multistress.c
@@ -8,29 +8,28 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-
-#include "protocol/bus0/bus.h"
-#include "protocol/pair0/pair.h"
-#include "protocol/pair1/pair.h"
-#include "protocol/pipeline0/pull.h"
-#include "protocol/pipeline0/push.h"
-#include "protocol/pubsub0/pub.h"
-#include "protocol/pubsub0/sub.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "protocol/survey0/respond.h"
-#include "protocol/survey0/survey.h"
-#include "supplemental/util/platform.h"
-#include "transport/inproc/inproc.h"
-#include "transport/ipc/ipc.h"
-#include "transport/tcp/tcp.h"
-
#include <stdio.h>
#include <string.h>
#include <time.h>
+#include <nng/nng.h>
+#include <nng/protocol/bus0/bus.h>
+#include <nng/protocol/pair0/pair.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/protocol/pipeline0/pull.h>
+#include <nng/protocol/pipeline0/push.h>
+#include <nng/protocol/pubsub0/pub.h>
+#include <nng/protocol/pubsub0/sub.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/protocol/survey0/respond.h>
+#include <nng/protocol/survey0/survey.h>
+#include <nng/supplemental/util/platform.h>
+#include <nng/transport/inproc/inproc.h>
+#include <nng/transport/ipc/ipc.h>
+#include <nng/transport/tcp/tcp.h>
+
+#include "convey.h"
#include "stubs.h"
#ifdef NDEBUG
diff --git a/tests/nonblock.c b/tests/nonblock.c
index 1ad3c2f8..c8cce901 100644
--- a/tests/nonblock.c
+++ b/tests/nonblock.c
@@ -8,14 +8,6 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "nng.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "supplemental/util/platform.h"
-
-#include "convey.h"
-#include "stubs.h"
-
#include <stdlib.h>
#include <string.h>
@@ -24,6 +16,14 @@
#include <sys/time.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
+
+#include "convey.h"
+#include "stubs.h"
+
const char *addr = "inproc://bug346";
void
@@ -94,11 +94,9 @@ nng_socket reqs[NCLIENTS];
nng_socket rep;
TestMain("Nonblocking Works", {
-
atexit(nng_fini);
Convey("Running for 15 sec", {
-
nng_thread *server;
nng_thread *clients[NCLIENTS];
diff --git a/tests/options.c b/tests/options.c
index 2d81bd83..19134005 100644
--- a/tests/options.c
+++ b/tests/options.c
@@ -10,11 +10,10 @@
#include <string.h>
-#include "convey.h"
-
-#include "nng.h"
+#include <nng/nng.h>
+#include <nng/supplemental/util/options.h>
-#include "supplemental/util/options.h"
+#include "convey.h"
static nng_optspec case1[] = {
// clang-format off
diff --git a/tests/pair1.c b/tests/pair1.c
index c777725c..f55ea08a 100644
--- a/tests/pair1.c
+++ b/tests/pair1.c
@@ -8,14 +8,14 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
-#include "trantest.h"
+#include <string.h>
-#include "stubs.h"
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
-#include <string.h>
+#include "convey.h"
+#include "stubs.h"
+#include "trantest.h"
#define SECOND(x) ((x) *1000)
#define MILLISECOND(x) (x)
@@ -361,7 +361,6 @@ TestMain("PAIRv1 protocol", {
});
Convey("Reserved bits in raw header", {
-
Convey("Nonzero bits fail", {
So(nng_msg_alloc(&msg, 0) == 0);
So(nng_msg_header_append_u32(
diff --git a/tests/pipe.c b/tests/pipe.c
index dfebbd56..d3630289 100644
--- a/tests/pipe.c
+++ b/tests/pipe.c
@@ -8,16 +8,17 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "protocol/pipeline0/pull.h"
-#include "protocol/pipeline0/push.h"
-#include "supplemental/util/platform.h"
-
-#include "stubs.h"
#include <stdbool.h>
#include <string.h>
+#include <nng/nng.h>
+#include <nng/protocol/pipeline0/pull.h>
+#include <nng/protocol/pipeline0/push.h>
+#include <nng/supplemental/util/platform.h>
+
+#include "convey.h"
+#include "stubs.h"
+
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
So(nng_msg_len(m) == strlen(s)); \
diff --git a/tests/pipeline.c b/tests/pipeline.c
index f7d89367..034cb314 100644
--- a/tests/pipeline.c
+++ b/tests/pipeline.c
@@ -8,14 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/pipeline0/pull.h>
+#include <nng/protocol/pipeline0/push.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/pipeline0/pull.h"
-#include "protocol/pipeline0/push.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
-
-#include <string.h>
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
diff --git a/tests/platform.c b/tests/platform.c
index 51dc41fc..7af18029 100644
--- a/tests/platform.c
+++ b/tests/platform.c
@@ -8,11 +8,10 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-
-#include "nng.h"
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+#include "convey.h"
#include "stubs.h"
struct addarg {
diff --git a/tests/pollfd.c b/tests/pollfd.c
index 0baa6b2d..2eca7248 100644
--- a/tests/pollfd.c
+++ b/tests/pollfd.c
@@ -29,16 +29,16 @@
#endif
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/protocol/pipeline0/pull.h>
+#include <nng/protocol/pipeline0/push.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
-#include "protocol/pipeline0/pull.h"
-#include "protocol/pipeline0/push.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
TestMain("Poll FDs", {
-
Convey("Given a connected pair of sockets", {
nng_socket s1;
nng_socket s2;
diff --git a/tests/pubsub.c b/tests/pubsub.c
index d12a2df3..d61867ce 100644
--- a/tests/pubsub.c
+++ b/tests/pubsub.c
@@ -8,14 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/pubsub0/pub.h>
+#include <nng/protocol/pubsub0/sub.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/pubsub0/pub.h"
-#include "protocol/pubsub0/sub.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
-
-#include <string.h>
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
diff --git a/tests/reconnect.c b/tests/reconnect.c
index d13e6ad9..0cc2878b 100644
--- a/tests/reconnect.c
+++ b/tests/reconnect.c
@@ -8,14 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "protocol/pipeline0/pull.h"
-#include "protocol/pipeline0/push.h"
-#include "supplemental/util/platform.h"
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/pipeline0/pull.h>
+#include <nng/protocol/pipeline0/push.h>
+#include <nng/supplemental/util/platform.h>
+#include "convey.h"
#include "stubs.h"
-#include <string.h>
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
diff --git a/tests/reqctx.c b/tests/reqctx.c
index f8bb7611..e937b995 100644
--- a/tests/reqctx.c
+++ b/tests/reqctx.c
@@ -8,14 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
-
-#include <string.h>
static struct {
nng_aio *aio;
diff --git a/tests/reqpoll.c b/tests/reqpoll.c
index e1a996dd..672c2f05 100644
--- a/tests/reqpoll.c
+++ b/tests/reqpoll.c
@@ -25,12 +25,13 @@
#include <mswsock.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
bool
isready(SOCKET fd)
@@ -52,7 +53,6 @@ isready(SOCKET fd)
}
TestMain("REQ pollable", {
-
atexit(nng_fini);
Convey("Given a REQ/REP pair", {
diff --git a/tests/reqrep.c b/tests/reqrep.c
index b5a32dcf..526891ca 100644
--- a/tests/reqrep.c
+++ b/tests/reqrep.c
@@ -8,14 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
-
-#include <string.h>
TestMain("REQ/REP pattern", {
int rv;
@@ -43,7 +44,6 @@ TestMain("REQ/REP pattern", {
});
Convey("Resend time option id works", {
-
// Set timeout.
So(nng_setopt_ms(req, NNG_OPT_REQ_RESENDTIME, 10) ==
0);
diff --git a/tests/reqstress.c b/tests/reqstress.c
index 1811063b..f6dfb975 100644
--- a/tests/reqstress.c
+++ b/tests/reqstress.c
@@ -8,21 +8,20 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-
-#include "protocol/bus0/bus.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "supplemental/util/platform.h"
-#include "transport/inproc/inproc.h"
-#include "transport/ipc/ipc.h"
-#include "transport/tcp/tcp.h"
-
#include <stdio.h>
#include <string.h>
#include <time.h>
+#include <nng/nng.h>
+#include <nng/protocol/bus0/bus.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
+#include <nng/transport/inproc/inproc.h>
+#include <nng/transport/ipc/ipc.h>
+#include <nng/transport/tcp/tcp.h>
+
+#include "convey.h"
#include "stubs.h"
#ifdef NDEBUG
diff --git a/tests/resolv.c b/tests/resolv.c
index 90297a9f..954481b7 100644
--- a/tests/resolv.c
+++ b/tests/resolv.c
@@ -8,12 +8,12 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
#include "convey.h"
#include "core/nng_impl.h"
#include "stubs.h"
-#include <string.h>
-
#ifndef _WIN32
#include <arpa/inet.h>
#endif
diff --git a/tests/respondpoll.c b/tests/respondpoll.c
index 5dd34c7f..4e869da8 100644
--- a/tests/respondpoll.c
+++ b/tests/respondpoll.c
@@ -8,15 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <nng/nng.h>
+#include <nng/protocol/survey0/respond.h>
+#include <nng/protocol/survey0/survey.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/survey0/respond.h"
-#include "protocol/survey0/survey.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
TestMain("Respondent pollable", {
-
atexit(nng_fini);
Convey("Given a connected survey pair", {
diff --git a/tests/scalability.c b/tests/scalability.c
index 38137e90..1cbbd961 100644
--- a/tests/scalability.c
+++ b/tests/scalability.c
@@ -8,15 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
+#include <string.h>
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "stubs.h"
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
-#include <string.h>
+#include "convey.h"
+#include "stubs.h"
static int nclients = 200;
diff --git a/tests/sha1.c b/tests/sha1.c
index 1aa137d7..6877e89e 100644
--- a/tests/sha1.c
+++ b/tests/sha1.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 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
// copy of which should be located in the distribution where this
@@ -11,10 +11,9 @@
#include <stdint.h>
#include <string.h>
-#include "convey.h"
-
-#include "nng.h"
+#include <nng/nng.h>
+#include "convey.h"
#include "supplemental/sha1/sha1.h"
// The following test vectors are from RFC 3174.
@@ -38,7 +37,6 @@ char *resultarray[4] = {
};
TestMain("SHA1 Verification", {
-
Convey("SHA1 Works", {
for (int i = 0; i < 4; i++) {
nni_sha1_ctx ctx;
diff --git a/tests/sock.c b/tests/sock.c
index 562a05d7..02cd0d43 100644
--- a/tests/sock.c
+++ b/tests/sock.c
@@ -8,19 +8,16 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "trantest.h"
-
-#include "protocol/pubsub0/sub.h"
-
-#include "protocol/pair1/pair.h"
+#include <string.h>
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/protocol/pubsub0/sub.h>
+#include <nng/supplemental/util/platform.h>
+#include "convey.h"
#include "stubs.h"
-
-#include <string.h>
+#include "trantest.h"
#define SECONDS(x) ((x) *1000)
diff --git a/tests/stats.c b/tests/stats.c
index b8ca8da8..68a5ab62 100644
--- a/tests/stats.c
+++ b/tests/stats.c
@@ -8,19 +8,16 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "trantest.h"
-
-#include "protocol/pubsub0/sub.h"
-
-#include "protocol/pair1/pair.h"
+#include <string.h>
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/protocol/pubsub0/sub.h>
+#include <nng/supplemental/util/platform.h>
+#include "convey.h"
#include "stubs.h"
-
-#include <string.h>
+#include "trantest.h"
#define SECONDS(x) ((x) *1000)
diff --git a/tests/survey.c b/tests/survey.c
index 5f3001e7..d1af09ec 100644
--- a/tests/survey.c
+++ b/tests/survey.c
@@ -8,15 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
+#include <string.h>
-#include "nng.h"
-#include "protocol/survey0/respond.h"
-#include "protocol/survey0/survey.h"
-#include "stubs.h"
-#include "supplemental/util/platform.h"
+#include <nng/nng.h>
+#include <nng/protocol/survey0/respond.h>
+#include <nng/protocol/survey0/survey.h>
+#include <nng/supplemental/util/platform.h>
-#include <string.h>
+#include "convey.h"
+#include "stubs.h"
#define APPENDSTR(m, s) nng_msg_append(m, s, strlen(s))
#define CHECKSTR(m, s) \
diff --git a/tests/surveyctx.c b/tests/surveyctx.c
index b3843e9d..d2d1c4d7 100644
--- a/tests/surveyctx.c
+++ b/tests/surveyctx.c
@@ -8,14 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+#include <nng/protocol/survey0/respond.h>
+#include <nng/protocol/survey0/survey.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/survey0/respond.h"
-#include "protocol/survey0/survey.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
-
-#include <string.h>
static struct {
nng_aio *aio;
diff --git a/tests/surveypoll.c b/tests/surveypoll.c
index a2264d3e..2d6f02ae 100644
--- a/tests/surveypoll.c
+++ b/tests/surveypoll.c
@@ -8,15 +8,15 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <nng/nng.h>
+#include <nng/protocol/survey0/respond.h>
+#include <nng/protocol/survey0/survey.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/survey0/respond.h"
-#include "protocol/survey0/survey.h"
#include "stubs.h"
-#include "supplemental/util/platform.h"
TestMain("Survey pollable", {
-
atexit(nng_fini);
Convey("Given a connected survey pair", {
diff --git a/tests/synch.c b/tests/synch.c
index cf75e20c..84da5568 100644
--- a/tests/synch.c
+++ b/tests/synch.c
@@ -8,10 +8,10 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
#include "convey.h"
-//#include "core/nng_impl.h"
-#include "nng.h"
-#include "supplemental/util/platform.h"
// Notify tests for verifying condvars.
struct notifyarg {
diff --git a/tests/tcp.c b/tests/tcp.c
index 2c49f509..53372fa5 100644
--- a/tests/tcp.c
+++ b/tests/tcp.c
@@ -8,18 +8,19 @@
// found online at https://opensource.org/licenses/MIT.
//
+#ifndef _WIN32
+#include <arpa/inet.h>
+#endif
+
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
+#include "stubs.h"
#include "trantest.h"
-#include "stubs.h"
// TCP tests.
-#ifndef _WIN32
-#include <arpa/inet.h>
-#endif
-
static int
check_props_v4(nng_msg *msg)
{
diff --git a/tests/tcp6.c b/tests/tcp6.c
index 86898b46..9b3b0d4b 100644
--- a/tests/tcp6.c
+++ b/tests/tcp6.c
@@ -8,12 +8,14 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
+// TCP tests for IPv6.
+
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include "convey.h"
#include "core/nng_impl.h"
-// TCP tests for IPv6.
-#include "protocol/pair1/pair.h"
+#include "trantest.h"
#include "stubs.h"
diff --git a/tests/tls.c b/tests/tls.c
index 8915b265..25f7960b 100644
--- a/tests/tls.c
+++ b/tests/tls.c
@@ -8,23 +8,21 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-
-#include "nng.h"
-
-#include "protocol/pair1/pair.h"
-#include "supplemental/tls/tls.h"
-#include "transport/tls/tls.h"
-
-#include "trantest.h"
-
-#include "stubs.h"
-// TCP tests.
+// TLS tests.
#ifndef _WIN32
#include <arpa/inet.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/supplemental/tls/tls.h>
+#include <nng/transport/tls/tls.h>
+
+#include "convey.h"
+#include "stubs.h"
+#include "trantest.h"
+
// These keys are for demonstration purposes ONLY. DO NOT USE.
// The certificate is valid for 100 years, because I don't want to
// have to regenerate it ever again. The CN is 127.0.0.1, and self-signed.
diff --git a/tests/transport.c b/tests/transport.c
index c060a26f..850fe1a7 100644
--- a/tests/transport.c
+++ b/tests/transport.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 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
// copy of which should be located in the distribution where this
@@ -8,11 +8,12 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <string.h>
+
+#include <nng/nng.h>
+
#include "convey.h"
#include "core/nng_impl.h"
-#include "nng.h"
-
-#include <string.h>
static int ninits;
static int nfinis;
diff --git a/tests/trantest.h b/tests/trantest.h
index 2b181d22..97fd3159 100644
--- a/tests/trantest.h
+++ b/tests/trantest.h
@@ -8,15 +8,17 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "core/nng_impl.h"
-#include "nng.h"
-#include "protocol/reqrep0/rep.h"
-#include "protocol/reqrep0/req.h"
-#include "supplemental/util/platform.h"
#include <stdlib.h>
#include <string.h>
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/rep.h>
+#include <nng/protocol/reqrep0/req.h>
+#include <nng/supplemental/util/platform.h>
+
+#include "convey.h"
+#include "core/nng_impl.h"
+
// Transport common tests. By making a common test framework for transports,
// we can avoid rewriting the same tests for each new transport. Include this
// file once in your test code. The test framework uses the REQ/REP protocol
@@ -150,7 +152,7 @@ trantest_init(trantest *tt, const char *addr)
So(nng_req_open(&tt->reqsock) == 0);
So(nng_rep_open(&tt->repsock) == 0);
- nni_url *url;
+ nng_url *url;
So(nng_url_parse(&url, tt->addr) == 0);
#if defined(NNG_STATIC_LIB)
tt->tran = nni_tran_find(url);
diff --git a/tests/udp.c b/tests/udp.c
index 15520791..d5f20c26 100644
--- a/tests/udp.c
+++ b/tests/udp.c
@@ -8,18 +8,17 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "trantest.h"
+// Basic UDP tests.
#ifndef _WIN32
#include <arpa/inet.h>
#endif
-// Basic UDP tests.
+#include "convey.h"
#include "core/nng_impl.h"
+#include "trantest.h"
TestMain("UDP support", {
-
nni_init();
atexit(nng_fini);
@@ -259,7 +258,6 @@ TestMain("UDP support", {
rv == NNG_EUNREACHABLE);
nng_aio_free(aio1);
});
-
});
Convey("Cannot open using bogus sockaddr", {
diff --git a/tests/url.c b/tests/url.c
index c35feee1..15eb5d78 100644
--- a/tests/url.c
+++ b/tests/url.c
@@ -10,12 +10,11 @@
#include <string.h>
-#include "convey.h"
+#include <nng/nng.h>
-#include "nng.h"
+#include "convey.h"
TestMain("URLs", {
-
nng_url *url;
Convey("http://www.google.com", {
@@ -316,5 +315,4 @@ TestMain("URLs", {
So(strcmp(url->u_path, "/\xc2\xa2_centsign") == 0);
nng_url_free(url);
});
-
})
diff --git a/tests/ws.c b/tests/ws.c
index 753f6be9..0add1a07 100644
--- a/tests/ws.c
+++ b/tests/ws.c
@@ -8,19 +8,18 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
-#include "transport/ws/websocket.h"
-#include "trantest.h"
-
-#include "stubs.h"
-// TCP tests.
-
#ifndef _WIN32
#include <arpa/inet.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/transport/ws/websocket.h>
+
+#include "convey.h"
+#include "stubs.h"
+#include "trantest.h"
+
static int
check_props_v4(nng_msg *msg)
{
@@ -83,7 +82,6 @@ check_props_v4(nng_msg *msg)
}
TestMain("WebSocket Transport", {
-
trantest_test_extended("ws://127.0.0.1:%u/test", check_props_v4);
Convey("Empty hostname works", {
diff --git a/tests/wss.c b/tests/wss.c
index fac33398..78601066 100644
--- a/tests/wss.c
+++ b/tests/wss.c
@@ -8,20 +8,19 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
-#include "supplemental/tls/tls.h"
-#include "transport/ws/websocket.h"
-#include "trantest.h"
-
-#include "stubs.h"
-// TCP tests.
-
#ifndef _WIN32
#include <arpa/inet.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/supplemental/tls/tls.h>
+#include <nng/transport/ws/websocket.h>
+
+#include "convey.h"
+#include "stubs.h"
+#include "trantest.h"
+
// These keys are for demonstration purposes ONLY. DO NOT USE.
// The certificate is valid for 100 years, because I don't want to
// have to regenerate it ever again. The CN is 127.0.0.1, and self-signed.
@@ -234,7 +233,6 @@ out:
}
TestMain("WebSocket Secure (TLS) Transport", {
-
static trantest tt;
tt.dialer_init = init_dialer_wss;
diff --git a/tests/wssfile.c b/tests/wssfile.c
index 9117c277..3ce26e1a 100644
--- a/tests/wssfile.c
+++ b/tests/wssfile.c
@@ -8,21 +8,19 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "convey.h"
-#include "nng.h"
-#include "protocol/pair1/pair.h"
-#include "supplemental/tls/tls.h"
-#include "transport/ws/websocket.h"
-
-#include "trantest.h"
-
-#include "stubs.h"
-// TCP tests.
-
#ifndef _WIN32
#include <arpa/inet.h>
#endif
+#include <nng/nng.h>
+#include <nng/protocol/pair1/pair.h>
+#include <nng/supplemental/tls/tls.h>
+#include <nng/transport/ws/websocket.h>
+
+#include "convey.h"
+#include "stubs.h"
+#include "trantest.h"
+
// These keys are for demonstration purposes ONLY. DO NOT USE.
// The certificate is valid for 100 years, because I don't want to
// have to regenerate it ever again. The CN is 127.0.0.1, and self-signed.
@@ -267,7 +265,6 @@ init_listener_wss_file(nng_listener l)
}
TestMain("WebSocket Secure (TLS) Transport (file based)", {
-
static trantest tt;
tt.dialer_init = init_dialer_wss_file;
diff --git a/tests/zt.c b/tests/zt.c
index b46741ab..714317b4 100644
--- a/tests/zt.c
+++ b/tests/zt.c
@@ -8,12 +8,12 @@
// found online at https://opensource.org/licenses/MIT.
//
+#include <nng/nng.h>
+#include <nng/protocol/pair0/pair.h>
+#include <nng/transport/zerotier/zerotier.h>
+
#include "convey.h"
-#include "nng.h"
-#include "protocol/pair0/pair.h"
-#include "transport/zerotier/zerotier.h"
#include "trantest.h"
-
#include "stubs.h"
// zerotier tests.