aboutsummaryrefslogtreecommitdiff
path: root/autotests/kconfigtest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'autotests/kconfigtest.cpp')
-rw-r--r--autotests/kconfigtest.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp
index 410b5b80..9af3b464 100644
--- a/autotests/kconfigtest.cpp
+++ b/autotests/kconfigtest.cpp
@@ -38,7 +38,7 @@
#include <utime.h>
#endif
#ifndef Q_OS_WIN
-#include <unistd.h> // gethostname
+#include <unistd.h> // getuid
#endif
KCONFIGGROUP_DECLARE_ENUM_QOBJECT(KConfigTest, Testing)
@@ -546,14 +546,8 @@ void KConfigTest::testPath()
QCOMPARE(group.readPathEntry("withBraces", QString()), QString("file://" + HOMEPATH));
QVERIFY(group.hasKey("URL"));
QCOMPARE(group.readEntry("URL", QString()), QString("file://" + HOMEPATH));
-#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
- // I don't know if this will work on windows
- // This test hangs on OS X
QVERIFY(group.hasKey("hostname"));
- char hostname[256];
- QVERIFY(::gethostname(hostname, sizeof(hostname)) == 0);
- QCOMPARE(group.readEntry("hostname", QString()), QString::fromLatin1(hostname));
-#endif
+ QCOMPARE(group.readEntry("hostname", QString()), QStringLiteral("(hostname)")); // the $ got removed because empty var name
QVERIFY(group.hasKey("noeol"));
QCOMPARE(group.readEntry("noeol", QString()), QString("foo"));