From d440c3f50a918a932293ad98bcec96eaa4683222 Mon Sep 17 00:00:00 2001 From: Pixel Date: Sun, 4 Dec 2011 01:19:09 -0800 Subject: 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. --- tests/test-Tasks.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'tests/test-Tasks.cc') 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 #include -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."); -- cgit v1.2.3