diff --git a/tests/qt-macros/config.json b/tests/qt-macros/config.json index f88cbf0..33dcbfb 100644 --- a/tests/qt-macros/config.json +++ b/tests/qt-macros/config.json @@ -1,8 +1,13 @@ { "tests" : [ { "filename" : "main.cpp", "minimum_clang_version" : 370 + }, + { + "filename" : "q_os_windows.cpp", + "minimum_clang_version" : 370, + "maximum_qt_version" : 51203 } ] } diff --git a/tests/qt-macros/main.cpp b/tests/qt-macros/main.cpp index 707dd4f..c31c178 100644 --- a/tests/qt-macros/main.cpp +++ b/tests/qt-macros/main.cpp @@ -1,19 +1,13 @@ #ifdef Q_OS_WIN // Warning: testing before including qglobal.h #endif #if defined(Q_OS_WIN) // Warning: testing before including qglobal.h #endif #include -#if defined(Q_OS_WINDOWS) // Warning, should be Q_OS_WIN -#endif - -#ifdef Q_OS_WINDOWS // Warning, should be Q_OS_WIN -#endif - #ifdef Q_OS_WIN // OK #endif #if defined(Q_OS_WIN) // OK #endif diff --git a/tests/qt-macros/main.cpp.expected b/tests/qt-macros/main.cpp.expected index 82f7f82..d520992 100644 --- a/tests/qt-macros/main.cpp.expected +++ b/tests/qt-macros/main.cpp.expected @@ -1,4 +1,2 @@ qt-macros/main.cpp:1:2: warning: Include qglobal.h before testing Q_OS_ macros [-Wclazy-qt-macros] qt-macros/main.cpp:4:5: warning: Include qglobal.h before testing Q_OS_ macros [-Wclazy-qt-macros] -qt-macros/main.cpp:9:5: warning: Q_OS_WINDOWS was only introduced in Qt 5.12.4, use Q_OS_WIN instead [-Wclazy-qt-macros] -qt-macros/main.cpp:12:2: warning: Q_OS_WINDOWS was only introduced in Qt 5.12.4, use Q_OS_WIN instead [-Wclazy-qt-macros] diff --git a/tests/qt-macros/q_os_windows.cpp b/tests/qt-macros/q_os_windows.cpp new file mode 100644 index 0000000..e8c9331 --- /dev/null +++ b/tests/qt-macros/q_os_windows.cpp @@ -0,0 +1,4 @@ +#include + +#if defined(Q_OS_WINDOWS) // Warning, should be Q_OS_WIN +#endif