qt6-bb10/tests/auto
Ivan Solovev 612b67cf13 QTimer: do not set active state when setting a negative interval
QObject::startTimer() returns 0 in case of failure, for example when
someone tries to register a timer with a negative interval.

However, QTimer internally uses -1 as an invalid timer id.
This could lead to a situation when the timer was not really started,
but QTimer::isActive() returned true.

This patch fixes it in two ways:
- check the return value of QObject::startTimer() and treat 0 as an
  error.
- do not treat 0 as a valid timer id when calculating the active state.

As a drive-by: move the `using namespace std::chrono_literals;`
declaration to the top of tst_qtimer.cpp, so that we do not need to
repeat it in each test case.

Fixes: QTBUG-122087
Pick-to: 6.7 6.6 6.5
Change-Id: I0e21152b2173ebb5fb0dada1b99a903a321ca9c4
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-02-12 23:49:54 +01:00
..
bic/data Add binary compatibility file for 6.6.0 2023-10-17 22:23:42 +03:00
cmake CMake: Add test for configuring a standalone test 2024-02-08 15:40:04 +01:00
concurrent Remove extra semi-colons 2024-02-06 20:17:18 +09:00
corelib QTimer: do not set active state when setting a negative interval 2024-02-12 23:49:54 +01:00
dbus Remove extra semi-colons 2024-02-06 20:17:18 +09:00
gui QFileSystemMetaData: use QTRY_COMPARE*(10s) 2024-02-09 22:33:04 +02:00
guiapplauncher Turn the "concentriccircles" example into snippets, update screenshot 2023-12-14 20:06:32 +01:00
network Add QNetworkRequestFactory::(set)?Priority 2024-02-08 11:38:10 +01:00
opengl tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
other Change license for tests files 2024-02-04 09:56:42 +01:00
printsupport Change license for tests files 2024-02-04 09:56:42 +01:00
shared Change license for tests files 2024-02-04 09:56:42 +01:00
sql Change license for tests files 2024-02-04 09:56:42 +01:00
testlib QTest: allow passing chrono literal as QTRY_ timeout 2024-02-07 12:15:09 +00:00
tools Change license for tests files 2024-02-04 09:56:42 +01:00
wasm wasm: Refractor Selenium manual test into auto test 2024-02-07 13:15:09 +01:00
widgets tst_QWidgetRepaintManager::scrollWithOverlap(): Disable scroll bars 2024-02-12 21:09:18 +01:00
xml Change license for tests files 2024-02-04 09:56:42 +01:00
CMakeLists.txt CI: Enable some tests under corelib/thread for Wasm platform 2023-09-14 11:58:48 +02:00
network-settings.h Change license for tests files 2024-02-04 09:56:42 +01:00