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
225e6741
Commit
225e6741
authored
Feb 12, 2018
by
Gennadiy Civil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moving JoinAsTuple to internal
parent
b94ba27d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
46 deletions
+19
-46
gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+0
-4
gmock-internal-utils.cc
googlemock/src/gmock-internal-utils.cc
+19
-0
gmock-matchers.cc
googlemock/src/gmock-matchers.cc
+0
-19
gmock-matchers_test.cc
googlemock/test/gmock-matchers_test.cc
+0
-23
No files found.
googlemock/include/gmock/gmock-matchers.h
View file @
225e6741
...
@@ -3614,10 +3614,6 @@ BoundSecondMatcher<Tuple2Matcher, Second> MatcherBindSecond(
...
@@ -3614,10 +3614,6 @@ BoundSecondMatcher<Tuple2Matcher, Second> MatcherBindSecond(
return
BoundSecondMatcher
<
Tuple2Matcher
,
Second
>
(
tm
,
second
);
return
BoundSecondMatcher
<
Tuple2Matcher
,
Second
>
(
tm
,
second
);
}
}
// Joins a vector of strings as if they are fields of a tuple; returns
// the joined string. This function is exported for testing.
GTEST_API_
string
JoinAsTuple
(
const
Strings
&
fields
);
// Returns the description for a matcher defined using the MATCHER*()
// Returns the description for a matcher defined using the MATCHER*()
// macro where the user-supplied description string is "", if
// macro where the user-supplied description string is "", if
// 'negation' is false; otherwise returns the description of the
// 'negation' is false; otherwise returns the description of the
...
...
googlemock/src/gmock-internal-utils.cc
View file @
225e6741
...
@@ -47,6 +47,25 @@
...
@@ -47,6 +47,25 @@
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
// Joins a vector of strings as if they are fields of a tuple; returns
// the joined string.
GTEST_API_
std
::
string
JoinAsTuple
(
const
Strings
&
fields
)
{
switch
(
fields
.
size
())
{
case
0
:
return
""
;
case
1
:
return
fields
[
0
];
default
:
std
::
string
result
=
"("
+
fields
[
0
];
for
(
size_t
i
=
1
;
i
<
fields
.
size
();
i
++
)
{
result
+=
", "
;
result
+=
fields
[
i
];
}
result
+=
")"
;
return
result
;
}
}
// Converts an identifier name to a space-separated list of lower-case
// Converts an identifier name to a space-separated list of lower-case
// words. Each maximum substring of the form [A-Za-z][a-z]*|\d+ is
// words. Each maximum substring of the form [A-Za-z][a-z]*|\d+ is
// treated as one word. For example, both "FooBar123" and
// treated as one word. For example, both "FooBar123" and
...
...
googlemock/src/gmock-matchers.cc
View file @
225e6741
...
@@ -100,25 +100,6 @@ Matcher<StringPiece>::Matcher(StringPiece s) {
...
@@ -100,25 +100,6 @@ Matcher<StringPiece>::Matcher(StringPiece s) {
namespace
internal
{
namespace
internal
{
// Joins a vector of strings as if they are fields of a tuple; returns
// the joined string.
GTEST_API_
string
JoinAsTuple
(
const
Strings
&
fields
)
{
switch
(
fields
.
size
())
{
case
0
:
return
""
;
case
1
:
return
fields
[
0
];
default
:
string
result
=
"("
+
fields
[
0
];
for
(
size_t
i
=
1
;
i
<
fields
.
size
();
i
++
)
{
result
+=
", "
;
result
+=
fields
[
i
];
}
result
+=
")"
;
return
result
;
}
}
// Returns the description for a matcher defined using the MATCHER*()
// Returns the description for a matcher defined using the MATCHER*()
// macro where the user-supplied description string is "", if
// macro where the user-supplied description string is "", if
// 'negation' is false; otherwise returns the description of the
// 'negation' is false; otherwise returns the description of the
...
...
googlemock/test/gmock-matchers_test.cc
View file @
225e6741
...
@@ -146,7 +146,6 @@ using testing::internal::ExplainMatchFailureTupleTo;
...
@@ -146,7 +146,6 @@ using testing::internal::ExplainMatchFailureTupleTo;
using
testing
::
internal
::
FloatingEqMatcher
;
using
testing
::
internal
::
FloatingEqMatcher
;
using
testing
::
internal
::
FormatMatcherDescription
;
using
testing
::
internal
::
FormatMatcherDescription
;
using
testing
::
internal
::
IsReadableTypeName
;
using
testing
::
internal
::
IsReadableTypeName
;
using
testing
::
internal
::
JoinAsTuple
;
using
testing
::
internal
::
linked_ptr
;
using
testing
::
internal
::
linked_ptr
;
using
testing
::
internal
::
MatchMatrix
;
using
testing
::
internal
::
MatchMatrix
;
using
testing
::
internal
::
RE
;
using
testing
::
internal
::
RE
;
...
@@ -5268,28 +5267,6 @@ TEST(IsReadableTypeNameTest, ReturnsFalseForLongFunctionTypeNames) {
...
@@ -5268,28 +5267,6 @@ TEST(IsReadableTypeNameTest, ReturnsFalseForLongFunctionTypeNames) {
EXPECT_FALSE
(
IsReadableTypeName
(
"void (&)(int, bool, char, float)"
));
EXPECT_FALSE
(
IsReadableTypeName
(
"void (&)(int, bool, char, float)"
));
}
}
// Tests JoinAsTuple().
TEST
(
JoinAsTupleTest
,
JoinsEmptyTuple
)
{
EXPECT_EQ
(
""
,
JoinAsTuple
(
Strings
()));
}
TEST
(
JoinAsTupleTest
,
JoinsOneTuple
)
{
const
char
*
fields
[]
=
{
"1"
};
EXPECT_EQ
(
"1"
,
JoinAsTuple
(
Strings
(
fields
,
fields
+
1
)));
}
TEST
(
JoinAsTupleTest
,
JoinsTwoTuple
)
{
const
char
*
fields
[]
=
{
"1"
,
"a"
};
EXPECT_EQ
(
"(1, a)"
,
JoinAsTuple
(
Strings
(
fields
,
fields
+
2
)));
}
TEST
(
JoinAsTupleTest
,
JoinsTenTuple
)
{
const
char
*
fields
[]
=
{
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"10"
};
EXPECT_EQ
(
"(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)"
,
JoinAsTuple
(
Strings
(
fields
,
fields
+
10
)));
}
// Tests FormatMatcherDescription().
// Tests FormatMatcherDescription().
TEST
(
FormatMatcherDescriptionTest
,
WorksForEmptyDescription
)
{
TEST
(
FormatMatcherDescriptionTest
,
WorksForEmptyDescription
)
{
...
...
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