diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-Http.cc | 6 | ||||
-rw-r--r-- | tests/test-Sockets.cc | 11 | ||||
-rw-r--r-- | tests/test-Tasks.cc | 4 |
3 files changed, 13 insertions, 8 deletions
diff --git a/tests/test-Http.cc b/tests/test-Http.cc index bd0ef49..f54fba0 100644 --- a/tests/test-Http.cc +++ b/tests/test-Http.cc @@ -118,10 +118,10 @@ void MainTask::Do() { yield(); waitFor(&event); - Task * stopper = new Stopper; - Events::TaskEvent stopperEvent(stopper); + + Events::TaskEvent stopperEvent; + Task * stopper = TaskMan::registerTask(new Stopper, &stopperEvent); waitFor(&stopperEvent); - TaskMan::createTask(stopper); bool gotEvent = false, gotStopperEvent = false; int count = 0; diff --git a/tests/test-Sockets.cc b/tests/test-Sockets.cc index c576c97..4ef0a78 100644 --- a/tests/test-Sockets.cc +++ b/tests/test-Sockets.cc @@ -62,11 +62,16 @@ void MainTask::Do() { Printer::enable(M_ALL); Printer::log(M_STATUS, "Test::Sockets running."); - Events::TaskEvent evtSvr(listener = TaskMan::createTask(new Listener<Worker>(1234))); - Events::TaskEvent evtCln(TaskMan::createTask(new Client)); - Printer::log(M_STATUS, "Created %s", listener->getName()); + Events::TaskEvent evtSvr; + Events::TaskEvent evtCln; + + listener = TaskMan::registerTask(new Listener<Worker>(1234), &evtSvr); + TaskMan::registerTask(new Client, &evtCln); + waitFor(&evtSvr); waitFor(&evtCln); + + Printer::log(M_STATUS, "Created %s", listener->getName()); bool svrDone = false, clnDone = false; while (!svrDone || !clnDone) { yield(); diff --git a/tests/test-Tasks.cc b/tests/test-Tasks.cc index 60d1dd3..da5346f 100644 --- a/tests/test-Tasks.cc +++ b/tests/test-Tasks.cc @@ -30,8 +30,8 @@ void MainTask::Do() { customPrinter = new CustomPrinter(); Printer::log(M_STATUS, "Test::Tasks running."); - Task * testTask = TaskMan::createTask(new TestTask()); - Events::TaskEvent taskEvt(testTask); + Events::TaskEvent taskEvt; + Task * testTask = TaskMan::registerTask(new TestTask(), &taskEvt); waitFor(&taskEvt); TAssert(!taskEvt.gotSignal()); yield(); |