comparison tests/src/irccdctl/cli-plugin-reload/main.cpp @ 809:8460b4a34191

misc: reorganize namespaces, closes #952 @4h
author David Demelier <markand@malikania.fr>
date Fri, 16 Nov 2018 12:25:00 +0100
parents 14f9e3b03779
children 28ff6cb5bf73
comparison
equal deleted inserted replaced
808:80bccab4a093 809:8460b4a34191
20 #include <boost/test/unit_test.hpp> 20 #include <boost/test/unit_test.hpp>
21 21
22 #include <irccd/test/cli_fixture.hpp> 22 #include <irccd/test/cli_fixture.hpp>
23 #include <irccd/test/mock.hpp> 23 #include <irccd/test/mock.hpp>
24 24
25 using namespace irccd::test; 25 using irccd::test::cli_fixture;
26 using irccd::test::mock;
27
28 using irccd::daemon::bot;
29 using irccd::daemon::plugin;
26 30
27 namespace irccd { 31 namespace irccd {
28 32
29 namespace { 33 namespace {
30 34
38 auto get_name() const noexcept -> std::string_view override 42 auto get_name() const noexcept -> std::string_view override
39 { 43 {
40 return "reload"; 44 return "reload";
41 } 45 }
42 46
43 void handle_reload(irccd&) override 47 void handle_reload(bot&) override
44 { 48 {
45 push("handle_reload"); 49 push("handle_reload");
46 } 50 }
47 }; 51 };
48 52
58 62
59 BOOST_AUTO_TEST_CASE(simple) 63 BOOST_AUTO_TEST_CASE(simple)
60 { 64 {
61 const auto plugin = std::make_shared<reloadable_plugin>(); 65 const auto plugin = std::make_shared<reloadable_plugin>();
62 66
63 irccd_.plugins().add(plugin); 67 bot_.plugins().add(plugin);
64 start(); 68 start();
65 69
66 const auto [code, out, err] = exec({ "plugin-reload", "test" }); 70 const auto [code, out, err] = exec({ "plugin-reload", "test" });
67 71
68 BOOST_TEST(!code); 72 BOOST_TEST(!code);