aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <[email protected]>2017-01-18 23:55:41 +0100
committerAlbert Astals Cid <[email protected]>2017-01-18 23:55:41 +0100
commit9402f67a0d24bbaead68556aad137e746f282cfb (patch)
tree9625326dd26706ad5f0acecc426d6d832a15428a
parentb3f7a272b4206d87b372f2b136c1ea33097143ee (diff)
Use our own temporary dir instead of QDir::tempPath()
If QDir::tempPath() is very full (like it seems CI is now) it can make some of the tests timeout, so workaround that by using our own folder
-rw-r--r--autotests/kfiledialog_unittest.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/autotests/kfiledialog_unittest.cpp b/autotests/kfiledialog_unittest.cpp
index 40a503e..d42a2a0 100644
--- a/autotests/kfiledialog_unittest.cpp
+++ b/autotests/kfiledialog_unittest.cpp
@@ -21,6 +21,7 @@
#include <QTest>
#include <QTimer>
#include <QDir>
+#include <QTemporaryDir>
#include <QTemporaryFile>
#include <QFileDialog>
#include <KFileWidget>
@@ -83,7 +84,7 @@ private Q_SLOTS:
void testSelectUrl()
{
- QTemporaryFile tempFile(QDir::tempPath()+"/kfiledialogtest_XXXXXX");
+ QTemporaryFile tempFile(m_tempDir.path()+"/kfiledialogtest_XXXXXX");
tempFile.setAutoRemove(true);
tempFile.open();
QString tempName = tempFile.fileName();
@@ -102,7 +103,7 @@ private Q_SLOTS:
void testGetSaveFileUrl()
{
QObject lambdaGuard;
- QTemporaryFile tempFile(QDir::tempPath()+"/kfiledialogtest_XXXXXX");
+ QTemporaryFile tempFile(m_tempDir.path()+"/kfiledialogtest_XXXXXX");
tempFile.open();
const QString tempName = tempFile.fileName();
const QUrl url = QUrl::fromLocalFile(tempName);
@@ -262,7 +263,7 @@ private Q_SLOTS:
QFETCH(bool, qtOverwriteOption);
QFETCH(bool, messageBoxExpected);
- QTemporaryFile tempFile(QDir::tempPath()+"/kfiledialogtest_XXXXXX");
+ QTemporaryFile tempFile(m_tempDir.path()+"/kfiledialogtest_XXXXXX");
tempFile.setAutoRemove(true);
tempFile.open();
QString tempName = tempFile.fileName();
@@ -312,6 +313,7 @@ private Q_SLOTS:
}
private:
+ QTemporaryDir m_tempDir;
static QString fileViewToString(KFile::FileView fv)
{