Mercurial > irccd
comparison tests/src/plugins/ask/main.cpp @ 636:152d20dc0e74
Irccd: rename plugin::on_ to plugin::handle_, closes #769 @10m
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 15 Mar 2018 12:56:26 +0100 |
parents | 27587ff92a64 |
children | 3e816cebed2c |
comparison
equal
deleted
inserted
replaced
635:b452f5ce799c | 636:152d20dc0e74 |
---|---|
32 : plugin_test(PLUGIN_NAME, PLUGIN_PATH) | 32 : plugin_test(PLUGIN_NAME, PLUGIN_PATH) |
33 { | 33 { |
34 plugin_->set_config({ | 34 plugin_->set_config({ |
35 { "file", CMAKE_CURRENT_SOURCE_DIR "/answers.conf" } | 35 { "file", CMAKE_CURRENT_SOURCE_DIR "/answers.conf" } |
36 }); | 36 }); |
37 plugin_->on_load(irccd_); | 37 plugin_->handle_load(irccd_); |
38 } | 38 } |
39 }; | 39 }; |
40 | 40 |
41 BOOST_FIXTURE_TEST_SUITE(ask_test_suite, ask_test) | 41 BOOST_FIXTURE_TEST_SUITE(ask_test_suite, ask_test) |
42 | 42 |
48 /* | 48 /* |
49 * Invoke the plugin 1000 times, it will be very unlucky to not have both | 49 * Invoke the plugin 1000 times, it will be very unlucky to not have both |
50 * answers in that amount of tries. | 50 * answers in that amount of tries. |
51 */ | 51 */ |
52 for (int i = 0; i < 1000; ++i) { | 52 for (int i = 0; i < 1000; ++i) { |
53 plugin_->on_command(irccd_, {server_, "tester", "#dummy", ""}); | 53 plugin_->handle_command(irccd_, {server_, "tester", "#dummy", ""}); |
54 | 54 |
55 auto cmd = server_->cqueue().front(); | 55 auto cmd = server_->cqueue().front(); |
56 | 56 |
57 BOOST_REQUIRE_EQUAL(cmd["command"].get<std::string>(), "message"); | 57 BOOST_REQUIRE_EQUAL(cmd["command"].get<std::string>(), "message"); |
58 BOOST_REQUIRE_EQUAL(cmd["target"].get<std::string>(), "#dummy"); | 58 BOOST_REQUIRE_EQUAL(cmd["target"].get<std::string>(), "#dummy"); |