From 79955402924ea21b564cc5eadb624eaa60bdaa27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 26 Jun 2018 15:50:28 +0200 Subject: 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 --- tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/auto/corelib/thread') diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp index 1092216fb7..838431cd5a 100644 --- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp +++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp @@ -32,6 +32,10 @@ #include #include +#ifdef Q_OS_UNIX +#include +#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 -- cgit v1.2.3