Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Src/Generic/Test/TestErrorHandling.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,9 @@ namespace TestGenericLib
#endif
}

#ifdef DEBUG
void testNativeAssertThrowsExceptionWithoutContinuing()
{
#if defined(WIN32) || defined(_M_X64)
#if (defined(WIN32) || defined(_M_X64)) && defined(DEBUG)
bool fReachedAfterAssert = false;
try
{
Expand All @@ -179,11 +178,8 @@ namespace TestGenericLib
}

unitpp::assert_true("Execution continued after native assert", !fReachedAfterAssert);
#else
// TODO-Linux: port
#endif
}
#endif

public:
TestErrorHandling();
Expand Down
6 changes: 3 additions & 3 deletions Src/Generic/Test/testGeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace unitpp
else
{
g_previousAssertProc = SetAssertProc(ThrowingAssertProc);
ShowAssertMessageBox(0); // Disable assertion dialogs
ShowAssertMessageBox(0);
}
#endif
#if defined(WIN32) || defined(WIN64)
Expand All @@ -95,22 +95,22 @@ namespace unitpp
{
signal(SIGABRT, TerminateOnSigAbrt);

const bool fInjectTeardownAbort = IsEnvironmentSwitchEnabled("FW_TEST_INDUCE_TEARDOWN_ABORT");
#ifdef DEBUG
const bool fInjectTeardownAssert = IsEnvironmentSwitchEnabled("FW_TEST_INDUCE_TEARDOWN_ASSERT");
const bool fInjectTeardownAbort = IsEnvironmentSwitchEnabled("FW_TEST_INDUCE_TEARDOWN_ABORT");
if (fInjectTeardownAssert || fInjectTeardownAbort)
RestorePreviousAssertProc();

if (fInjectTeardownAssert)
AssertMsg(false, "Injected teardown assert for native test infrastructure validation");
#endif

if (fInjectTeardownAbort)
{
_set_error_mode(_OUT_TO_STDERR);
_set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
abort();
}
#endif

#if defined(WIN32) || defined(WIN64)
ModuleEntry::DllMain(0, DLL_PROCESS_DETACH);
Expand Down
Loading