summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-01-12 14:30:28 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-01-16 09:27:45 +0100
commita0c21829eaa2bfc70b4d134c26ac96a63e48a6a5 (patch)
treea1d32c1104eafe68e4ae936bd34996561158f5df
parent9a34b69b7dfa40d19957a61457fc47e25af2d81f (diff)
Android: Fix QSideBar test
On Android, the HOME and TMPDIR environment variables both point to the application sandbox, whereas the QSideBar test assumed they were different. We work around this simply by creating a new directory and using this as the test dir in place of the home directory. Change-Id: I67e01926b901ddf237b05aff116d30b6c7885535 Reviewed-by: BogDan Vatra <bogdan@kde.org>
-rw-r--r--tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp b/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp
index 3ed8e1e88e..273be1d9c3 100644
--- a/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp
+++ b/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp
@@ -113,6 +113,12 @@ void tst_QSidebar::addUrls()
QAbstractItemModel *model = qsidebar.model();
QDir testDir = QDir::home();
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ // temp and home is the same directory on Android
+ testDir.mkdir(QStringLiteral("test"));
+ QVERIFY(testDir.cd(QStringLiteral("test")));
+#endif
+
// default
QCOMPARE(model->rowCount(), 0);