qt5base-lts/tests/auto/testlib
Jan Arve Sæther 8c6c4df3e8 Maintain at least 500ms timestamp distance between each test function
If we had one test function that just did

tst_Mouse::f1()
{
    QTest::mouseMove(w, QPoint(0,0));
}

and another test function that did

tst_Mouse::f2()
{
    QTest::mouseMove(w, QPoint(500,500));
}

their corresponding event timestamps were only 1 apart from each other.
This meant that any code that tried to estimate the velocity of a mouse
cursor would get a really high velocity estimate inside f2(). This would
come as a surprise to most people. So to avoid this, we add a 500 ms
timestamp delay between each test function call.

In theory this could also prevent generating a mouseDoubleClickEvent
when a pair of test functions containing a press-release sequence was
run, but there is a separate pre-existing mechanism to handle that case.

Change-Id: Icd4fc35853c09f080466d22411208c7b5c4174b5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-06 09:31:47 +01:00
..
initmain QTestLib: Introduce initMain() to run in main before qApp exists 2019-08-13 19:07:05 +02:00
outformat Test and document QTest::toHexRepresentation() 2018-11-08 15:22:21 +00:00
qabstractitemmodeltester test: migrate QAbstractItemModelTester to QRegularExpression 2019-06-10 09:32:36 +02:00
qsignalspy Introduce QSignalSpy constructor allows to spy on a meta method 2019-08-13 17:26:18 +02:00
selftests Maintain at least 500ms timestamp distance between each test function 2020-02-06 09:31:47 +01:00
testlib.pro QTestLib: Introduce initMain() to run in main before qApp exists 2019-08-13 19:07:05 +02:00