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
2cf2a1f8
Unverified
Commit
2cf2a1f8
authored
Apr 04, 2018
by
Gennadiy Civil
Committed by
GitHub
Apr 04, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1545 from gennadiycivil/master
merging gmock matchers 1
parents
891e436c
f7098a2a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
6 deletions
+52
-6
gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+0
-0
gmock-matchers.cc
googlemock/src/gmock-matchers.cc
+52
-6
gmock-matchers_test.cc
googlemock/test/gmock-matchers_test.cc
+0
-0
No files found.
googlemock/include/gmock/gmock-matchers.h
View file @
2cf2a1f8
This diff is collapsed.
Click to expand it.
googlemock/src/gmock-matchers.cc
View file @
2cf2a1f8
...
@@ -105,6 +105,53 @@ Matcher<::string>::Matcher(const ::string& s) { *this = Eq(s); }
...
@@ -105,6 +105,53 @@ Matcher<::string>::Matcher(const ::string& s) { *this = Eq(s); }
Matcher
<::
string
>::
Matcher
(
const
char
*
s
)
{
*
this
=
Eq
(
::
string
(
s
));
}
Matcher
<::
string
>::
Matcher
(
const
char
*
s
)
{
*
this
=
Eq
(
::
string
(
s
));
}
#endif // GTEST_HAS_GLOBAL_STRING
#endif // GTEST_HAS_GLOBAL_STRING
#if GTEST_HAS_ABSL
// Constructs a matcher that matches a const absl::string_view& whose value is
// equal to s.
Matcher
<
const
absl
::
string_view
&>::
Matcher
(
const
std
::
string
&
s
)
{
*
this
=
Eq
(
s
);
}
#if GTEST_HAS_GLOBAL_STRING
// Constructs a matcher that matches a const absl::string_view& whose value is
// equal to s.
Matcher
<
const
absl
::
string_view
&>::
Matcher
(
const
::
string
&
s
)
{
*
this
=
Eq
(
s
);
}
#endif // GTEST_HAS_GLOBAL_STRING
// Constructs a matcher that matches a const absl::string_view& whose value is
// equal to s.
Matcher
<
const
absl
::
string_view
&>::
Matcher
(
const
char
*
s
)
{
*
this
=
Eq
(
std
::
string
(
s
));
}
// Constructs a matcher that matches a const absl::string_view& whose value is
// equal to s.
Matcher
<
const
absl
::
string_view
&>::
Matcher
(
absl
::
string_view
s
)
{
*
this
=
Eq
(
std
::
string
(
s
));
}
// Constructs a matcher that matches a absl::string_view whose value is equal to
// s.
Matcher
<
absl
::
string_view
>::
Matcher
(
const
std
::
string
&
s
)
{
*
this
=
Eq
(
s
);
}
#if GTEST_HAS_GLOBAL_STRING
// Constructs a matcher that matches a absl::string_view whose value is equal to
// s.
Matcher
<
absl
::
string_view
>::
Matcher
(
const
::
string
&
s
)
{
*
this
=
Eq
(
s
);
}
#endif // GTEST_HAS_GLOBAL_STRING
// Constructs a matcher that matches a absl::string_view whose value is equal to
// s.
Matcher
<
absl
::
string_view
>::
Matcher
(
const
char
*
s
)
{
*
this
=
Eq
(
std
::
string
(
s
));
}
// Constructs a matcher that matches a absl::string_view whose value is equal to
// s.
Matcher
<
absl
::
string_view
>::
Matcher
(
absl
::
string_view
s
)
{
*
this
=
Eq
(
std
::
string
(
s
));
}
#endif // GTEST_HAS_ABSL
namespace
internal
{
namespace
internal
{
...
@@ -113,12 +160,11 @@ namespace internal {
...
@@ -113,12 +160,11 @@ namespace internal {
// 'negation' is false; otherwise returns the description of the
// 'negation' is false; otherwise returns the description of the
// negation of the matcher. 'param_values' contains a list of strings
// negation of the matcher. 'param_values' contains a list of strings
// that are the print-out of the matcher's parameters.
// that are the print-out of the matcher's parameters.
GTEST_API_
string
FormatMatcherDescription
(
bool
negation
,
GTEST_API_
std
::
string
FormatMatcherDescription
(
bool
negation
,
const
char
*
matcher_name
,
const
char
*
matcher_name
,
const
Strings
&
param_values
)
{
const
Strings
&
param_values
)
{
string
result
=
ConvertIdentifierNameToWords
(
matcher_name
);
std
::
string
result
=
ConvertIdentifierNameToWords
(
matcher_name
);
if
(
param_values
.
size
()
>=
1
)
if
(
param_values
.
size
()
>=
1
)
result
+=
" "
+
JoinAsTuple
(
param_values
);
result
+=
" "
+
JoinAsTuple
(
param_values
);
return
negation
?
"not ("
+
result
+
")"
:
result
;
return
negation
?
"not ("
+
result
+
")"
:
result
;
}
}
...
...
googlemock/test/gmock-matchers_test.cc
View file @
2cf2a1f8
This diff is collapsed.
Click to expand it.
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