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
8fbf9d16
Commit
8fbf9d16
authored
Nov 28, 2018
by
durandal
Committed by
Gennadiy Civil
Nov 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Googletest export
Fix: remove two added testcases that depend on gmock; I'll put them back later in a way that doesn't break the build. PiperOrigin-RevId: 223227562
parent
b22d2366
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
23 deletions
+11
-23
googletest-death-test-test.cc
googletest/test/googletest-death-test-test.cc
+11
-23
No files found.
googletest/test/googletest-death-test-test.cc
View file @
8fbf9d16
...
...
@@ -32,7 +32,6 @@
#include "gtest/gtest-death-test.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "gtest/internal/gtest-filepath.h"
...
...
@@ -61,7 +60,7 @@ using testing::internal::AlwaysTrue;
namespace
posix
=
::
testing
::
internal
::
posix
;
using
testing
::
HasSubstr
;
using
testing
::
ContainsRegex
;
using
testing
::
Matcher
;
using
testing
::
Message
;
using
testing
::
internal
::
DeathTest
;
...
...
@@ -303,14 +302,14 @@ TEST_F(TestForDeathTest, SingleStatement) {
EXPECT_DEATH
(
_exit
(
1
),
""
)
<<
1
<<
2
<<
3
;
}
# if GTEST_USES_PCRE
void
DieWithEmbeddedNul
()
{
fprintf
(
stderr
,
"Hello%cmy null world.
\n
"
,
'\0'
);
fflush
(
stderr
);
_exit
(
1
);
}
# if GTEST_USES_PCRE
// Tests that EXPECT_DEATH and ASSERT_DEATH work when the error
// message has a NUL character in it.
TEST_F
(
TestForDeathTest
,
EmbeddedNulInMessage
)
{
...
...
@@ -1340,38 +1339,27 @@ TEST(MatcherDeathTest, DoesNotBreakBareRegexMatching) {
TEST
(
MatcherDeathTest
,
MonomorphicMatcherMatches
)
{
EXPECT_DEATH
(
DieWithMessage
(
"Behind O, I am slain!"
),
Matcher
<
const
std
::
string
&>
(
HasSubstr
(
"I am slain"
)));
Matcher
<
const
std
::
string
&>
(
ContainsRegex
(
"I am slain"
)));
}
TEST
(
MatcherDeathTest
,
MonomorphicMatcherDoesNotMatch
)
{
EXPECT_NONFATAL_FAILURE
(
EXPECT_DEATH
(
DieWithMessage
(
"Behind O, I am slain!"
),
Matcher
<
const
std
::
string
&>
(
HasSubstr
(
"Ow, I am slain"
))),
"Expected: has substring
\"
Ow, I am slain
\"
"
);
EXPECT_DEATH
(
DieWithMessage
(
"Behind O, I am slain!"
),
Matcher
<
const
std
::
string
&>
(
ContainsRegex
(
"Ow, I am slain"
))),
"Expected: contains regular expression
\"
Ow, I am slain
\"
"
);
}
TEST
(
MatcherDeathTest
,
PolymorphicMatcherMatches
)
{
EXPECT_DEATH
(
DieWithMessage
(
"The rest is silence."
),
HasSubstr
(
"rest is silence"
));
ContainsRegex
(
"rest is silence"
));
}
TEST
(
MatcherDeathTest
,
PolymorphicMatcherDoesNotMatch
)
{
EXPECT_NONFATAL_FAILURE
(
EXPECT_DEATH
(
DieWithMessage
(
"The rest is silence."
),
HasSubstr
(
"rest is science"
)),
"Expected: has substring
\"
rest is science
\"
"
);
}
TEST
(
MatcherDeathTest
,
CompositeMatcherMatches
)
{
EXPECT_DEATH
(
DieWithMessage
(
"Et tu, Brute! Then fall, Caesar."
),
AllOf
(
HasSubstr
(
"Et tu"
),
HasSubstr
(
"fall, Caesar"
)));
}
TEST
(
MatcherDeathTest
,
CompositeMatcherDoesNotMatch
)
{
EXPECT_NONFATAL_FAILURE
(
EXPECT_DEATH
(
DieWithMessage
(
"The rest is silence."
),
AnyOf
(
HasSubstr
(
"Eat two"
),
HasSubstr
(
"lol Caesar"
))),
"Expected: (has substring
\"
Eat two
\"
) or "
"(has substring
\"
lol Caesar
\"
)"
);
ContainsRegex
(
"rest is science"
)),
"Expected: contains regular expression
\"
rest is science
\"
"
);
}
}
// namespace
...
...
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