diff options
-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."); +} |