10 #include "../stdafx.h"
12 #include "../3rdparty/catch2/catch.hpp"
16 #include "../window_gui.h"
31 TEST_CASE(
"WindowDesc - ini_key uniqueness")
33 std::set<std::string> seen;
37 if (window_desc->ini_key ==
nullptr)
continue;
39 CAPTURE(window_desc->ini_key);
40 CHECK((seen.find(window_desc->ini_key) == std::end(seen)));
42 seen.insert(window_desc->ini_key);
46 TEST_CASE(
"WindowDesc - ini_key validity")
50 bool has_inikey = window_desc->
ini_key !=
nullptr;
51 bool has_widget = std::any_of(std::begin(window_desc->
nwid_parts), std::end(window_desc->
nwid_parts), [](
const NWidgetPart &part) { return part.type == WWT_DEFSIZEBOX || part.type == WWT_STICKYBOX; });
57 CHECK((has_widget == has_inikey));
69 for (
const auto nwid : nwid_parts) {
76 TEST_CASE(
"WindowDesc - NWidgetParts properly closed")
92 std::unique_ptr<NWidgetBase> root =
nullptr;
95 CHECK((root !=
nullptr));