kwin/tabbox/tests/CMakeLists.txt
Martin Gräßlin bd7958392d Verify pointer is valid when calculating the longest caption
The method was missing a check whether the weak pointers in the
internal list got deleted. This could in very unlikely cases
lead to a crash.

In order to verify that adding the null pointer check fixes the
crash a unit test is added to simulate the situation of a
pointer being deleted. This required to add a mock a few
classes of TabBox. A MockTabBoxHandler and MockTabBoxClient are
added implementing the specific interfaces. The DeclarativeView
is completely mocked to make the linker happy. Including the
actual implementation is not possible as it pulls in half of
KWin core.

BUG: 303840
FIXED-IN: 4.9.0
REVIEW: 105645
2012-07-22 19:23:36 +02:00

17 lines
652 B
CMake

########################################################
# Test TabBox::ClientModel
########################################################
set( testTabBoxClientModel_SRCS
../clientmodel.cpp
../desktopmodel.cpp
../tabboxconfig.cpp
../tabboxhandler.cpp
test_tabbox_clientmodel.cpp
mock_declarative.cpp
mock_tabboxhandler.cpp
mock_tabboxclient.cpp
)
kde4_add_unit_test( testTabBoxClientModel TESTNAME testTabBoxClientModel ${testTabBoxClientModel_SRCS} )
target_link_libraries( testTabBoxClientModel ${KDE4_KDEUI_LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${QT_QTTEST_LIBRARY} )