summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2018-04-05 09:53:56 +0300
committerKari Oikarinen <kari.oikarinen@qt.io>2018-04-10 08:33:15 +0000
commit32d9cf7310a874864799bec13c267fc503e79aba (patch)
tree4ecd4b0a0202856a7360a24bcde7e522b37dda2e /tests/auto/widgets/dialogs
parent3e2c9302427e4d33745059f8165373bd9b650eae (diff)
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 189e9c93d7ed42202ad51507c8944d64e9a7888d 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>
Diffstat (limited to 'tests/auto/widgets/dialogs')
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index 05410f4a0f..90f8457b7f 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -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);
}
}