Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
5e4214ce
Commit
5e4214ce
authored
Jul 08, 2010
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makes gtest_break_on_failure_unittest work on minGW (by vladl); improves
the NULL-dereferencing hack to work with LLVM (by chandlerc).
parent
682c89f7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
gtest.cc
src/gtest.cc
+5
-1
gtest_break_on_failure_unittest_.cc
test/gtest_break_on_failure_unittest_.cc
+1
-1
No files found.
src/gtest.cc
View file @
5e4214ce
...
@@ -3608,7 +3608,11 @@ void UnitTest::AddTestPartResult(TestPartResult::Type result_type,
...
@@ -3608,7 +3608,11 @@ void UnitTest::AddTestPartResult(TestPartResult::Type result_type,
// the --gtest_catch_exceptions flags are specified.
// the --gtest_catch_exceptions flags are specified.
DebugBreak
();
DebugBreak
();
#else
#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
#endif // GTEST_OS_WINDOWS
}
else
if
(
GTEST_FLAG
(
throw_on_failure
))
{
}
else
if
(
GTEST_FLAG
(
throw_on_failure
))
{
#if GTEST_HAS_EXCEPTIONS
#if GTEST_HAS_EXCEPTIONS
...
...
test/gtest_break_on_failure_unittest_.cc
View file @
5e4214ce
...
@@ -69,7 +69,7 @@ int main(int argc, char **argv) {
...
@@ -69,7 +69,7 @@ int main(int argc, char **argv) {
// a general protection fault (segment violation).
// a general protection fault (segment violation).
SetErrorMode
(
SEM_NOGPFAULTERRORBOX
|
SEM_FAILCRITICALERRORS
);
SetErrorMode
(
SEM_NOGPFAULTERRORBOX
|
SEM_FAILCRITICALERRORS
);
#if !GTEST_OS_WINDOWS_MOBILE
#if
GTEST_HAS_SEH &&
!GTEST_OS_WINDOWS_MOBILE
// The default unhandled exception filter does not always exit
// The default unhandled exception filter does not always exit
// with the exception code as exit code - for example it exits with
// with the exception code as exit code - for example it exits with
// 0 for EXCEPTION_ACCESS_VIOLATION and 1 for EXCEPTION_BREAKPOINT
// 0 for EXCEPTION_ACCESS_VIOLATION and 1 for EXCEPTION_BREAKPOINT
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment