OpenTTD Source
20241108-master-g80f628063a
|
Test WindowDescs for valid widget parts. More...
#include "../stdafx.h"
#include "../3rdparty/catch2/catch.hpp"
#include "mock_environment.h"
#include "../window_gui.h"
Go to the source code of this file.
Data Structures | |
class | WindowDescTestsFixture |
Functions | |
TEST_CASE ("WindowDesc - ini_key uniqueness") | |
TEST_CASE ("WindowDesc - ini_key validity") | |
static bool | IsNWidgetTreeClosed (std::span< const NWidgetPart > nwid_parts) |
Test if a NWidgetTree is properly closed, meaning the number of container-type parts matches the number of EndContainer() parts. More... | |
TEST_CASE ("WindowDesc - NWidgetParts properly closed") | |
TEST_CASE_METHOD (WindowDescTestsFixture, "WindowDesc - NWidgetPart validity") | |
Variables | |
std::vector< WindowDesc * > * | _window_descs |
List of WindowDescs. More... | |
Test WindowDescs for valid widget parts.
Definition in file test_window_desc.cpp.
|
static |
Test if a NWidgetTree is properly closed, meaning the number of container-type parts matches the number of EndContainer() parts.
nwid_parts | Span of nested widget parts. |
Definition at line 66 of file test_window_desc.cpp.
References IsContainerWidgetType(), and WPT_ENDCONTAINER.
|
extern |
List of WindowDescs.
Defined in window.cpp but not exposed as this unit-test is the only other place that needs it. WindowDesc is a self-registering class so all WindowDescs will be included in the list.
List of WindowDescs.
This is a pointer to ensure initialisation order with the various static WindowDesc instances.
Definition at line 99 of file window.cpp.
Referenced by WindowDesc::LoadFromConfig(), WindowDesc::SaveToConfig(), and WindowDesc::WindowDesc().