/* 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 "private/View_p.h" #include "Platform.h" #include "Config.h" #include TEST_CASE("Platform::Platform") { auto plat = Platform::instance(); REQUIRE(plat); } TEST_CASE("Platform::name") { // Checks that Platform::name() returns something auto plat = Platform::instance(); CHECK(!std::string(plat->name()).empty()); } TEST_CASE("Platform::createDefaultViewFactory") { auto plat = Platform::instance(); REQUIRE(plat->createDefaultViewFactory()); } TEST_CASE("Platform::startDragDistance") { auto plat = Platform::instance(); const int defaultDistance = plat->startDragDistance(); CHECK_GE(defaultDistance, -1); const int newDistance = defaultDistance + 1; Config::self().setStartDragDistance(newDistance); CHECK_EQ(plat->startDragDistance(), newDistance); }