From 867b78052d868280cb96ae6803bee27bd6ad19d3 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 27 Jan 2017 18:12:18 +0100 Subject: [PATCH] Fix UtilityTest on macOS --- src/libsync/utility.cpp | 15 +++++++-------- test/testutility.cpp | 3 +-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/libsync/utility.cpp b/src/libsync/utility.cpp index 4387aa91d..052ba1d17 100644 --- a/src/libsync/utility.cpp +++ b/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) diff --git a/test/testutility.cpp b/test/testutility.cpp index 62125c86f..ce3905a6e 100644 --- a/test/testutility.cpp +++ b/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" -- 2.30.2