Mercurial > irccd
comparison tests/js-timer/main.cpp @ 172:66d3ef1c42b3
Irccd: unbreak test-js-timer
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 25 May 2016 22:39:42 +0200 |
parents | 77c90336ba56 |
children | cb61cc16e2b6 |
comparison
equal
deleted
inserted
replaced
171:a02756832959 | 172:66d3ef1c42b3 |
---|---|
32 Irccd irccd; | 32 Irccd irccd; |
33 ElapsedTimer timer; | 33 ElapsedTimer timer; |
34 | 34 |
35 auto plugin = std::make_shared<JsPlugin>("timer", IRCCD_TESTS_DIRECTORY "/timer-single.js"); | 35 auto plugin = std::make_shared<JsPlugin>("timer", IRCCD_TESTS_DIRECTORY "/timer-single.js"); |
36 | 36 |
37 plugin->onLoad(irccd); | |
37 irccd.pluginService().add(plugin); | 38 irccd.pluginService().add(plugin); |
38 | 39 |
39 while (timer.elapsed() < 3000) { | 40 while (timer.elapsed() < 3000) { |
40 irccd.poll(); | 41 irccd.poll(); |
41 irccd.dispatch(); | 42 irccd.dispatch(); |
49 Irccd irccd; | 50 Irccd irccd; |
50 ElapsedTimer timer; | 51 ElapsedTimer timer; |
51 | 52 |
52 auto plugin = std::make_shared<JsPlugin>("timer", IRCCD_TESTS_DIRECTORY "/timer-repeat.js"); | 53 auto plugin = std::make_shared<JsPlugin>("timer", IRCCD_TESTS_DIRECTORY "/timer-repeat.js"); |
53 | 54 |
55 plugin->onLoad(irccd); | |
54 irccd.pluginService().add(plugin); | 56 irccd.pluginService().add(plugin); |
55 | 57 |
56 while (timer.elapsed() < 3000) { | 58 while (timer.elapsed() < 3000) { |
57 irccd.poll(); | 59 irccd.poll(); |
58 irccd.dispatch(); | 60 irccd.dispatch(); |
86 | 88 |
87 #endif | 89 #endif |
88 | 90 |
89 int main(int argc, char **argv) | 91 int main(int argc, char **argv) |
90 { | 92 { |
91 /* Needed for some components */ | 93 // Needed for some components. |
92 sys::setProgramName("irccd"); | 94 sys::setProgramName("irccd"); |
93 path::setApplicationPath(argv[0]); | 95 path::setApplicationPath(argv[0]); |
94 log::setInterface(std::make_unique<log::Console>()); | 96 log::setInterface(std::make_unique<log::Silent>()); |
95 log::setVerbose(true); | 97 log::setVerbose(true); |
96 testing::InitGoogleTest(&argc, argv); | 98 testing::InitGoogleTest(&argc, argv); |
97 | 99 |
98 return RUN_ALL_TESTS(); | 100 return RUN_ALL_TESTS(); |
99 } | 101 } |