diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-30 12:19:10 -0500 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-30 12:19:27 -0500 |
| commit | 25873b4fad8a5afbf5c539a9b9bb9659ce43c02e (patch) | |
| tree | 43db7fc1d1a2e0cf24b8af23d20885d213614892 /tests | |
| parent | cb8e9066edacbd0440df54672b426c44f102085f (diff) | |
| download | nng-25873b4fad8a5afbf5c539a9b9bb9659ce43c02e.tar.gz nng-25873b4fad8a5afbf5c539a9b9bb9659ce43c02e.tar.bz2 nng-25873b4fad8a5afbf5c539a9b9bb9659ce43c02e.zip | |
tests: tcp test converted to NUTS
TCPv6 not done yet since that needs special work to be conditionalized.
Also tcpsupp remains to be converted.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | tests/tcp.c | 60 |
2 files changed, 0 insertions, 61 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f6008c41..4e1d2331 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -132,7 +132,6 @@ add_nng_test(nonblock 60) add_nng_test(scalability 20 ON) add_nng_test(synch 5) add_nng_test(tcpsupp 10) -add_nng_test(tcp 180) add_nng_test(tcp6 60) add_nng_test(ws 30) add_nng_test(wss 30) diff --git a/tests/tcp.c b/tests/tcp.c deleted file mode 100644 index 2c80035c..00000000 --- a/tests/tcp.c +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright 2022 Staysail Systems, Inc. <info@staysail.tech> -// Copyright 2018 Capitar IT Group BV <info@capitar.com> -// Copyright 2018 Devolutions <info@devolutions.net> -// -// This software is supplied under the terms of the MIT License, a -// copy of which should be located in the distribution where this -// file was obtained (LICENSE.txt). A copy of the license may also be -// 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 "stubs.h" -#include "trantest.h" - -// TCP tests. - -static int -check_props_v4(nng_msg *msg) -{ - nng_pipe p; - size_t z; - nng_sockaddr la; - nng_sockaddr ra; - bool b; - - p = nng_msg_get_pipe(msg); - So(nng_pipe_id(p) > 0); - So(nng_pipe_get_addr(p, NNG_OPT_LOCADDR, &la) == 0); - So(la.s_family == NNG_AF_INET); - So(la.s_in.sa_port == htons(trantest_port - 1)); - So(la.s_in.sa_port != 0); - So(la.s_in.sa_addr == htonl(0x7f000001)); - - // untyped - So(nng_pipe_get_addr(p, NNG_OPT_REMADDR, &ra) == 0); - So(ra.s_family == NNG_AF_INET); - So(ra.s_in.sa_port != 0); - So(ra.s_in.sa_addr == htonl(0x7f000001)); - - So(nng_pipe_get_size(p, NNG_OPT_REMADDR, &z) == NNG_EBADTYPE); - - So(nng_pipe_get_bool(p, NNG_OPT_TCP_KEEPALIVE, &b) == 0); - So(b == false); // default - - So(nng_pipe_get_bool(p, NNG_OPT_TCP_NODELAY, &b) == 0); - So(b == true); // default - - return (0); -} - -TestMain("TCP Transport", - { trantest_test_extended("tcp://127.0.0.1:", check_props_v4); }) |
