tst_qthreadpool: Skip "stackSize" if unsupported
If you're on a Unix platform which don't have the necessary defines then the thread will never be launched due to an error. Skip the test instead. Change-Id: I83159988b8f330a750c7aa328a8805e4fa478070 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>bb10
parent
9fde782695
commit
7995540292
|
|
@ -32,6 +32,10 @@
|
|||
#include <qstring.h>
|
||||
#include <qmutex.h>
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
typedef void (*FunctionPointer)();
|
||||
|
||||
class FunctionPointerTask : public QRunnable
|
||||
|
|
@ -1145,6 +1149,10 @@ void tst_QThreadPool::destroyingWaitsForTasksToFinish()
|
|||
// stack size used by the native thread.
|
||||
void tst_QThreadPool::stackSize()
|
||||
{
|
||||
#if defined(Q_OS_UNIX) && !(defined(_POSIX_THREAD_ATTR_STACKSIZE) && (_POSIX_THREAD_ATTR_STACKSIZE-0 > 0))
|
||||
QSKIP("Setting stack size is unsupported on this platform.");
|
||||
#endif
|
||||
|
||||
uint targetStackSize = 512 * 1024;
|
||||
uint threadStackSize = 1; // impossible value
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue