summaryrefslogtreecommitdiff
path: root/tests/test-Tasks.cc
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-12-04 01:19:09 -0800
committerPixel <pixel@nobis-crew.org>2011-12-04 01:20:10 -0800
commitd440c3f50a918a932293ad98bcec96eaa4683222 (patch)
tree33e8e42a8e4506ae9da70cdb44dd133bde7f7219 /tests/test-Tasks.cc
parente5577eb7a643ce7885e5d14660a6d24254161622 (diff)
Reworked some things in the architecture, mainly exceptions and asserts.
-) Removed Assert() -) Added AAssert(), IAssert(), RAssert(), TAssert() and Failure() -) Reworked all asserts in the code, and added meaningful messages to them. -) Changed the way the startup code is generated; BALAU_STARTUP is no longer necessary.
Diffstat (limited to 'tests/test-Tasks.cc')
-rw-r--r--tests/test-Tasks.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/test-Tasks.cc b/tests/test-Tasks.cc
index 8677fb7..4b26406 100644
--- a/tests/test-Tasks.cc
+++ b/tests/test-Tasks.cc
@@ -2,8 +2,6 @@
#include <Task.h>
#include <TaskMan.h>
-BALAU_STARTUP;
-
using namespace Balau;
class CustomPrinter : public Printer {
@@ -25,7 +23,7 @@ class TestTask : public Task {
static void yieldingFunction() {
Events::Timeout timeout(0.2);
Task::yield(&timeout);
- Assert(timeout.gotSignal());
+ TAssert(timeout.gotSignal());
}
void MainTask::Do() {
@@ -35,22 +33,22 @@ void MainTask::Do() {
Task * testTask = Balau::createTask(new TestTask());
Events::TaskEvent taskEvt(testTask);
waitFor(&taskEvt);
- Assert(!taskEvt.gotSignal());
+ TAssert(!taskEvt.gotSignal());
yield();
- Assert(taskEvt.gotSignal());
+ TAssert(taskEvt.gotSignal());
taskEvt.ack();
Events::Timeout timeout(0.1);
waitFor(&timeout);
- Assert(!timeout.gotSignal());
+ TAssert(!timeout.gotSignal());
yield();
- Assert(timeout.gotSignal());
+ TAssert(timeout.gotSignal());
timeout.set(0.1);
timeout.reset();
waitFor(&timeout);
yieldingFunction();
- Assert(timeout.gotSignal());
+ TAssert(timeout.gotSignal());
Printer::log(M_STATUS, "Test::Tasks passed.");
Printer::log(M_DEBUG, "You shouldn't see that message.");