diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2263599142..8075690d4d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -40,6 +40,9 @@ target_link_libraries( testVirtualDesktops set( testClientMachine_SRCS test_client_machine.cpp ../client_machine.cpp + ../utils.cpp + ../atoms.cpp # needed by utils.cpp + ../cursor.cpp # needed by utils.cpp ) kde4_add_unit_test( testClientMachine TESTNAME kwin-TestClientMachine ${testClientMachine_SRCS} ) diff --git a/tests/test_client_machine.cpp b/tests/test_client_machine.cpp index 3802ce4b34..574e688aff 100644 --- a/tests/test_client_machine.cpp +++ b/tests/test_client_machine.cpp @@ -19,6 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "testutils.h" // KWin +#include "../atoms.h" // needed for utils to compile #include "../client_machine.h" #include "../utils.h" #include "../xcbutils.h" @@ -34,25 +35,8 @@ along with this program. If not, see . #include namespace KWin { - -// mock required function from utils -QByteArray getStringProperty(xcb_window_t w, xcb_atom_t prop, char separator) -{ - Q_UNUSED(separator) - ScopedCPointer property(xcb_get_property_reply(connection(), - xcb_get_property_unchecked(connection(), false, w, prop, XCB_ATOM_STRING, 0, 10000), - NULL)); - if (property.isNull()) { - return QByteArray(); - } - void *data = xcb_get_property_value(property.data()); - if (data && property->value_len > 0) { - QByteArray result = QByteArray((const char*) data, property->value_len); - return result; - } - return QByteArray(); -} - +// just to make the linker of utils happy +Atoms* atoms; } using namespace KWin;