From 7557d9ca0743627415a8880a0d2a6be93c6db0c6 Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 2 Dec 2016 21:49:44 +0000 Subject: [PATCH] Abort if assert is hit in tests --- src/core/Guard.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/Guard.cpp b/src/core/Guard.cpp index 479f976104..031e8841d5 100644 --- a/src/core/Guard.cpp +++ b/src/core/Guard.cpp @@ -78,8 +78,11 @@ namespace Guard char *bufend = (char *)strchr(buffer, 0); vsnprintf(bufend, sizeof(buffer) - (bufend - buffer), message, args); } - // Only show message box if we are not building for testing -#ifndef __TEST__ +#ifdef __TEST__ + // Abort if we are building for testing + abort(); +#else + // Show message box if we are not building for testing int result = MessageBoxA(nullptr, buffer, OPENRCT2_NAME, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION); if (result == IDABORT) {