Makes gtest_break_on_failure_unittest work on minGW (by vladl); improves
the NULL-dereferencing hack to work with LLVM (by chandlerc).
This commit is contained in:
@@ -3608,7 +3608,11 @@ void UnitTest::AddTestPartResult(TestPartResult::Type result_type,
|
||||
// the --gtest_catch_exceptions flags are specified.
|
||||
DebugBreak();
|
||||
#else
|
||||
*static_cast<int*>(NULL) = 1;
|
||||
// Dereference NULL through a volatile pointer to prevent the compiler
|
||||
// from removing. We use this rather than abort() or __builtin_trap() for
|
||||
// portability: Symbian doesn't implement abort() well, and some debuggers
|
||||
// don't correctly trap abort().
|
||||
*static_cast<volatile int*>(NULL) = 1;
|
||||
#endif // GTEST_OS_WINDOWS
|
||||
} else if (GTEST_FLAG(throw_on_failure)) {
|
||||
#if GTEST_HAS_EXCEPTIONS
|
||||
|
||||
Reference in New Issue
Block a user