diff --git a/CMakeLists.txt b/CMakeLists.txt index f5090f61..32857c41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -357,6 +357,7 @@ if(${PROJECT_NAME}_TESTS) add_test(NAME tst_viewwrapper COMMAND tst_viewwrapper) add_test(NAME tst_viewguard COMMAND tst_viewguard) add_test(NAME tst_frame COMMAND tst_frame) + add_test(NAME tst_titlebar COMMAND tst_titlebar) if(NOT ${PROJECT_NAME}_QTQUICK) # tst_multisplitter depends on QWidget diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 40356706..084ddee9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -63,4 +63,7 @@ add_executable(tst_viewwrapper tst_viewwrapper.cpp ${TESTING_RESOURCES}) target_link_libraries(tst_viewwrapper kddockwidgets) add_executable(tst_frame controllers/tst_frame.cpp ${TESTING_RESOURCES}) -target_link_libraries(tst_frame kddockwidgets) \ No newline at end of file +target_link_libraries(tst_frame kddockwidgets) + +add_executable(tst_titlebar controllers/tst_titlebar.cpp ${TESTING_RESOURCES}) +target_link_libraries(tst_titlebar kddockwidgets) \ No newline at end of file diff --git a/tests/controllers/tst_titlebar.cpp b/tests/controllers/tst_titlebar.cpp new file mode 100644 index 00000000..38df7c4f --- /dev/null +++ b/tests/controllers/tst_titlebar.cpp @@ -0,0 +1,27 @@ +/* + This file is part of KDDockWidgets. + + SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company + Author: Sérgio Martins + + SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only + + Contact KDAB at for commercial licensing options. +*/ + +#include "../main.h" +#include "controllers/TitleBar.h" +#include "controllers/Frame.h" + +#include "qtquick/Platform_qtquick.h" + +#include +#include + +TEST_CASE("TitleBar Ctor") +{ + auto frame = new Controllers::Frame(nullptr, {}); + auto tb = new Controllers::TitleBar(frame); + delete tb; + delete frame; +}