Attempt to fix tests

The poll() function was removed, but perhaps it's doesn't need to be replaced since we now handle
everything in the wesnothd_connection worker thread.
This commit is contained in:
Charles Dang 2019-08-06 20:25:12 +11:00
parent 115cf7df9d
commit 80d26afa31

View file

@ -826,30 +826,11 @@ struct dialog_tester<hotkey_bind>
} }
}; };
struct wesnothd_connection_init
{
wesnothd_connection_init(wesnothd_connection& conn)
{
//Swallow the 'cannot connect' execption so that the connection object doesn't throw while we test the dialog.
try
{
while (true) {
conn.poll();
}
}
catch (...)
{
}
}
};
template<> template<>
struct dialog_tester<mp_lobby> struct dialog_tester<mp_lobby>
{ {
config game_config; config game_config;
wesnothd_connection connection; wesnothd_connection connection;
wesnothd_connection_init init;
std::vector<std::string> installed_addons; std::vector<std::string> installed_addons;
mp::lobby_info li; mp::lobby_info li;
dialog_tester() : connection("", ""), init(connection), li(installed_addons) dialog_tester() : connection("", ""), init(connection), li(installed_addons)
@ -875,7 +856,6 @@ struct dialog_tester<lobby_player_info>
config c; config c;
fake_chat_handler ch; fake_chat_handler ch;
wesnothd_connection connection; wesnothd_connection connection;
wesnothd_connection_init init;
mp::user_info ui; mp::user_info ui;
std::vector<std::string> installed_addons; std::vector<std::string> installed_addons;
mp::lobby_info li; mp::lobby_info li;