summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2011-11-03 19:12:53 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-04 10:53:41 +0100
commitae6e7e3d59439008e7369da8083f4e5c4f6f980a (patch)
treeb0fe328773fe68e14135a47b3f51c7dad3aa0687
parent141dbaf49684dfb1d9ccb92ea023c7c8d57a0f6e (diff)
Fix tst_qstandardpaths: Mac OSX is a unix, but doesn't use XDG.
Change-Id: I2b4552a162dc9f993e0587ace6e7e3fb4f96571e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
index 00f52fb8d1..d8b22ae134 100644
--- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
+++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
@@ -50,6 +50,10 @@
#include <sys/types.h>
#endif
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
+#define Q_XDG_PLATFORM
+#endif
+
//TESTED_CLASS=QStandardPaths
//TESTED_FILES=qstandardpaths.cpp
@@ -91,7 +95,7 @@ private:
void tst_qstandardpaths::testDefaultLocations()
{
-#ifndef Q_OS_WIN
+#ifdef Q_XDG_PLATFORM
qputenv("XDG_CONFIG_HOME", QByteArray());
qputenv("XDG_CONFIG_DIRS", QByteArray());
const QString expectedConfHome = QDir::homePath() + QString::fromLatin1("/.config");
@@ -113,7 +117,7 @@ void tst_qstandardpaths::testDefaultLocations()
void tst_qstandardpaths::testCustomLocations()
{
-#ifndef Q_OS_WIN
+#ifdef Q_XDG_PLATFORM
setCustomLocations();
// test writableLocation()
@@ -140,7 +144,7 @@ void tst_qstandardpaths::testCustomLocations()
void tst_qstandardpaths::testLocateAll()
{
-#ifndef Q_OS_WIN
+#ifdef Q_XDG_PLATFORM
const QStringList appsDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "applications", QStandardPaths::LocateDirectory);
//qDebug() << appsDirs;
foreach (const QString &dir, appsDirs)
@@ -220,7 +224,7 @@ void tst_qstandardpaths::testRuntimeDirectory()
QVERIFY(!runtimeDir.isEmpty());
// Check that it can automatically fix permissions
-#ifdef Q_OS_UNIX
+#ifdef Q_XDG_PLATFORM
QFile file(runtimeDir);
const QFile::Permissions wantedPerms = QFile::ReadUser | QFile::WriteUser | QFile::ExeUser;
const QFile::Permissions additionalPerms = QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner;
@@ -234,7 +238,7 @@ void tst_qstandardpaths::testRuntimeDirectory()
void tst_qstandardpaths::testCustomRuntimeDirectory()
{
-#ifdef Q_OS_UNIX
+#ifdef Q_XDG_PLATFORM
qputenv("XDG_RUNTIME_DIR", QFile::encodeName("/tmp"));
// It's very unlikely that /tmp is 0600 or that we can chmod it
// The call below outputs