summaryrefslogtreecommitdiffstats
path: root/src/gtest.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-05-05 23:13:43 (GMT)
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-05-05 23:13:43 (GMT)
commit42abea350d4f26a006f760fae0d1f9882deb9221 (patch)
tree7b897744aa871de2cda218509fe8d16bf11991ba /src/gtest.cc
parent9b23e3cc7677643f6adaf6c327275d0a7cdff02c (diff)
downloadgoogletest-42abea350d4f26a006f760fae0d1f9882deb9221.zip
googletest-42abea350d4f26a006f760fae0d1f9882deb9221.tar.gz
googletest-42abea350d4f26a006f760fae0d1f9882deb9221.tar.bz2
Uses DebugBreak() to properly break on Windows (by Vlad Losev).
Diffstat (limited to 'src/gtest.cc')
-rw-r--r--src/gtest.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gtest.cc b/src/gtest.cc
index 4880767..6fc4044 100644
--- a/src/gtest.cc
+++ b/src/gtest.cc
@@ -3312,7 +3312,14 @@ void UnitTest::AddTestPartResult(TestPartResultType result_type,
// with another testing framework) and specify the former on the
// command line for debugging.
if (GTEST_FLAG(break_on_failure)) {
+#if GTEST_OS_WINDOWS
+ // Using DebugBreak on Windows allows gtest to still break into a debugger
+ // when a failure happens and both the --gtest_break_on_failure and
+ // the --gtest_catch_exceptions flags are specified.
+ DebugBreak();
+#else
*static_cast<int*>(NULL) = 1;
+#endif // GTEST_OS_WINDOWS
} else if (GTEST_FLAG(throw_on_failure)) {
#if GTEST_HAS_EXCEPTIONS
throw GoogleTestFailureException(result);