From a9553ff850543ef6eaea9d4f10c0933d9b1413a6 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Mon, 10 Oct 2016 18:53:16 +0200 Subject: [PATCH] refactor: Cleanup --- include/components/x11/atoms.hpp | 38 ++++++++++++++++---------------- tests/CMakeLists.txt | 3 ++- tests/components/test_logger.cpp | 19 ---------------- 3 files changed, 21 insertions(+), 39 deletions(-) diff --git a/include/components/x11/atoms.hpp b/include/components/x11/atoms.hpp index c22e68db..27842522 100644 --- a/include/components/x11/atoms.hpp +++ b/include/components/x11/atoms.hpp @@ -9,27 +9,27 @@ struct cached_atom { xcb_atom_t* atom; }; -xcb_atom_t _NET_WM_NAME; -xcb_atom_t _NET_WM_WINDOW_TYPE; -xcb_atom_t _NET_WM_WINDOW_TYPE_DOCK; -xcb_atom_t _NET_WM_WINDOW_TYPE_NORMAL; -xcb_atom_t _NET_WM_PID; -xcb_atom_t _NET_WM_STATE; -xcb_atom_t _NET_WM_STATE_STICKY; -xcb_atom_t _NET_WM_STATE_SKIP_TASKBAR; -xcb_atom_t _NET_WM_STATE_ABOVE; -xcb_atom_t WM_PROTOCOLS; -xcb_atom_t WM_DELETE_WINDOW; -xcb_atom_t _XEMBED; -xcb_atom_t _XEMBED_INFO; -xcb_atom_t _NET_SYSTEM_TRAY_OPCODE; -xcb_atom_t MANAGER; -xcb_atom_t WM_STATE; -xcb_atom_t _NET_SYSTEM_TRAY_ORIENTATION; -xcb_atom_t WM_TAKE_FOCUS; +static xcb_atom_t _NET_WM_NAME; +static xcb_atom_t _NET_WM_WINDOW_TYPE; +static xcb_atom_t _NET_WM_WINDOW_TYPE_DOCK; +static xcb_atom_t _NET_WM_WINDOW_TYPE_NORMAL; +static xcb_atom_t _NET_WM_PID; +static xcb_atom_t _NET_WM_STATE; +static xcb_atom_t _NET_WM_STATE_STICKY; +static xcb_atom_t _NET_WM_STATE_SKIP_TASKBAR; +static xcb_atom_t _NET_WM_STATE_ABOVE; +static xcb_atom_t WM_PROTOCOLS; +static xcb_atom_t WM_DELETE_WINDOW; +static xcb_atom_t _XEMBED; +static xcb_atom_t _XEMBED_INFO; +static xcb_atom_t _NET_SYSTEM_TRAY_OPCODE; +static xcb_atom_t MANAGER; +static xcb_atom_t WM_STATE; +static xcb_atom_t _NET_SYSTEM_TRAY_ORIENTATION; +static xcb_atom_t WM_TAKE_FOCUS; // clang-format off -cached_atom ATOMS[18] = { +static cached_atom ATOMS[18] = { {"_NET_WM_NAME", sizeof("_NET_WM_NAME") - 1, &_NET_WM_NAME}, {"_NET_WM_WINDOW_TYPE", sizeof("_NET_WM_WINDOW_TYPE") - 1, &_NET_WM_WINDOW_TYPE}, {"_NET_WM_WINDOW_TYPE_DOCK", sizeof("_NET_WM_WINDOW_TYPE_DOCK") - 1, &_NET_WM_WINDOW_TYPE_DOCK}, diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 79300cb9..90ab8d40 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -12,8 +12,9 @@ file(GLOB_RECURSE source_files "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") make_executable(testrunner SOURCES ${source_files} + TARGET_DEPENDS + lemonlib_static CMAKE_DEPENDS - ${app_binary} cppunit xpp) diff --git a/tests/components/test_logger.cpp b/tests/components/test_logger.cpp index 34767edb..c2dcba2f 100644 --- a/tests/components/test_logger.cpp +++ b/tests/components/test_logger.cpp @@ -11,25 +11,6 @@ class test_logger : public unit_test { CPPUNIT_TEST_SUITE_END(); void test_output() { - // signal(SIGPIPE, SIG_IGN); - // std::string socket_path = BSPWM_SOCKET_PATH; - // const char *env_bs = std::getenv("BSPWM_SOCKET"); - // if (env_bs != nullptr) - // socket_path = std::string(env_bs); - // thread t([&]{ - // this_thread::yield(); - // auto conn = socket_util::make_unix_connection(string{socket_path}); - // - // while (true) { - // if (conn->poll(POLLHUP, 0)) - // printf("conn closed\n"); - // if (conn->poll(POLLIN)) - // printf("has data\n"); - // this_thread::sleep_for(100ms); - // } - // }); - // t.join(); - // auto l = logger::configure(loglevel::TRACE).create(); l.err("error"); l.warn("warning");