TestCase: make failOnWarning() functional on temp objects destruction
We need to be able to handle warnings that may occur when temporary objects, that were created in a test function, are destroyed. Now, with 18aa36cf878a52b8fe991392098e9445c3d3bfe3, we need only to wait before calling finishTestDataCleanup() to ensure that the objects marked for deletion are completely deleted. Without this patch, we may not fail on warnings like this: QWARN : tst_controls::Basic::ComboBox::test_mouseHighlight() qrc:/qt-project.org/imports/QtTest/SignalSpy.qml:55: TypeError: Property 'disconnect' of object true is not a function Change-Id: I990d65005ecf88633f25dcd317846804ae9fdfd1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit488abf9abd
) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commita796785d7d
)
This commit is contained in:
parent
2c57f0ba4b
commit
5307eb7b17
|
@ -1895,10 +1895,12 @@ Item {
|
|||
qtest_results.finishTestData()
|
||||
qtest_runInternal("cleanup")
|
||||
qtest_destroyTemporaryObjects()
|
||||
qtest_results.finishTestDataCleanup()
|
||||
|
||||
// wait(0) will call processEvents() so objects marked for deletion
|
||||
// in the test function will be deleted.
|
||||
wait(0)
|
||||
|
||||
qtest_results.finishTestDataCleanup()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue