From 344b8d01818be06b336186041c85993f4368f2f6 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 3 Nov 2021 14:51:06 -0700 Subject: [PATCH] Test BreakOnFail fixes for fatal errors --- BeefRT/rt/Internal.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/BeefRT/rt/Internal.cpp b/BeefRT/rt/Internal.cpp index 51f66c1f..5bb1d054 100644 --- a/BeefRT/rt/Internal.cpp +++ b/BeefRT/rt/Internal.cpp @@ -400,6 +400,12 @@ void Internal::ThrowIndexOutOfRange(intptr stackOffset) { if (gClientPipe != NULL) { + if (gTestBreakOnFailure) + { + SETUP_ERROR("Index out of range", (int)(2 + stackOffset)); + BF_DEBUG_BREAK(); + } + Beefy::String str = ":TestFail\tIndex out of range\n"; TestString(str); exit(1); @@ -415,9 +421,15 @@ void Internal::ThrowIndexOutOfRange(intptr stackOffset) } void Internal::FatalError(bf::System::String* error, intptr stackOffset) -{ +{ if (gClientPipe != NULL) { + if (gTestBreakOnFailure) + { + SETUP_ERROR(error->CStr(), (int)(2 + stackOffset)); + BF_DEBUG_BREAK(); + } + Beefy::String str = ":TestFail\t"; str += error->CStr(); str.Replace('\n', '\r');