Lines Matching +full:timer +full:-

29 #include "utils/signals/timer.hpp"
40 #include <atf-c++.hpp>
56 /// A timer that inserts an element into a vector on activation.
57 class delayed_inserter : public signals::timer {
64 /// Timer activation callback.
75 /// \param delta Time to the timer activation.
80 signals::timer(delta), _destination(destination), _item(item) in delayed_inserter()
97 wait_timers(const std::vector< signals::timer* >& timers) in wait_timers()
102 for (std::vector< signals::timer* >::const_iterator in wait_timers()
104 const signals::timer* timer = *iter; in wait_timers() local
105 if (timer->fired()) in wait_timers()
127 signals::timer timer(datetime::delta(1, 0)); in ATF_TEST_CASE_BODY() local
128 ATF_REQUIRE(!timer.fired()); in ATF_TEST_CASE_BODY()
129 while (!timer.fired()) in ATF_TEST_CASE_BODY()
141 signals::timer timer(datetime::delta(0, 500000)); in ATF_TEST_CASE_BODY() local
142 ATF_REQUIRE(!timer.fired()); in ATF_TEST_CASE_BODY()
143 while (!timer.fired()) in ATF_TEST_CASE_BODY()
157 std::vector< signals::timer* > timers; in ATF_TEST_CASE_BODY()
167 ATF_REQUIRE(!timers[i]->fired()); in ATF_TEST_CASE_BODY()
183 std::vector< signals::timer* > timers; in ATF_TEST_CASE_BODY()
186 // First timer with an activation in the future. in ATF_TEST_CASE_BODY()
189 ATF_REQUIRE(!timers[timers.size() - 1]->fired()); in ATF_TEST_CASE_BODY()
191 // Timer with an activation earlier than the previous one. in ATF_TEST_CASE_BODY()
194 ATF_REQUIRE(!timers[timers.size() - 1]->fired()); in ATF_TEST_CASE_BODY()
196 // Timer with an activation later than all others. in ATF_TEST_CASE_BODY()
199 ATF_REQUIRE(!timers[timers.size() - 1]->fired()); in ATF_TEST_CASE_BODY()
201 // Timer with an activation in between. in ATF_TEST_CASE_BODY()
204 ATF_REQUIRE(!timers[timers.size() - 1]->fired()); in ATF_TEST_CASE_BODY()
224 std::vector< signals::timer* > timers; in ATF_TEST_CASE_BODY()
227 // First timer with an activation in the future. in ATF_TEST_CASE_BODY()
231 // Timer with an activation earlier than the previous one. in ATF_TEST_CASE_BODY()
235 // Timer with an activation later than all others. in ATF_TEST_CASE_BODY()
239 // Timer with an activation in between. in ATF_TEST_CASE_BODY()
243 // Cancel the first timer to reprogram next activation. in ATF_TEST_CASE_BODY()
244 timers[1]->unprogram(); delete timers[1]; timers.erase(timers.begin() + 1); in ATF_TEST_CASE_BODY()
246 // Cancel another timer without reprogramming next activation. in ATF_TEST_CASE_BODY()
247 timers[2]->unprogram(); delete timers[2]; timers.erase(timers.begin() + 2); in ATF_TEST_CASE_BODY()
265 std::vector< signals::timer* > timers; in ATF_TEST_CASE_BODY()
271 // First timer with an activation in the future. in ATF_TEST_CASE_BODY()
274 ATF_REQUIRE(!timers[timers.size() - 1]->fired()); in ATF_TEST_CASE_BODY()
276 // Timer with an activation earlier than the previous one. in ATF_TEST_CASE_BODY()
279 ATF_REQUIRE(!timers[timers.size() - 1]->fired()); in ATF_TEST_CASE_BODY()
283 // Timer with an activation later than all others. in ATF_TEST_CASE_BODY()
316 delayed_inserter* timer = new delayed_inserter( in ATF_TEST_CASE_BODY() local
320 // timer before it was destroyed. However, the handler should run in ATF_TEST_CASE_BODY()
322 timer->unprogram(); in ATF_TEST_CASE_BODY()
323 delete timer; in ATF_TEST_CASE_BODY()
343 timer1->unprogram(); delete timer1; in ATF_TEST_CASE_BODY()
345 // All constructed timers are now dead, so the interval timer should have in ATF_TEST_CASE_BODY()
350 while (!timer2->fired()) in ATF_TEST_CASE_BODY()
352 timer2->unprogram(); delete timer2; in ATF_TEST_CASE_BODY()
367 signals::timer timer(datetime::delta(0, 500000)); in ATF_TEST_CASE_BODY() local
368 timer.unprogram(); in ATF_TEST_CASE_BODY()
370 ATF_REQUIRE(!timer.fired()); in ATF_TEST_CASE_BODY()
378 "timer and the global state are programmed is correct; do so " in ATF_TEST_CASE_HEAD()
379 "by setting an extremely small delay for the timer hoping that " in ATF_TEST_CASE_HEAD()
390 signals::timer timer(datetime::delta(0, 1)); in ATF_TEST_CASE_BODY() local
404 if (timer.fired()) in ATF_TEST_CASE_BODY()
406 timer.unprogram(); in ATF_TEST_CASE_BODY()