Chops Net IP
Loading...
Searching...
No Matches
tcp_io_test.cpp File Reference

Test scenarios for tcp_io detail class. More...

#include "catch2/catch_test_macros.hpp"
#include "asio/ip/tcp.hpp"
#include "asio/connect.hpp"
#include "asio/io_context.hpp"
#include <system_error>
#include <cstddef>
#include <memory>
#include <utility>
#include <thread>
#include <future>
#include <chrono>
#include <functional>
#include <string_view>
#include <cassert>
#include "net_ip/detail/tcp_io.hpp"
#include "net_ip_component/worker.hpp"
#include "shared_test/msg_handling.hpp"
#include "shared_test/msg_handling_start_funcs.hpp"
#include "net_ip/endpoints_resolver.hpp"
#include "buffer/shared_buffer.hpp"
#include <iostream>
Include dependency graph for tcp_io_test.cpp:

Classes

struct  notify_me
 

Typedefs

using notify_prom_type = std::promise<std::error_code>
 
using conn_info = std::pair<std::shared_ptr<chops::net::detail::tcp_io>, std::future<std::error_code>>
 

Functions

conn_info perform_connect (asio::io_context &ioc)
 
std::size_t var_conn_func (const vec_buf &var_msg_vec, asio::io_context &ioc, int interval, std::string_view delim, const chops::const_shared_buffer &empty_msg)
 
std::size_t fixed_conn_func (const vec_buf &fixed_msg_vec, asio::io_context &ioc, int interval)
 
conn_info perform_accept (asio::ip::tcp::acceptor &acc)
 
void perform_test (const vec_buf &var_msg_vec, const vec_buf &fixed_msg_vec, bool reply, int interval, std::string_view delim, const chops::const_shared_buffer &empty_msg)
 
 TEST_CASE ("Tcp IO handler test, variable len header msgs, one-way, interval 50", "[tcp_io] [var_len_msg] [one-way] [interval_50]")
 
 TEST_CASE ("Tcp IO handler test, variable len header msgs, one-way, interval 0", "[tcp_io] [var_len_msg] [one-way] [interval_0]")
 
 TEST_CASE ("Tcp IO handler test, variable len header msgs, two-way, interval 50", "[tcp_io] [var_len_msg] [two_way] [interval_50]")
 
 TEST_CASE ("Tcp IO handler test, variable len header msgs, two-way, interval 0, many msgs", "[tcp_io] [var_len_msg] [two_way] [interval_0] [many]")
 
 TEST_CASE ("Tcp IO handler test, CR / LF msgs, one-way, interval 50", "[tcp_io] [cr_lf_msg] [one-way] [interval_50]")
 
 TEST_CASE ("Tcp IO handler test, CR / LF msgs, one-way, interval 0", "[tcp_io] [cr_lf_msg] [one-way] [interval_0]")
 
 TEST_CASE ("Tcp IO handler test, CR / LF msgs, two-way, interval 30", "[tcp_io] [cr_lf_msg] [two-way] [interval_30]")
 
 TEST_CASE ("Tcp IO handler test, CR / LF msgs, two-way, interval 0, many msgs", "[tcp_io] [cr_lf_msg] [two-way] [interval_0] [many]")
 
 TEST_CASE ("Tcp IO handler test, LF msgs, one-way, interval 50", "[tcp_io] [lf_msg] [one_way] [interval_50]")
 
 TEST_CASE ("Tcp IO handler test, LF msgs, one-way, interval 0", "[tcp_io] [lf_msg] [one_way] [interval_0]")
 
 TEST_CASE ("Tcp IO handler test, LF msgs, two-way, interval 20", "[tcp_io] [lf_msg] [two_way] [interval_20]")
 
 TEST_CASE ("Tcp IO handler test, LF msgs, two-way, interval 0, many msgs", "[tcp_io] [lf_msg] [two_way] [interval_0] [many]")
 

Variables

const char * test_port = "30434"
 
const char * test_addr = "localhost"
 
constexpr int num_msgs = 50
 

Detailed Description

Test scenarios for tcp_io detail class.

Author
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)