aboutsummaryrefslogtreecommitdiff
path: root/tests/testutil.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-11-01 22:05:35 -0800
committerGarrett D'Amore <garrett@damore.org>2020-11-08 17:50:24 -0800
commitfc6882305f0b5e06e58a0a25740f422d133015b5 (patch)
tree714b1fa4656253c8731a8f3f0861c24715440f95 /tests/testutil.h
parent4bf06d03f6ebead7f4e0603a2da3b1b891887878 (diff)
downloadnng-fc6882305f0b5e06e58a0a25740f422d133015b5.tar.gz
nng-fc6882305f0b5e06e58a0a25740f422d133015b5.tar.bz2
nng-fc6882305f0b5e06e58a0a25740f422d133015b5.zip
fixes #1041 Abstract socket address for IPC
fixes #1326 Linux IPC could use fchmod fixes #1327 getsockname on ipc may not work This introduces an abstract:// style transport, which on Linux results in using the abstract socket with the given name (not including the leading NULL byte). A new NNG_AF_ABSTRACT is provided. Auto bind abstract sockets are also supported. While here we have inlined the aios for the POSIX ipc pipe objects, eliminating at least one set of failure paths, and have also performed various other cleanups. A unix:// alias is available on POSIX systems, which acts just like ipc:// (and is fact just an alias). This is supplied so that in the future we can add support for AF_UNIX on Windows. We've also absorbed the ipcperms test into the new ipc_test suite. Finally we are now enforcing that IPC path names on Windows are not over the maximum size, rather than just silently truncating them.
Diffstat (limited to 'tests/testutil.h')
-rw-r--r--tests/testutil.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/testutil.h b/tests/testutil.h
index 15028106..eb7ab7d1 100644
--- a/tests/testutil.h
+++ b/tests/testutil.h
@@ -63,8 +63,8 @@ extern int testutil_marry_ex(
// success, an NNG error number otherwise.)
extern void *testutil_stream_send_start(nng_stream *, void *, size_t);
extern void *testutil_stream_recv_start(nng_stream *, void *, size_t);
-extern int testutil_stream_send_wait(void *);
-extern int testutil_stream_recv_wait(void *);
+extern int testutil_stream_send_wait(void *);
+extern int testutil_stream_recv_wait(void *);
// These are TLS certificates. The client and server are signed with the
// root. The server uses CN 127.0.0.1. Other details are bogus, but
@@ -111,6 +111,16 @@ extern const char *testutil_client_crt;
strcmp(string, buf_) == 0, "%s == %s", string, buf_); \
} while (0)
+#define TEST_STREQUAL(s1, s2) \
+ do { \
+ TEST_CHECK_(strcmp(s1, s2) == 0, "%s == %s", s1, s2); \
+ } while (0)
+
+#define TEST_NULL(x) \
+ do { \
+ TEST_CHECK_((x) == NULL, "%p == NULL", x); \
+ } while (0)
+
#ifdef __cplusplus
};
#endif