From a0c21829eaa2bfc70b4d134c26ac96a63e48a6a5 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 12 Jan 2015 14:30:28 +0100 Subject: 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 --- tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') 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); -- cgit v1.2.3