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
9417fb40
Commit
9417fb40
authored
Jan 21, 2020
by
Xiaoyi Zhang
Browse files
Merge pull request #2665 from bysreg:fix_noshortcircuitfailure_detectsflakyshortcircuit_test
PiperOrigin-RevId: 290256504
parents
c59c7bab
c7137f0b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
googlemock/test/gmock-matchers_test.cc
googlemock/test/gmock-matchers_test.cc
+5
-3
No files found.
googlemock/test/gmock-matchers_test.cc
View file @
9417fb40
...
@@ -140,7 +140,7 @@ Matcher<int> GreaterThan(int n) {
...
@@ -140,7 +140,7 @@ Matcher<int> GreaterThan(int n) {
std
::
string
OfType
(
const
std
::
string
&
type_name
)
{
std
::
string
OfType
(
const
std
::
string
&
type_name
)
{
#if GTEST_HAS_RTTI
#if GTEST_HAS_RTTI
return " (of type " + type_name + ")";
return
IsReadableTypeName
(
type_name
)
?
" (of type "
+
type_name
+
")"
:
""
;
#else
#else
return
""
;
return
""
;
#endif
#endif
...
@@ -6885,7 +6885,8 @@ TEST_F(PredicateFormatterFromMatcherTest, NoShortCircuitOnFailure) {
...
@@ -6885,7 +6885,8 @@ TEST_F(PredicateFormatterFromMatcherTest, NoShortCircuitOnFailure) {
EXPECT_FALSE
(
result
);
// Implicit cast to bool.
EXPECT_FALSE
(
result
);
// Implicit cast to bool.
std
::
string
expect
=
std
::
string
expect
=
"Value of: dummy-name
\n
Expected: [DescribeTo]
\n
"
"Value of: dummy-name
\n
Expected: [DescribeTo]
\n
"
" Actual: 1, [MatchAndExplain]";
" Actual: 1"
+
OfType
(
internal
::
GetTypeName
<
Behavior
>
())
+
", [MatchAndExplain]"
;
EXPECT_EQ
(
expect
,
result
.
message
());
EXPECT_EQ
(
expect
,
result
.
message
());
}
}
...
@@ -6896,7 +6897,8 @@ TEST_F(PredicateFormatterFromMatcherTest, DetectsFlakyShortCircuit) {
...
@@ -6896,7 +6897,8 @@ TEST_F(PredicateFormatterFromMatcherTest, DetectsFlakyShortCircuit) {
"Value of: dummy-name
\n
Expected: [DescribeTo]
\n
"
"Value of: dummy-name
\n
Expected: [DescribeTo]
\n
"
" The matcher failed on the initial attempt; but passed when rerun to "
" The matcher failed on the initial attempt; but passed when rerun to "
"generate the explanation.
\n
"
"generate the explanation.
\n
"
" Actual: 2, [MatchAndExplain]";
" Actual: 2"
+
OfType
(
internal
::
GetTypeName
<
Behavior
>
())
+
", [MatchAndExplain]"
;
EXPECT_EQ
(
expect
,
result
.
message
());
EXPECT_EQ
(
expect
,
result
.
message
());
}
}
...
...
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