qt5base-lts/tests/auto/corelib/kernel
Volker Hilsheimer fc319a8f8b Fix QTimer::crossThreadSingleShotToFunctor test
Amends 4d90c4e74a, after which the test
became flaky. We need to wait for the functor to be called before
quitting the thread, otherwise we have no guarnatee that any of the
queued metacall events have been processed by the thread. Since
QThread::quit is thread-safe, we can just call it from within the
functor. This guarantees that at least one of the single-shot timers
is processed before we quit.

And since QTimer::singleShot has special code paths for 0-ms timers
(going through an explicitly queued QMetaObject::invokeMethod call
rather than through an actual QSingleShotTimer object), we need to run
the test logic with different timeouts to cover both code paths.

Task-number: QTBUG-112162
Pick-to: 6.5 6.2 5.15
Change-Id: Ide1e7b4b74dcbda72144a0d73ef5f64b0694ddbc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-30 19:17:25 +02:00
..
qapplicationstatic Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qcoreapplication tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qdeadlinetimer tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qelapsedtimer tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qeventdispatcher QThread: add sleep(std::chrono::nanoseconds) overload 2023-03-13 23:26:28 +02:00
qeventloop tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qjnienvironment CMake: Remove direct qt_android_generate_deployment_settings call 2022-12-15 20:23:28 +01:00
qjniobject CMake: Remove direct qt_android_generate_deployment_settings call 2022-12-15 20:23:28 +01:00
qjnitypes JNI: add generic support for array-types 2022-10-10 20:19:30 +02:00
qmath tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qmetacontainer tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qmetaenum tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qmetamethod tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qmetaobject tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qmetaobjectbuilder tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qmetaproperty tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qmetatype QMetaType: Provide underlyingType for enums 2023-03-28 10:59:53 +02:00
qmimedata tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qobject Make it possible to use QObjectPrivate::connect in private code 2023-03-10 15:39:37 +01:00
qpermission Q{Contacts,Calendar}Permission: bool readWrite → enum AccessMode 2023-02-02 14:34:02 +01:00
qpointer tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qproperty Fix QPropertyAlias::addNotifier 2023-03-09 16:24:45 +01:00
qsignalblocker tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qsignalmapper tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qsocketnotifier QTestEventLoop: add enterLoop(std::chrono::milliseconds) overload 2023-03-03 21:36:48 +02:00
qtimer Fix QTimer::crossThreadSingleShotToFunctor test 2023-03-30 19:17:25 +02:00
qtranslator tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qvariant tst_QVariant: add a test contrasting Qt 5/6 isNull behavior 2023-03-24 06:40:27 +01:00
qwineventnotifier tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qwinregistrykey QWinRegistryKey: Fix how we handle the default value, take 2 2022-10-28 09:27:13 +00:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00