From 32d9cf7310a874864799bec13c267fc503e79aba Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Thu, 5 Apr 2018 09:53:56 +0300 Subject: 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 --- tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp | 3 +++ 1 file changed, 3 insertions(+) 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); } } -- cgit v1.2.3