From 5441f399af7880f3957751d1601354aaec802666 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 11 May 2017 11:50:11 +0200 Subject: [PATCH] Fix tst_QDir::emptyDir It is possible that tmpdir already exists as a leftover from previous tests. That is no reason for the test to fail. Change-Id: I010633fb92defb064093af9872ae6fd2178f07dd Reviewed-by: Friedemann Kleint Reviewed-by: Maurice Kalinowski --- tests/auto/corelib/io/qdir/tst_qdir.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index 946620d61f..da948849f6 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -2322,8 +2322,11 @@ void tst_QDir::cdBelowRoot() void tst_QDir::emptyDir() { const QString tempDir = QDir::currentPath() + "/tmpdir/"; - QVERIFY(QDir().mkdir(tempDir)); - QVERIFY(QDir(tempDir).mkdir("emptyDirectory")); + QDir temp(tempDir); + if (!temp.exists()) { + QVERIFY(QDir().mkdir(tempDir)); + } + QVERIFY(temp.mkdir("emptyDirectory")); QDir testDir(tempDir + "emptyDirectory"); QVERIFY(testDir.isEmpty());