From 43842bb668452107ccc82c33a76b2067af6c36fa Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 11 Oct 2020 13:32:29 +0100 Subject: [PATCH] Refactor some formatting code --- src/openrct2/localisation/Formatting.h | 18 ------------------ test/tests/FormattingTests.cpp | 15 ++------------- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/src/openrct2/localisation/Formatting.h b/src/openrct2/localisation/Formatting.h index 1e0089f9e9..1f09ae045d 100644 --- a/src/openrct2/localisation/Formatting.h +++ b/src/openrct2/localisation/Formatting.h @@ -88,24 +88,6 @@ namespace OpenRCT2 } } - template static void FormatString(std::stringstream& ss, FmtString::iterator& it, TArg0 arg0) - { - while (!it.eol()) - { - const auto& token = *it++; - if (CanFormatToken(token.kind)) - { - FormatArgument(ss, token.kind, arg0); - FormatString(ss, it); - } - else - { - ss << token.text; - FormatString(ss, it, arg0); - } - } - } - template static void FormatString(std::stringstream& ss, FmtString::iterator& it, TArg0 arg0, TArgs&&... argN) { diff --git a/test/tests/FormattingTests.cpp b/test/tests/FormattingTests.cpp index 2ebd5f3d65..eb548c7931 100644 --- a/test/tests/FormattingTests.cpp +++ b/test/tests/FormattingTests.cpp @@ -57,23 +57,12 @@ protected: gOpenRCT2Headless = true; gOpenRCT2NoGraphics = true; _context = CreateContext(); - bool initialised = _context->Initialise(); - ASSERT_TRUE(initialised); - - // load_from_sv6(parkPath.c_str()); - // game_load_init(); - - // Changed in some tests. Store to restore its value - // _gScreenFlags = gScreenFlags; - SUCCEED(); + ASSERT_TRUE(_context->Initialise()); } static void TearDownTestCase() { - if (_context) - _context.reset(); - - // gScreenFlags = _gScreenFlags; + _context = {}; } };