From 1447f4641cc9e27b2b4235c2ee5fe5826392e628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Sat, 29 Jul 2017 18:47:58 +0200 Subject: [PATCH] [autotests] Fix unused function warnings The functions are defined in a common header but not used in all tests. This creates needless warning noise, so hide them through an ifdef. --- autotests/CMakeLists.txt | 4 ++++ autotests/libxrenderutils/CMakeLists.txt | 1 + autotests/tabbox/CMakeLists.txt | 2 ++ autotests/testutils.h | 4 ++++ 4 files changed, 11 insertions(+) diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index db4bcb190f..0ae66935f1 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -54,6 +54,7 @@ set( testClientMachine_SRCS ../client_machine.cpp ) add_executable( testClientMachine ${testClientMachine_SRCS} ) +set_target_properties(testClientMachine PROPERTIES COMPILE_DEFINITIONS "NO_NONE_WINDOW") target_link_libraries( testClientMachine Qt5::Concurrent @@ -90,6 +91,7 @@ ecm_mark_as_test(testXcbWrapper) if (XCB_ICCCM_FOUND) add_executable( testXcbSizeHints test_xcb_size_hints.cpp ) + set_target_properties(testXcbSizeHints PROPERTIES COMPILE_DEFINITIONS "NO_NONE_WINDOW") target_link_libraries( testXcbSizeHints Qt5::Test Qt5::X11Extras @@ -130,6 +132,7 @@ set( testBuiltInEffectLoader_SRCS ../effectloader.cpp ) add_executable( testBuiltInEffectLoader ${testBuiltInEffectLoader_SRCS}) +set_target_properties(testBuiltInEffectLoader PROPERTIES COMPILE_DEFINITIONS "NO_NONE_WINDOW") target_link_libraries(testBuiltInEffectLoader Qt5::Concurrent @@ -292,6 +295,7 @@ kconfig_add_kcfg_files(testScreenEdges_SRCS ../settings.kcfgc) qt5_add_dbus_interface( testScreenEdges_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../org.freedesktop.ScreenSaver.xml screenlocker_interface) add_executable( testScreenEdges ${testScreenEdges_SRCS}) +set_target_properties(testScreenEdges PROPERTIES COMPILE_DEFINITIONS "NO_NONE_WINDOW") target_include_directories(testScreenEdges BEFORE PRIVATE ./) target_link_libraries(testScreenEdges Qt5::DBus diff --git a/autotests/libxrenderutils/CMakeLists.txt b/autotests/libxrenderutils/CMakeLists.txt index 167510ab81..b78b18efca 100644 --- a/autotests/libxrenderutils/CMakeLists.txt +++ b/autotests/libxrenderutils/CMakeLists.txt @@ -1,4 +1,5 @@ add_executable(blendPictureTest blendpicture_test.cpp) +set_target_properties(blendPictureTest PROPERTIES COMPILE_DEFINITIONS "NO_NONE_WINDOW") add_test(xrenderutils-blendPictureTest blendPictureTest) target_link_libraries(blendPictureTest kwinxrenderutils diff --git a/autotests/tabbox/CMakeLists.txt b/autotests/tabbox/CMakeLists.txt index cf7ee23207..0cbfa2332d 100644 --- a/autotests/tabbox/CMakeLists.txt +++ b/autotests/tabbox/CMakeLists.txt @@ -15,6 +15,7 @@ set( testTabBoxClientModel_SRCS ) add_executable( testTabBoxClientModel ${testTabBoxClientModel_SRCS} ) +set_target_properties(testTabBoxClientModel PROPERTIES COMPILE_DEFINITIONS "NO_NONE_WINDOW") target_link_libraries( testTabBoxClientModel Qt5::Core Qt5::Gui @@ -45,6 +46,7 @@ set( testTabBoxHandler_SRCS ) add_executable( testTabBoxHandler ${testTabBoxHandler_SRCS} ) +set_target_properties(testTabBoxHandler PROPERTIES COMPILE_DEFINITIONS "NO_NONE_WINDOW") target_link_libraries( testTabBoxHandler Qt5::Core Qt5::Gui diff --git a/autotests/testutils.h b/autotests/testutils.h index 2b5e5450ed..103a81cd16 100644 --- a/autotests/testutils.h +++ b/autotests/testutils.h @@ -35,6 +35,7 @@ namespace KWin { /** * Wrapper to create an 0,0x10,10 input only window for testing purposes **/ +#ifndef NO_NONE_WINDOW static xcb_window_t createWindow() { xcb_window_t w = xcb_generate_id(connection()); @@ -45,14 +46,17 @@ static xcb_window_t createWindow() XCB_CW_OVERRIDE_REDIRECT, values); return w; } +#endif /** * casts XCB_WINDOW_NONE to uint32_t. Needed to make QCOMPARE working. **/ +#ifndef NO_NONE_WINDOW static uint32_t noneWindow() { return XCB_WINDOW_NONE; } +#endif } // namespace