Fix UtilityTest on macOS
authorJocelyn Turcotte <jturcotte@woboq.com>
Fri, 27 Jan 2017 17:12:18 +0000 (18:12 +0100)
committerJocelyn Turcotte <jturcotte@woboq.com>
Tue, 14 Feb 2017 13:32:41 +0000 (14:32 +0100)
src/libsync/utility.cpp
test/testutility.cpp

index 4387aa91d4caf4584d1902afac485b8641c5662a..052ba1d17a551fe55b995f78182fce25fabedc78 100644 (file)
@@ -273,14 +273,13 @@ void Utility::usleep(int usec)
 
 bool Utility::fsCasePreserving()
 {
-    bool re = false;
-    if( isWindows() || isMac() ) {
-        re = true;
-    } else {
-        bool isTest = qgetenv("OWNCLOUD_TEST_CASE_PRESERVING").toInt();
-        re = isTest;
-    }
-    return re;
+#ifndef WITH_TESTING
+    QByteArray env = qgetenv("OWNCLOUD_TEST_CASE_PRESERVING");
+    if (!env.isEmpty())
+        return env.toInt();
+#endif
+
+    return isWindows() || isMac();
 }
 
 bool Utility::fileNamesEqual( const QString& fn1, const QString& fn2)
index 62125c86f9be6074a9168979cbd863eb831164b0..ce3905a6ea418cce93e121a9b692c4ffe2175cfd 100644 (file)
@@ -169,7 +169,6 @@ private slots:
     void testFileNamesEqual()
     {
 #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
-        qDebug() << "*** checking fileNamesEqual function";
         QTemporaryDir dir;
         QVERIFY(dir.isValid());
         QDir dir2(dir.path());
@@ -201,5 +200,5 @@ private slots:
 
 };
 
-QTEST_APPLESS_MAIN(TestUtility)
+QTEST_GUILESS_MAIN(TestUtility)
 #include "testutility.moc"