Mercurial > irccd
comparison tests/src/plugins/tictactoe/main.cpp @ 733:bd12709b1975
Irccd: rework server to be simpler
Server no longer has signals, now user is responsible of calling connect(),
recv() and pass a completion handler. The recv function will complete with a
std::variant of all possible events.
The server does not manage itself anymore, the reconnection system has been
moved to server_service instead.
To simplify reconnection, the limit has been removed now you can only enable
indefinite reconnection or disable it at all.
closes #893
closes #892
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 24 Jul 2018 21:30:00 +0200 |
parents | e8c4ba5ed1c6 |
children | 64839725f346 |
comparison
equal
deleted
inserted
replaced
732:e53b013c8938 | 733:bd12709b1975 |
---|---|
1 /* | 1 /* |
2 * main.cpp -- test plugin plugin | 2 * main.cpp -- test tictactoe plugin |
3 * | 3 * |
4 * Copyright (c) 2013-2018 David Demelier <markand@malikania.fr> | 4 * Copyright (c) 2013-2018 David Demelier <markand@malikania.fr> |
5 * | 5 * |
6 * Permission to use, copy, modify, and/or distribute this software for any | 6 * Permission to use, copy, modify, and/or distribute this software for any |
7 * purpose with or without fee is hereby granted, provided that the above | 7 * purpose with or without fee is hereby granted, provided that the above |
234 | 234 |
235 BOOST_AUTO_TEST_CASE(disconnect) | 235 BOOST_AUTO_TEST_CASE(disconnect) |
236 { | 236 { |
237 auto players = start(); | 237 auto players = start(); |
238 | 238 |
239 server_->disconnect(); | 239 plugin_->handle_disconnect(irccd_, {server_}); |
240 server_->cqueue().clear(); | 240 server_->cqueue().clear(); |
241 plugin_->handle_message(irccd_, {server_, players.first, "#tictactoe", "a 1"}); | 241 plugin_->handle_message(irccd_, {server_, players.first, "#tictactoe", "a 1"}); |
242 | 242 |
243 BOOST_TEST(server_->cqueue().empty()); | 243 BOOST_TEST(server_->cqueue().empty()); |
244 } | 244 } |