[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.
This commit is contained in:
Martin Flöser 2017-07-29 18:47:58 +02:00
parent 349618c214
commit 1447f4641c
4 changed files with 11 additions and 0 deletions

View file

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

View file

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

View file

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

View file

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