aboutsummaryrefslogtreecommitdiff
path: root/src/core/sock_test.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-03 10:12:28 -0800
committerGarrett D'Amore <garrett@damore.org>2024-11-03 10:45:51 -0800
commit49076237cc0b82e7007535e789f3fadc19a18c45 (patch)
tree6336768366f8d8bca987f8742ddcb1df73fd3c98 /src/core/sock_test.c
parent11485d2723f22dc60e4cefea3ffb3fd8a378d931 (diff)
downloadnng-49076237cc0b82e7007535e789f3fadc19a18c45.tar.gz
nng-49076237cc0b82e7007535e789f3fadc19a18c45.tar.bz2
nng-49076237cc0b82e7007535e789f3fadc19a18c45.zip
Remove NNI_TYPE_OPAQUE altogether.
This also fixes a couple of minor bugs -- changing the socket name could be incorrect as the termination was not applied properly, and the ZeroTier code got a change -- note that it is only possible in this revised version to pass a single moon ID for ZT orbit. The ZT code is a bit stale, and untested anyway.
Diffstat (limited to 'src/core/sock_test.c')
-rw-r--r--src/core/sock_test.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/sock_test.c b/src/core/sock_test.c
index 28a1201a..1fe94e4c 100644
--- a/src/core/sock_test.c
+++ b/src/core/sock_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 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
@@ -123,6 +123,13 @@ test_socket_name(void)
// strings must not be too long
NUTS_FAIL(
nng_socket_set_string(s1, NNG_OPT_SOCKNAME, buf), NNG_EINVAL);
+ memset(buf, 'A', 64);
+ buf[64] = 0;
+ NUTS_FAIL(
+ nng_socket_set_string(s1, NNG_OPT_SOCKNAME, buf), NNG_EINVAL);
+ buf[63] = 0;
+ NUTS_PASS(nng_socket_set_string(s1, NNG_OPT_SOCKNAME, buf));
+ NUTS_PASS(nng_socket_set_string(s1, NNG_OPT_SOCKNAME, "hello"));
NUTS_PASS(nng_socket_get_string(s1, NNG_OPT_SOCKNAME, &str));
NUTS_ASSERT(str != NULL);