summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-10-17 20:52:59 -0700
committerPixel <pixel@nobis-crew.org>2011-10-17 20:52:59 -0700
commit6bd1e79d98f95115c356a9e3e7fdb02dcf221a4e (patch)
tree2ac025f52faff69862a0293588aa4a244d8eb16f
parentb4e4b293d56533f40a4e0dba8afd496ccb6497b7 (diff)
Forgot test-Threads.cc
-rw-r--r--tests/test-Threads.cc28
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.");
+}