diff --git a/Foundation/testsuite/src/ThreadTest.cpp b/Foundation/testsuite/src/ThreadTest.cpp index 9b05b9b41a..55783c9729 100644 --- a/Foundation/testsuite/src/ThreadTest.cpp +++ b/Foundation/testsuite/src/ThreadTest.cpp @@ -371,10 +371,11 @@ void ThreadTest::testThreadFunction() assertTrue (!thread.isRunning()); - int tmp = MyRunnable::_staticVar; + MyRunnable::_staticVar = 0; + int tmp = 1; thread.start(freeFunc, &tmp); thread.join(); - assertTrue (tmp * 2 == MyRunnable::_staticVar); + assertTrue (tmp == MyRunnable::_staticVar); assertTrue (!thread.isRunning()); @@ -432,15 +433,16 @@ void ThreadTest::testThreadStackSize() assertTrue (0 == thread.getStackSize()); thread.setStackSize(stackSize); assertTrue (stackSize <= thread.getStackSize()); - int tmp = MyRunnable::_staticVar; + MyRunnable::_staticVar = 0; + int tmp = 1; thread.start(freeFunc, &tmp); thread.join(); - assertTrue (tmp * 2 == MyRunnable::_staticVar); + assertTrue (1 == MyRunnable::_staticVar); stackSize = 1; thread.setStackSize(stackSize); -#if !defined(POCO_OS_FAMILY_BSD) // on BSD family, stack size is rounded +#if defined(POCO_OS_FAMILY_BSD) // on BSD family, stack size is rounded #ifdef PTHREAD_STACK_MIN assertTrue (PTHREAD_STACK_MIN == thread.getStackSize()); #else @@ -448,17 +450,18 @@ void ThreadTest::testThreadStackSize() #endif #endif +#if !defined(POCO_OS_FAMILY_BSD) // TODO: temporarily disabled, segfaults on FreeBSD (pthread_join, specifically) tmp = MyRunnable::_staticVar; thread.start(freeFunc, &tmp); thread.join(); assertTrue (tmp * 2 == MyRunnable::_staticVar); - thread.setStackSize(0); assertTrue (0 == thread.getStackSize()); tmp = MyRunnable::_staticVar; thread.start(freeFunc, &tmp); thread.join(); assertTrue (tmp * 2 == MyRunnable::_staticVar); +#endif }