#include <boost/test/unit_test.hpp>#include "utils/auto_parameterized.hpp"#include "utils/predicate.hpp"#include "network_worker.hpp"#include "thread.hpp"#include "filesystem.hpp"#include "config.hpp"#include "game_config.hpp"
Go to the source code of this file.
Classes | |
| class | connect_aborter |
| struct | sendfile_param |
| class | auto_resetter< T > |
Defines | |
| #define | GETTEXT_DOMAIN "wesnoth-test" |
Functions | |
| BOOST_AUTO_TEST_CASE (test_connect) | |
| template<class T > | |
| static network::connection | receive (T &cfg, int max_tries=100) |
| BOOST_AUTO_TEST_CASE (test_send_client) | |
| static std::string | create_random_sendfile (size_t size) |
| static void | delete_random_sendfile (const std::string &file) |
| WESNOTH_PARAMETERIZED_TEST_CASE (test_multi_sendfile, sendfile_param, sendfile_sizes, size) | |
| BOOST_AUTO_TEST_CASE (test_shutdown) | |
Variables | |
| const int | TEST_PORT = 15010 |
| Test networking to prevent bugs there. | |
| const int | MIN_THREADS = 1 |
| const int | MAX_THREADS = 5 |
| const std::string | LOCALHOST = "localhost" |
| network::manager * | wes_manager |
| network::server_manager * | wes_server |
| network::connection | client_client1 |
| network::connection | client_client2 |
| network::connection | server_client1 |
| network::connection | server_client2 |
| sendfile_param | sendfile_sizes [] |
| #define GETTEXT_DOMAIN "wesnoth-test" |
Definition at line 16 of file test_network_worker.cpp.
| BOOST_AUTO_TEST_CASE | ( | test_connect | ) |
Definition at line 56 of file test_network_worker.cpp.
References network::accept_connection(), network::connect(), LOCALHOST, network::server_manager::MUST_CREATE_SERVER, and network::nconnections().

| BOOST_AUTO_TEST_CASE | ( | test_shutdown | ) |
Definition at line 293 of file test_network_worker.cpp.
References wes_manager, and wes_server.
| BOOST_AUTO_TEST_CASE | ( | test_send_client | ) |
Definition at line 95 of file test_network_worker.cpp.
References config::add_child(), client_client1, receive(), network::send_data(), and server_client1.

| static std::string create_random_sendfile | ( | size_t | size | ) | [static] |
Definition at line 185 of file test_network_worker.cpp.
References ana::buffer(), and ostream_file().
Referenced by WESNOTH_PARAMETERIZED_TEST_CASE().


| static void delete_random_sendfile | ( | const std::string & | file | ) | [static] |
Definition at line 203 of file test_network_worker.cpp.
References delete_directory().
Referenced by WESNOTH_PARAMETERIZED_TEST_CASE().


| static network::connection receive | ( | T & | cfg, | |
| int | max_tries = 100 | |||
| ) | [static] |
Definition at line 79 of file test_network_worker.cpp.
References network::null_connection, and network::receive_data().
Referenced by BOOST_AUTO_TEST_CASE(), and WESNOTH_PARAMETERIZED_TEST_CASE().


| WESNOTH_PARAMETERIZED_TEST_CASE | ( | test_multi_sendfile | , | |
| sendfile_param | , | |||
| sendfile_sizes | , | |||
| size | ||||
| ) |
Definition at line 223 of file test_network_worker.cpp.
References network::accept_connection(), network::connect(), create_random_sendfile(), delete_random_sendfile(), network::disconnect(), file_size(), LOCALHOST, game_config::path, receive(), network::send_file(), network::set_raw_data_only(), network_worker_pool::set_use_system_sendfile(), and TEST_PORT.

Definition at line 49 of file test_network_worker.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
Definition at line 50 of file test_network_worker.cpp.
| const std::string LOCALHOST = "localhost" |
Definition at line 43 of file test_network_worker.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and WESNOTH_PARAMETERIZED_TEST_CASE().
| const int MAX_THREADS = 5 |
Definition at line 42 of file test_network_worker.cpp.
| const int MIN_THREADS = 1 |
Definition at line 41 of file test_network_worker.cpp.
{sendfile_param(1*1024,true),
sendfile_param(5*1024*1024,true),
sendfile_param(1*1024,false),
sendfile_param(5*1024*1024,false)}
Definition at line 180 of file test_network_worker.cpp.
Definition at line 52 of file test_network_worker.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
Definition at line 53 of file test_network_worker.cpp.
| const int TEST_PORT = 15010 |
Test networking to prevent bugs there.
Try to create all kind of unlikely error conditions Some test should lock management_mutex from worker to settup stress test It is like that this will need some threading also :(
Definition at line 40 of file test_network_worker.cpp.
Referenced by WESNOTH_PARAMETERIZED_TEST_CASE().
Definition at line 46 of file test_network_worker.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
Definition at line 47 of file test_network_worker.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
| Generated by doxygen 1.7.1 on Fri May 25 2012 01:10:43 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |