diff options
author | Pixel <pixel@nobis-crew.org> | 2011-10-09 21:42:24 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2011-10-09 21:59:27 -0700 |
commit | 4010635b9c3d74e544d37d1e9295316cff01b014 (patch) | |
tree | d7fe054af931604fcb7a7ff1f759ddd3281b81a3 /tests | |
parent | 74adacf6ec1de10b623112605b5d9610163522ec (diff) |
Starting to integrate libev; timer event works.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-Tasks.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/test-Tasks.cc b/tests/test-Tasks.cc index 8de9cf1..148f943 100644 --- a/tests/test-Tasks.cc +++ b/tests/test-Tasks.cc @@ -25,10 +25,20 @@ class TestTask : public Task { void MainTask::Do() { customPrinter = new CustomPrinter(); Printer::log(M_STATUS, "Test::Tasks running."); + Task * testTask = new TestTask(); - Events::TaskEvent e(testTask); - waitFor(&e); + Events::TaskEvent taskEvt(testTask); + waitFor(&taskEvt); + Assert(!taskEvt.gotSignal()); + suspend(); + Assert(taskEvt.gotSignal()); + + Events::Timeout timeout(0.1); + waitFor(&timeout); + Assert(!timeout.gotSignal()); suspend(); + Assert(timeout.gotSignal()); + Printer::log(M_STATUS, "Test::Tasks passed."); Printer::log(M_DEBUG, "You shouldn't see that message."); } |