Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
222607a0
Unverified
Commit
222607a0
authored
Feb 12, 2018
by
Gennadiy Civil
Committed by
GitHub
Feb 12, 2018
Browse files
Merge pull request #1451 from gennadiycivil/master
merges
parents
15392f1a
b94ba27d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
googletest/src/gtest-death-test.cc
googletest/src/gtest-death-test.cc
+4
-6
googletest/test/gtest-death-test_test.cc
googletest/test/gtest-death-test_test.cc
+5
-1
No files found.
googletest/src/gtest-death-test.cc
View file @
222607a0
...
...
@@ -983,7 +983,6 @@ static int ExecDeathTestChildMain(void* child_arg) {
}
# endif // !GTEST_OS_QNX
# if GTEST_HAS_CLONE
// Two utility routines that together determine the direction the stack
// grows.
// This could be accomplished more elegantly by a single recursive
...
...
@@ -1008,7 +1007,6 @@ static bool StackGrowsDown() {
StackLowerThanAddress
(
&
dummy
,
&
result
);
return
result
;
}
# endif // GTEST_HAS_CLONE
// Spawns a child process with the same executable as the current process in
// a thread-safe manner and instructs it to run the death test. The
...
...
@@ -1225,11 +1223,11 @@ bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
// signals the event, and returns a file descriptor wrapped around the pipe
// handle. This function is called in the child process only.
static
int
GetStatusFileDescriptor
(
unsigned
int
parent_process_id
,
size_t
write_handle_as_size_t
,
size_t
event_handle_as_size_t
)
{
size_t
write_handle_as_size_t
,
size_t
event_handle_as_size_t
)
{
AutoHandle
parent_process_handle
(
::
OpenProcess
(
PROCESS_DUP_HANDLE
,
FALSE
,
// Non-inheritable.
parent_process_id
));
FALSE
,
// Non-inheritable.
parent_process_id
));
if
(
parent_process_handle
.
Get
()
==
INVALID_HANDLE_VALUE
)
{
DeathTestAbort
(
"Unable to open parent process "
+
StreamableToString
(
parent_process_id
));
...
...
googletest/test/gtest-death-test_test.cc
View file @
222607a0
...
...
@@ -617,7 +617,11 @@ TEST_F(TestForDeathTest, ReturnIsFailure) {
TEST_F
(
TestForDeathTest
,
TestExpectDebugDeath
)
{
int
sideeffect
=
0
;
EXPECT_DEBUG_DEATH
(
DieInDebugElse12
(
&
sideeffect
),
"death.*DieInDebugElse12"
)
// Put the regex in a local variable to make sure we don't get an "unused"
// warning in opt mode.
const
char
*
regex
=
"death.*DieInDebugElse12"
;
EXPECT_DEBUG_DEATH
(
DieInDebugElse12
(
&
sideeffect
),
regex
)
<<
"Must accept a streamed message"
;
# ifdef NDEBUG
...
...
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