From 713bac18ab47dc751ea0458bae3b88729c233a15 Mon Sep 17 00:00:00 2001 From: cliffg-softwarelibre Date: Fri, 31 May 2024 19:33:24 -0600 Subject: [PATCH] More progress on major reorg --- CMakeLists.txt | 3 +++ test/main_test.cpp | 21 ------------------ test/net_ip/basic_io_interface_test.cpp | 14 +++++------- test/net_ip/basic_io_output_test.cpp | 14 +++++------- test/net_ip/detail/io_common_test.cpp | 14 +++++------- test/net_ip/detail/net_entity_common_test.cpp | 14 +++++------- test/net_ip/detail/output_queue_test.cpp | 14 +++++------- test/net_ip/detail/tcp_acceptor_test.cpp | 22 +++++++++---------- test/net_ip/detail/tcp_io_test.cpp | 14 +++++------- test/net_ip/detail/udp_entity_io_test.cpp | 22 +++++++++---------- test/net_ip/detail/wp_access_test.cpp | 14 +++++------- test/net_ip/endpoints_resolver_test.cpp | 14 +++++------- test/net_ip/net_entity_test.cpp | 14 +++++------- test/net_ip/net_ip_error_test.cpp | 14 +++++------- test/net_ip/net_ip_test.cpp | 14 +++++------- .../simple_variable_len_msg_frame_test.cpp | 14 +++++------- test/net_ip/tcp_connector_timeout_test.cpp | 14 +++++------- 17 files changed, 101 insertions(+), 149 deletions(-) delete mode 100644 test/main_test.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a0b432..0e5773b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,9 @@ add_library ( chops::chops_net_ip ALIAS chops_net_ip ) # thread support specified in Asio download +include ( cmake/download_cpm.cmake ) +CPMAddPackage ( "gh:connectivecpp/shared_buffer@v1.0.0" + include ( cmake/download_asio_cpm.cmake ) # configure library target diff --git a/test/main_test.cpp b/test/main_test.cpp deleted file mode 100644 index 268b44e..0000000 --- a/test/main_test.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/** @file - * - * @defgroup test_module Unit tests for the various Chops components. - * - * @ingroup test_module - * - * @brief Source file for combining (i.e. linking) all Chops tests together. - * - * @author Cliff Green - * - * Copyright (c) 2017-2019 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - * - */ - -#define CATCH_CONFIG_MAIN - -#include "catch2/catch.hpp" - diff --git a/test/net_ip/basic_io_interface_test.cpp b/test/net_ip/basic_io_interface_test.cpp index 9367f0a..c95220f 100644 --- a/test/net_ip/basic_io_interface_test.cpp +++ b/test/net_ip/basic_io_interface_test.cpp @@ -1,19 +1,17 @@ /** @file * - * @ingroup test_module + * @brief Test scenarios for @c basic_io_interface class template. * - * @brief Test scenarios for @c basic_io_interface class template. + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2017-2024 by Cliff Green * - * Copyright (c) 2017-2018 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include // std::shared_ptr #include diff --git a/test/net_ip/basic_io_output_test.cpp b/test/net_ip/basic_io_output_test.cpp index 0d393e6..1a4d50a 100644 --- a/test/net_ip/basic_io_output_test.cpp +++ b/test/net_ip/basic_io_output_test.cpp @@ -1,19 +1,17 @@ /** @file * - * @ingroup test_module + * @brief Test scenarios for @c basic_io_output class template. * - * @brief Test scenarios for @c basic_io_output class template. + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2018-2024 by Cliff Green * - * Copyright (c) 2018-2019 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include // std::shared_ptr #include diff --git a/test/net_ip/detail/io_common_test.cpp b/test/net_ip/detail/io_common_test.cpp index 1c35850..7f3476e 100644 --- a/test/net_ip/detail/io_common_test.cpp +++ b/test/net_ip/detail/io_common_test.cpp @@ -1,19 +1,17 @@ /** @file * - * @ingroup test_module + * @brief Test scenarios for @c io_common detail class. * - * @brief Test scenarios for @c io_common detail class. + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2017-2024 by Cliff Green * - * Copyright (c) 2017-2019 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include #include diff --git a/test/net_ip/detail/net_entity_common_test.cpp b/test/net_ip/detail/net_entity_common_test.cpp index 8787faf..2227ff2 100644 --- a/test/net_ip/detail/net_entity_common_test.cpp +++ b/test/net_ip/detail/net_entity_common_test.cpp @@ -1,19 +1,17 @@ /** @file * - * @ingroup test_module + * @brief Test scenarios for @c net_entity_common detail class. * - * @brief Test scenarios for @c net_entity_common detail class. + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2018-2024 by Cliff Green * - * Copyright (c) 2018-2019 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include // std::shared_ptr #include // std::error_code diff --git a/test/net_ip/detail/output_queue_test.cpp b/test/net_ip/detail/output_queue_test.cpp index 22bacae..c1a3597 100644 --- a/test/net_ip/detail/output_queue_test.cpp +++ b/test/net_ip/detail/output_queue_test.cpp @@ -1,19 +1,17 @@ /** @file * - * @ingroup test_module + * @brief Test scenarios for @c output_queue detail class. * - * @brief Test scenarios for @c output_queue detail class. + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2017-2024 by Cliff Green * - * Copyright (c) 2017-2018 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include #include diff --git a/test/net_ip/detail/tcp_acceptor_test.cpp b/test/net_ip/detail/tcp_acceptor_test.cpp index f36cefa..2692b1b 100644 --- a/test/net_ip/detail/tcp_acceptor_test.cpp +++ b/test/net_ip/detail/tcp_acceptor_test.cpp @@ -1,24 +1,22 @@ /** @file * - * @ingroup test_module + * @brief Test scenarios for @c tcp_acceptor detail class. * - * @brief Test scenarios for @c tcp_acceptor detail class. + * This test is similar to the tcp_io_test code, with a little bit less + * internal plumbing, and allowing multiple connector threads to be started. + * The TCP acceptor is the Chops Net IP class, but the connector threads are + * using blocking Asio connects and io. * - * This test is similar to the tcp_io_test code, with a little bit less - * internal plumbing, and allowing multiple connector threads to be started. - * The TCP acceptor is the Chops Net IP class, but the connector threads are - * using blocking Asio connects and io. + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2018-2024 by Cliff Green * - * Copyright (c) 2018-2019 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "asio/ip/tcp.hpp" #include "asio/write.hpp" diff --git a/test/net_ip/detail/tcp_io_test.cpp b/test/net_ip/detail/tcp_io_test.cpp index d09a071..2c32256 100644 --- a/test/net_ip/detail/tcp_io_test.cpp +++ b/test/net_ip/detail/tcp_io_test.cpp @@ -1,19 +1,17 @@ /** @file * - * @ingroup test_module + * @brief Test scenarios for @c tcp_io detail class. * - * @brief Test scenarios for @c tcp_io detail class. + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2017-2024 by Cliff Green * - * Copyright (c) 2017-2018 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "asio/ip/tcp.hpp" #include "asio/connect.hpp" diff --git a/test/net_ip/detail/udp_entity_io_test.cpp b/test/net_ip/detail/udp_entity_io_test.cpp index 9ad780b..a2a97ce 100644 --- a/test/net_ip/detail/udp_entity_io_test.cpp +++ b/test/net_ip/detail/udp_entity_io_test.cpp @@ -1,24 +1,22 @@ /** @file * - * @ingroup test_module + * @brief Test scenarios for @c udp_entity_io detail class. * - * @brief Test scenarios for @c udp_entity_io detail class. + * This test design is different in a few respects from the tcp_io, tcp_acceptor, + * and tcp_connector tests. In particular, multiple UDP senders are sending to one + * UDP receiver, so an empty message shutdown sequence won't work the same as with + * TCP connections (which are always one-to-one). * - * This test design is different in a few respects from the tcp_io, tcp_acceptor, - * and tcp_connector tests. In particular, multiple UDP senders are sending to one - * UDP receiver, so an empty message shutdown sequence won't work the same as with - * TCP connections (which are always one-to-one). + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2018-2024 by Cliff Green * - * Copyright (c) 2018-2019 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "asio/ip/udp.hpp" #include "asio/io_context.hpp" diff --git a/test/net_ip/detail/wp_access_test.cpp b/test/net_ip/detail/wp_access_test.cpp index 6f8580d..be538ed 100644 --- a/test/net_ip/detail/wp_access_test.cpp +++ b/test/net_ip/detail/wp_access_test.cpp @@ -1,19 +1,17 @@ /** @file * - * @ingroup test_module + * @brief Test scenarios for @c wp_access and @c wp_access_void function templates. * - * @brief Test scenarios for @c wp_access and @c wp_access_void function templates. + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2019-2024 by Cliff Green * - * Copyright (c) 2019 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include // std::shared_ptr, std::weak_ptr #include // std::size_t diff --git a/test/net_ip/endpoints_resolver_test.cpp b/test/net_ip/endpoints_resolver_test.cpp index 952ed26..617d012 100644 --- a/test/net_ip/endpoints_resolver_test.cpp +++ b/test/net_ip/endpoints_resolver_test.cpp @@ -1,19 +1,17 @@ /** @file * - * @ingroup test_module + * @brief Test scenarios for @c make_endpoints functions. * - * @brief Test scenarios for @c make_endpoints functions. + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2018-2024 by Cliff Green * - * Copyright (c) 2018-2019 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "asio/ip/tcp.hpp" #include "asio/ip/udp.hpp" diff --git a/test/net_ip/net_entity_test.cpp b/test/net_ip/net_entity_test.cpp index be5ac06..f8e068f 100644 --- a/test/net_ip/net_entity_test.cpp +++ b/test/net_ip/net_entity_test.cpp @@ -1,19 +1,17 @@ /** @file * - * @ingroup test_module + * @brief Test scenarios for @c net_entity class. * - * @brief Test scenarios for @c net_entity class. + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2018-2024 by Cliff Green * - * Copyright (c) 2018-2019 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include // std::shared_ptr #include // std::ref diff --git a/test/net_ip/net_ip_error_test.cpp b/test/net_ip/net_ip_error_test.cpp index 2940876..b99ede4 100644 --- a/test/net_ip/net_ip_error_test.cpp +++ b/test/net_ip/net_ip_error_test.cpp @@ -1,19 +1,17 @@ /** @file * - * @ingroup test_module + * @brief Test scenarios for @c net_ip error and exception code. * - * @brief Test scenarios for @c net_ip error and exception code. + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2017-2024 by Cliff Green * - * Copyright (c) 2017-2018 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include diff --git a/test/net_ip/net_ip_test.cpp b/test/net_ip/net_ip_test.cpp index c153f21..97495b9 100644 --- a/test/net_ip/net_ip_test.cpp +++ b/test/net_ip/net_ip_test.cpp @@ -1,19 +1,17 @@ /** @file * - * @ingroup test_module + * @brief Test scenarios for @c net_ip class. * - * @brief Test scenarios for @c net_ip class. + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2018-2024 by Cliff Green * - * Copyright (c) 2018-2019 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include // std::error_code #include // std::size_t diff --git a/test/net_ip/simple_variable_len_msg_frame_test.cpp b/test/net_ip/simple_variable_len_msg_frame_test.cpp index 643f1ac..24e7077 100644 --- a/test/net_ip/simple_variable_len_msg_frame_test.cpp +++ b/test/net_ip/simple_variable_len_msg_frame_test.cpp @@ -1,19 +1,17 @@ /** @file * - * @ingroup test_module + * @brief Test the simple variable length message framing functor. * - * @brief Test the simple variable length message framing functor. + * @author Cliff Green * - * @author Cliff Green + * @copyright (c) 2019-2024 by Cliff Green * - * Copyright (c) 2019 by Cliff Green - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "asio/buffer.hpp" diff --git a/test/net_ip/tcp_connector_timeout_test.cpp b/test/net_ip/tcp_connector_timeout_test.cpp index 987e8fb..00b4e0a 100644 --- a/test/net_ip/tcp_connector_timeout_test.cpp +++ b/test/net_ip/tcp_connector_timeout_test.cpp @@ -1,19 +1,17 @@ /** @file * - * @ingroup test_module + * @brief Unit tests for classes and functions in tcp_connector_timeout.hpp. * - * @brief Unit tests for classes and functions in tcp_connector_timeout.hpp. + * @author Nathan Deutsch * - * @author Nathan Deutsch + * @copyright (c) 2019-2024 by Cliff Green, Nathan Deutsch * - * Copyright (c) 2019 by Cliff Green, Nathan Deutsch - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#include "catch2/catch.hpp" +#include "catch2/catch_test_macros.hpp" #include "net_ip/tcp_connector_timeout.hpp" using namespace std::chrono_literals;