Make the nameFilters test resilient to file system changes

The test failed reliably when the directory in which the test started had
the same number of files as the directory that the test wants to read.
That's because the QTRY_COMPARE matches immediately and doesn't process
events, which leaves queued signal emissions pending. So, count tests
passed - for the wrong reason - and follow up tests failed.

To make the test robust, start with an invalid directory, which we know
is empty. Once switching into the test directroy, the test will have to
process events.

Remove the BLACKLIST file.

Fixes: QTBUG-90468
Change-Id: I9b3c4dc1a15b0b5ab6c632c12752b038164b9d9d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Volker Hilsheimer 2021-01-26 16:29:57 +01:00
parent bac93541ba
commit 8a485894de
2 changed files with 4 additions and 4 deletions

View File

@ -1,4 +0,0 @@
[nameFilters]
macos ci # QTBUG-90468
msvc-2015
msvc-2017

View File

@ -196,7 +196,11 @@ void tst_qquickfolderlistmodel::nameFilters()
this, SLOT(removed(QModelIndex,int,int)));
QTRY_VERIFY(flm->rowCount() > 0);
// read an invalid directory first...
flm->setProperty("folder", testFileUrl("nosuchdirectory"));
QTRY_COMPARE(flm->property("count").toInt(),0);
flm->setProperty("folder", testFileUrl("resetfiltering"));
// so that the QTRY_COMPARE for 3 entries will process queued signals
QTRY_COMPARE(flm->property("count").toInt(),3); // all files visible
int count = flm->rowCount();