diff --git a/src/openrct2/core/Guard.cpp b/src/openrct2/core/Guard.cpp index f38792f28e..aef1762171 100644 --- a/src/openrct2/core/Guard.cpp +++ b/src/openrct2/core/Guard.cpp @@ -30,11 +30,11 @@ namespace OpenRCT2::Guard static constexpr const utf8* kAssertionMessage = "An assertion failed, please report this to the OpenRCT2 developers."; // The default behaviour when an assertion is raised. - static ASSERT_BEHAVIOUR _assertBehaviour = + static AssertBehaviour _assertBehaviour = #ifdef _WIN32 - ASSERT_BEHAVIOUR::MESSAGE_BOX + AssertBehaviour::messageBox #else - ASSERT_BEHAVIOUR::CASSERT + AssertBehaviour::cAssert #endif ; @@ -45,12 +45,12 @@ namespace OpenRCT2::Guard static void ForceCrash(); #endif - ASSERT_BEHAVIOUR GetAssertBehaviour() + AssertBehaviour GetAssertBehaviour() { return _assertBehaviour; } - void SetAssertBehaviour(ASSERT_BEHAVIOUR behaviour) + void SetAssertBehaviour(AssertBehaviour behaviour) { _assertBehaviour = behaviour; } @@ -99,14 +99,14 @@ namespace OpenRCT2::Guard switch (_assertBehaviour) { - case ASSERT_BEHAVIOUR::ABORT: + case AssertBehaviour::abort: abort(); default: - case ASSERT_BEHAVIOUR::CASSERT: + case AssertBehaviour::cAssert: assert(false); break; #ifdef _WIN32 - case ASSERT_BEHAVIOUR::MESSAGE_BOX: + case AssertBehaviour::messageBox: { // Show message box if we are not building for testing auto buffer = CreateDialogAssertMessage(formattedMessage); diff --git a/src/openrct2/core/Guard.hpp b/src/openrct2/core/Guard.hpp index 50604e2cde..1160de6ff6 100644 --- a/src/openrct2/core/Guard.hpp +++ b/src/openrct2/core/Guard.hpp @@ -16,11 +16,11 @@ #include #include -enum class ASSERT_BEHAVIOUR +enum class AssertBehaviour { - ABORT, - CASSERT, - MESSAGE_BOX, + abort, + cAssert, + messageBox, }; /** @@ -28,8 +28,8 @@ enum class ASSERT_BEHAVIOUR */ namespace OpenRCT2::Guard { - ASSERT_BEHAVIOUR GetAssertBehaviour(); - void SetAssertBehaviour(ASSERT_BEHAVIOUR behaviour); + AssertBehaviour GetAssertBehaviour(); + void SetAssertBehaviour(AssertBehaviour behaviour); void Assert(bool expression, const std::source_location& location = std::source_location::current()); void Assert(bool expression, const char* message, ...); diff --git a/test/tests/ScenarioPatcherTests.cpp b/test/tests/ScenarioPatcherTests.cpp index 7e138267bb..9d66ee29b1 100644 --- a/test/tests/ScenarioPatcherTests.cpp +++ b/test/tests/ScenarioPatcherTests.cpp @@ -36,7 +36,7 @@ TEST(FetchAndApplyScenarioPatch, expected_json_format) std::error_code ec; OpenRCT2::RCT12::SetDryRun(true); - OpenRCT2::Guard::SetAssertBehaviour(ASSERT_BEHAVIOUR::ABORT); + OpenRCT2::Guard::SetAssertBehaviour(AssertBehaviour::abort); static const u8string dummySHA; for (const fs::directory_entry& entry : fs::directory_iterator(scenarioPatches, ec)) { diff --git a/test/tests/tests.cpp b/test/tests/tests.cpp index d776c74f00..9f7b7f20c2 100644 --- a/test/tests/tests.cpp +++ b/test/tests/tests.cpp @@ -17,7 +17,7 @@ int main(int argc, char** argv) { // Abort on an assertions so the tests do not hang - OpenRCT2::Guard::SetAssertBehaviour(ASSERT_BEHAVIOUR::ABORT); + OpenRCT2::Guard::SetAssertBehaviour(AssertBehaviour::abort); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS();