From 1d9def9edae0011eeee8f83dc32fb3797ca2f46b Mon Sep 17 00:00:00 2001 From: Pixel Date: Fri, 7 Oct 2011 15:36:12 -0700 Subject: More work in the Task manager. Also fixing a few bugs linked with the printer and TLS. Removed flto from compilation flags: this actually creates bad code (!) --- tests/test-Tasks.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests') diff --git a/tests/test-Tasks.cc b/tests/test-Tasks.cc index bb7c795..2eedb47 100644 --- a/tests/test-Tasks.cc +++ b/tests/test-Tasks.cc @@ -6,8 +6,28 @@ BALAU_STARTUP; using namespace Balau; +class CustomPrinter : public Printer { +}; + +static CustomPrinter * customPrinter = NULL; + +class MainTask : public Task { + public: + virtual const char * getName() { return "MainTask"; } + private: + virtual void Do() { + customPrinter->setLocal(); + Printer::enable(M_ALL); + Printer::log(M_DEBUG, "In MainTask::Do()"); + } +}; + int Application::startup() throw (Balau::GeneralException) { + customPrinter = new CustomPrinter(); Printer::log(M_STATUS, "Test::Tasks running."); + Task * mainTask = new MainTask(); + TaskMan::getTaskMan()->mainLoop(); Printer::log(M_STATUS, "Test::Tasks passed."); + Printer::log(M_DEBUG, "You shouldn't see that message."); return 0; } -- cgit v1.2.3