1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-31 10:29:10 +00:00

Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc

This commit is contained in:
Rubidium
2024-01-17 04:17:02 +01:00
committed by rubidium42
parent e4b3f3f495
commit 86cb184eb4
64 changed files with 166 additions and 169 deletions

View File

@@ -50,7 +50,7 @@ TEST_CASE("WindowDesc - ini_key validity")
bool has_inikey = window_desc->ini_key != nullptr;
bool has_widget = std::any_of(window_desc->nwid_begin, window_desc->nwid_end, [](const NWidgetPart &part) { return part.type == WWT_DEFSIZEBOX || part.type == WWT_STICKYBOX; });
INFO(fmt::format("{}:{}", window_desc->file, window_desc->line));
INFO(fmt::format("{}:{}", window_desc->source_location.file_name(), window_desc->source_location.line()));
CAPTURE(has_inikey);
CAPTURE(has_widget);
@@ -78,7 +78,7 @@ TEST_CASE("WindowDesc - NWidgetParts properly closed")
{
const WindowDesc *window_desc = GENERATE(from_range(std::begin(*_window_descs), std::end(*_window_descs)));
INFO(fmt::format("{}:{}", window_desc->file, window_desc->line));
INFO(fmt::format("{}:{}", window_desc->source_location.file_name(), window_desc->source_location.line()));
CHECK(IsNWidgetTreeClosed(window_desc->nwid_begin, window_desc->nwid_end));
}
@@ -87,7 +87,7 @@ TEST_CASE_METHOD(WindowDescTestsFixture, "WindowDesc - NWidgetPart validity")
{
const WindowDesc *window_desc = GENERATE(from_range(std::begin(*_window_descs), std::end(*_window_descs)));
INFO(fmt::format("{}:{}", window_desc->file, window_desc->line));
INFO(fmt::format("{}:{}", window_desc->source_location.file_name(), window_desc->source_location.line()));
NWidgetStacked *shade_select = nullptr;
std::unique_ptr<NWidgetBase> root = nullptr;