From 7fd3cc3980a25bfbc9c0aca935c2afa90230374a Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 22 Sep 2017 11:20:54 -0700 Subject: Clean up OS version checks for Apple platforms Convert QSysInfo/QOperatingSystemVersion to __builtin_available where required or possible, or to QOperatingSystemVersion where __builtin_available cannot be used and is not needed (such as negated conditions, which are not supported by that construct). Change-Id: I83c0e7e777605b99ff4d24598bfcccf22126fdda Reviewed-by: Thiago Macieira --- tests/auto/corelib/kernel/qtimer/qtimer.pro | 2 +- tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp | 4 ++-- tests/auto/gui/kernel/qguitimer/qguitimer.pro | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/kernel/qtimer/qtimer.pro b/tests/auto/corelib/kernel/qtimer/qtimer.pro index b27d862bc5..710dfea682 100644 --- a/tests/auto/corelib/kernel/qtimer/qtimer.pro +++ b/tests/auto/corelib/kernel/qtimer/qtimer.pro @@ -1,6 +1,6 @@ CONFIG += testcase TARGET = tst_qtimer -QT = core testlib +QT = core core-private testlib SOURCES = tst_qtimer.cpp # Force C++17 if available diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp index e17d8ee38b..b921c0f13d 100644 --- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp +++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp @@ -33,11 +33,11 @@ # include #endif +#include #include #include #include -#include #if defined Q_OS_UNIX #include @@ -500,7 +500,7 @@ void tst_QTimer::moveToThread() #if defined(Q_OS_WIN32) QSKIP("Does not work reliably on Windows :("); #elif defined(Q_OS_MACOS) - if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSierra) + if (__builtin_available(macOS 10.12, *)) QSKIP("Does not work reliably on macOS 10.12 (QTBUG-59679)"); #endif QTimer ti1; diff --git a/tests/auto/gui/kernel/qguitimer/qguitimer.pro b/tests/auto/gui/kernel/qguitimer/qguitimer.pro index 8a71e48007..9c58f0e22c 100644 --- a/tests/auto/gui/kernel/qguitimer/qguitimer.pro +++ b/tests/auto/gui/kernel/qguitimer/qguitimer.pro @@ -1,4 +1,4 @@ CONFIG += testcase TARGET = tst_qguitimer -QT = core gui testlib +QT = core core-private gui testlib SOURCES += ../../../corelib/kernel/qtimer/tst_qtimer.cpp -- cgit v1.2.3