diff options
author | Pixel <pixel@nobis-crew.org> | 2011-10-17 20:52:59 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2011-10-17 20:52:59 -0700 |
commit | 6bd1e79d98f95115c356a9e3e7fdb02dcf221a4e (patch) | |
tree | 2ac025f52faff69862a0293588aa4a244d8eb16f | |
parent | b4e4b293d56533f40a4e0dba8afd496ccb6497b7 (diff) |
Forgot test-Threads.cc
-rw-r--r-- | tests/test-Threads.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test-Threads.cc b/tests/test-Threads.cc new file mode 100644 index 0000000..daebf5f --- /dev/null +++ b/tests/test-Threads.cc @@ -0,0 +1,28 @@ +#include <Main.h> +#include <Threads.h> + +BALAU_STARTUP; + +using namespace Balau; + +class TestThread : public Thread { + private: + virtual void * proc(); +}; + +void * TestThread::proc() { + Printer::log(M_STATUS, "Into a thread"); +} + +void MainTask::Do() { + Printer::log(M_STATUS, "Test::Threads running."); + + TestThread * t = new TestThread(); + Printer::log(M_STATUS, "Starting thread"); + t->threadStart(); + Printer::log(M_STATUS, "Joining thread"); + t->join(); + delete t; + + Printer::log(M_STATUS, "Test::Threads passed."); +} |