|
OpenTTD Source 20251117-master-g7398d2e290
|
Test WindowDescs for valid widget parts. More...
#include "../stdafx.h"#include "../3rdparty/catch2/catch.hpp"#include "mock_environment.h"#include "../window_gui.h"#include "../safeguards.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. | |
| TEST_CASE ("WindowDesc - NWidgetParts properly closed") | |
| TEST_CASE_METHOD (WindowDescTestsFixture, "WindowDesc - NWidgetPart validity") | |
Variables | |
| std::vector< WindowDesc * > * | _window_descs |
| List of WindowDescs. | |
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 68 of file test_window_desc.cpp.
References IsContainerWidgetType(), and WPT_ENDCONTAINER.
| TEST_CASE | ( | "WindowDesc - ini_key uniqueness" | ) |
Definition at line 33 of file test_window_desc.cpp.
| TEST_CASE | ( | "WindowDesc - ini_key validity" | ) |
Definition at line 48 of file test_window_desc.cpp.
| TEST_CASE | ( | "WindowDesc - NWidgetParts properly closed" | ) |
Definition at line 78 of file test_window_desc.cpp.
| TEST_CASE_METHOD | ( | WindowDescTestsFixture | , |
| "WindowDesc - NWidgetPart validity" | |||
| ) |
Definition at line 87 of file test_window_desc.cpp.
|
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 102 of file window.cpp.
Referenced by WindowDesc::LoadFromConfig(), WindowDesc::SaveToConfig(), and WindowDesc::WindowDesc().