aboutsummaryrefslogtreecommitdiff
path: root/src/platform/ipc_stream_test.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-12-30 12:20:57 -0800
committerGarrett D'Amore <garrett@damore.org>2024-12-30 12:20:57 -0800
commit252f15e0d5889a461490ec3c5e11e57dbdf0c50b (patch)
tree56a2af58775b30882b7d120385b352c1e5d099b6 /src/platform/ipc_stream_test.c
parent9c6b2929d8019dcc11935550bc3520ae39c2964e (diff)
downloadnng-252f15e0d5889a461490ec3c5e11e57dbdf0c50b.tar.gz
nng-252f15e0d5889a461490ec3c5e11e57dbdf0c50b.tar.bz2
nng-252f15e0d5889a461490ec3c5e11e57dbdf0c50b.zip
socket activation: test fixes (improve coverage, etc.)
Diffstat (limited to 'src/platform/ipc_stream_test.c')
-rw-r--r--src/platform/ipc_stream_test.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/platform/ipc_stream_test.c b/src/platform/ipc_stream_test.c
index 77c307bc..bad8ffd6 100644
--- a/src/platform/ipc_stream_test.c
+++ b/src/platform/ipc_stream_test.c
@@ -194,7 +194,7 @@ test_ipc_listen_activation_busy(void)
char *addr;
NUTS_ADDR(addr, "ipc");
- NUTS_PASS(nng_stream_listener_alloc(&l1, "tcp://"));
+ NUTS_PASS(nng_stream_listener_alloc(&l1, addr));
NUTS_PASS(nng_stream_listener_listen(l1));
NUTS_PASS(nng_stream_listener_get_int(l1, NNG_OPT_LISTEN_FD, &fd));
NUTS_FAIL(
@@ -267,14 +267,31 @@ test_ipc_listen_activation_bogus_fd(void)
#endif
}
+void
+test_ipc_listen_activation_bad_arg(void)
+{
+#if defined(NNG_PLATFORM_POSIX)
+ nng_stream_listener *l1;
+
+ NUTS_PASS(nng_stream_listener_alloc(&l1, "ipc:///"));
+ NUTS_FAIL(nng_stream_listener_set_bool(l1, NNG_OPT_LISTEN_FD, false),
+ NNG_EBADTYPE);
+ nng_stream_listener_free(l1);
+#else
+ NUTS_SKIP("Not POSIX");
+#endif
+}
+
NUTS_TESTS = {
{ "ipc stream", test_ipc_stream },
{ "ipc socket activation", test_ipc_listen_activation },
{ "ipc socket activation busy", test_ipc_listen_activation_busy },
- { "pc socket activation closed", test_ipc_listen_activation_closed },
+ { "ipc socket activation closed", test_ipc_listen_activation_closed },
{ "ipc socket activation wrong family",
test_ipc_listen_activation_wrong_family },
{ "ipc socket activation bogus fd",
test_ipc_listen_activation_bogus_fd },
+ { "ipc socket activation bad arg",
+ test_ipc_listen_activation_bad_arg },
{ NULL, NULL },
};