Fix tst_QFiledialog::completer

The test was failing because the files it expected to create were not actually
visible on the disk.

This was because 189e9c93d7 made QTemporaryFile
use unnamed files if the file name is not actually requested. Fix by forcing the
temporary file to be made with the requested name.

CI has not caught this because the test executable is marked insignificant_test
on Linux.

Change-Id: Ibe0244fdfcc66acf3be4314da51b4c0b3b520b71
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
bb10
Kari Oikarinen 2018-04-05 09:53:56 +03:00
parent 3e2c930242
commit 32d9cf7310
1 changed files with 3 additions and 0 deletions

View File

@ -471,6 +471,9 @@ void tst_QFiledialog::completer()
for (int i = 0; i < 10; ++i) {
TemporaryFilePtr file(new QTemporaryFile(startPath + QStringLiteral("/rXXXXXX")));
QVERIFY2(file->open(), qPrintable(file->errorString()));
// Force the temporary file to materialize with the requested name
(void) file->fileName();
QVERIFY(file->exists());
files.append(file);
}
}