summaryrefslogtreecommitdiff
path: root/src/testsuite.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-21 17:27:55 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-21 17:27:55 +0000
commit4d4882d667c2c2eea180219e0c76d15cc1f49415 (patch)
tree86acc379875db7359b342812bd18b7edbe3ee60a /src/testsuite.cpp
parent4e5244a4d82ea5083c401ac04440cb8dd6003941 (diff)
Working thread test!!!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8983 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/testsuite.cpp')
-rw-r--r--src/testsuite.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/testsuite.cpp b/src/testsuite.cpp
index 608179703..719da0313 100644
--- a/src/testsuite.cpp
+++ b/src/testsuite.cpp
@@ -33,10 +33,10 @@ class TestSuiteThread : public Thread
virtual void Run()
{
- while (1)
+ while (GetExitFlag() == false)
{
cout << "Test suite thread run...\n";
- sleep(10);
+ sleep(5);
}
}
};
@@ -110,19 +110,23 @@ bool TestSuite::DoThreadTests()
}
cout << "Creation success!\n";
- cout << "Creating new thread of type TestSuiteThread\n";
-
+ cout << "Creating new thread of type TestSuiteThread...\n";
TestSuiteThread* tst = new TestSuiteThread();
+ cout << "Create new thread based on TestSuiteThread...\n";
te->Create(tst);
- cout << "Press enter to end test.";
- cin >> anything;
+ cout << "Press any key to end test.\n";
+ getchar();
- /* Auto frees thread */
+ /* Thread engine auto frees thread on delete */
+ cout << "Waiting for thread to exit...";
delete tst;
+ cout << "Done!\n";
+ cout << "Delete ThreadEngine... ";
delete te;
+ cout << "Done!\n";
return true;
}