diff options
author | flow <flowlnlnln@gmail.com> | 2023-01-20 12:55:38 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2023-01-20 12:55:38 -0300 |
commit | ec1f73c827c127c1dfc2a8cc1760015336cd8845 (patch) | |
tree | b16a206ba1bbacc4d2818d31aa2c9281670e286a /tests/Task_test.cpp | |
parent | 00d42d296e6519c92716d377496ba48c348c95b3 (diff) | |
download | PrismLauncher-ec1f73c827c127c1dfc2a8cc1760015336cd8845.tar.gz PrismLauncher-ec1f73c827c127c1dfc2a8cc1760015336cd8845.tar.bz2 PrismLauncher-ec1f73c827c127c1dfc2a8cc1760015336cd8845.zip |
fix(tests): add some comments on the stack overflow Task test
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'tests/Task_test.cpp')
-rw-r--r-- | tests/Task_test.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/Task_test.cpp b/tests/Task_test.cpp index 5d906851..6649b724 100644 --- a/tests/Task_test.cpp +++ b/tests/Task_test.cpp @@ -47,6 +47,7 @@ class BigConcurrentTask : public QThread { connect(&deadline, &QTimer::timeout, this, [this]{ passed_the_deadline = true; }); deadline.start(); + // NOTE: Arbitrary value that manages to trigger a problem when there is one. static const unsigned s_num_tasks = 1 << 14; auto sub_tasks = new BasicTask*[s_num_tasks]; @@ -229,6 +230,8 @@ class TaskTest : public QObject { QEventLoop loop; auto thread = new BigConcurrentTask; + // NOTE: This is an arbitrary value, big enough to not cause problems on normal execution, but low enough + // so that the number of tasks that needs to get ran to potentially cause a problem isn't too big. thread->setStackSize(32 * 1024); connect(thread, &BigConcurrentTask::finished, &loop, &QEventLoop::quit); |