1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Test BreakOnFail fixes for fatal errors

This commit is contained in:
Brian Fiete 2021-11-03 14:51:06 -07:00
parent 3ec68ee1e0
commit 344b8d0181

View file

@ -400,6 +400,12 @@ void Internal::ThrowIndexOutOfRange(intptr stackOffset)
{ {
if (gClientPipe != NULL) 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"; Beefy::String str = ":TestFail\tIndex out of range\n";
TestString(str); TestString(str);
exit(1); exit(1);
@ -418,6 +424,12 @@ void Internal::FatalError(bf::System::String* error, intptr stackOffset)
{ {
if (gClientPipe != NULL) if (gClientPipe != NULL)
{ {
if (gTestBreakOnFailure)
{
SETUP_ERROR(error->CStr(), (int)(2 + stackOffset));
BF_DEBUG_BREAK();
}
Beefy::String str = ":TestFail\t"; Beefy::String str = ":TestFail\t";
str += error->CStr(); str += error->CStr();
str.Replace('\n', '\r'); str.Replace('\n', '\r');