Add tst_dropArea
Removed the requirement to have a parent, it's not really needed, conceptually.
This commit is contained in:
@@ -458,6 +458,7 @@ if(KDDockWidgets_TESTS)
|
||||
|
||||
add_test(NAME tst_view COMMAND tst_view)
|
||||
add_test(NAME tst_window COMMAND tst_window)
|
||||
add_test(NAME tst_droparea COMMAND tst_droparea)
|
||||
add_test(NAME tst_platform COMMAND tst_platform)
|
||||
add_test(NAME tst_viewguard COMMAND tst_viewguard)
|
||||
add_test(NAME tst_group COMMAND tst_group)
|
||||
|
||||
@@ -64,11 +64,11 @@ DropArea::DropArea(View *parent, MainWindowOptions options, bool isMDIWrapper)
|
||||
, m_dropIndicatorOverlay(createDropIndicatorOverlay(this))
|
||||
, m_centralFrame(createCentralFrame(options))
|
||||
{
|
||||
Q_ASSERT(parent);
|
||||
setRootItem(new Layouting::ItemBoxContainer(view()));
|
||||
DockRegistry::self()->registerLayout(this);
|
||||
|
||||
setLayoutSize(parent->size());
|
||||
if (parent)
|
||||
setLayoutSize(parent->size());
|
||||
|
||||
// Initialize min size
|
||||
updateSizeConstraints();
|
||||
|
||||
@@ -69,6 +69,9 @@ target_link_libraries(tst_view kddockwidgets kdbindings)
|
||||
add_executable(tst_window tst_window.cpp ${TESTING_RESOURCES})
|
||||
target_link_libraries(tst_window kddockwidgets kdbindings)
|
||||
|
||||
add_executable(tst_droparea tst_droparea.cpp ${TESTING_RESOURCES})
|
||||
target_link_libraries(tst_droparea kddockwidgets kdbindings)
|
||||
|
||||
add_executable(tst_platform tst_platform.cpp ${TESTING_RESOURCES})
|
||||
target_link_libraries(tst_platform kddockwidgets kdbindings)
|
||||
|
||||
|
||||
20
tests/tst_droparea.cpp
Normal file
20
tests/tst_droparea.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
*/
|
||||
|
||||
#include "main.h"
|
||||
#include "controllers/DropArea.h"
|
||||
#include "Platform.h"
|
||||
|
||||
TEST_CASE("DropArea CTOR")
|
||||
{
|
||||
// Tests that ctor runs and doesn't leak
|
||||
Controllers::DropArea da(nullptr, {});
|
||||
}
|
||||
Reference in New Issue
Block a user