aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2018-06-01 15:58:34 +0200
committerNikolai Kosjar <nikolai.kosjar@qt.io>2018-06-04 09:56:50 +0000
commitc9a3d2bea1743f3f589a2604262b925806348cea (patch)
tree1d26696b42448bb1d5138437b2b558b035c24974 /tests
parentf01fbcb789d86116fac5b9d6ef2ed42862e2c944 (diff)
RunExtensions: Support specifying thread stack size
...with runAsync(). The stack size cannot be changed after starting a thread, so specifying the stack size with a pool does not make sense. However, starting with Qt 5.10 a stack size can be specified for the whole thread pool, if needed. Change-Id: I09eded606321388c779f762b77de6223081609fe Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/runextensions/tst_runextensions.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/runextensions/tst_runextensions.cpp b/tests/auto/runextensions/tst_runextensions.cpp
index acad21b15d..fd0c6609d8 100644
--- a/tests/auto/runextensions/tst_runextensions.cpp
+++ b/tests/auto/runextensions/tst_runextensions.cpp
@@ -42,6 +42,8 @@ private slots:
void moveOnlyType();
#endif
void threadPriority();
+ void threadSize();
+ void threadSizeAndPriority();
void runAsyncNoFutureInterface();
void crefFunction();
void onResultReady();
@@ -399,6 +401,19 @@ void tst_RunExtensions::threadPriority()
QList<int>({0, 2, 1}));
}
+void tst_RunExtensions::threadSize()
+{
+ QCOMPARE(Utils::runAsync(Utils::StackSizeInBytes(1024 * 1024), report3).results(),
+ QList<int>({0, 2, 1}));
+}
+
+void tst_RunExtensions::threadSizeAndPriority()
+{
+ QCOMPARE(Utils::runAsync(Utils::StackSizeInBytes(1024 * 1024), QThread::LowestPriority, report3)
+ .results(),
+ QList<int>({0, 2, 1}));
+}
+
void tst_RunExtensions::runAsyncNoFutureInterface()
{
// free function pointer