Browse Source

Fix UtilityTest on macOS

Jocelyn Turcotte 9 years ago
parent
commit
867b78052d
2 changed files with 8 additions and 10 deletions
  1. 7 8
      src/libsync/utility.cpp
  2. 1 2
      test/testutility.cpp

+ 7 - 8
src/libsync/utility.cpp

@@ -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)

+ 1 - 2
test/testutility.cpp

@@ -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"