latest changes from main repository

This commit is contained in:
Guenter Obiltschnig
2007-04-25 08:39:02 +00:00
parent f29f7cda53
commit 3e46ab332b
60 changed files with 1619 additions and 163 deletions

View File

@@ -1,7 +1,7 @@
//
// ThreadTest.cpp
//
// $Id: //poco/Main/Foundation/testsuite/src/ThreadTest.cpp#9 $
// $Id: //poco/Main/Foundation/testsuite/src/ThreadTest.cpp#10 $
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
@@ -180,6 +180,21 @@ void ThreadTest::testThreads()
}
void ThreadTest::testJoin()
{
Thread thread;
MyRunnable r;
assert (!thread.isRunning());
thread.start(r);
Thread::sleep(200);
assert (thread.isRunning());
assert (!thread.tryJoin(100));
r.notify();
assert (thread.tryJoin(500));
assert (!thread.isRunning());
}
void ThreadTest::setUp()
{
}
@@ -198,6 +213,7 @@ CppUnit::Test* ThreadTest::suite()
CppUnit_addTest(pSuite, ThreadTest, testNamedThread);
CppUnit_addTest(pSuite, ThreadTest, testCurrent);
CppUnit_addTest(pSuite, ThreadTest, testThreads);
CppUnit_addTest(pSuite, ThreadTest, testJoin);
return pSuite;
}