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
29be9238
Commit
29be9238
authored
Mar 01, 2013
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes unused variables and functions.
parent
844fa949
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
57 deletions
+27
-57
gmock-actions_test.cc
test/gmock-actions_test.cc
+1
-57
gmock-generated-actions_test.cc
test/gmock-generated-actions_test.cc
+13
-0
gmock-generated-matchers_test.cc
test/gmock-generated-matchers_test.cc
+13
-0
No files found.
test/gmock-actions_test.cc
View file @
29be9238
...
@@ -1031,68 +1031,12 @@ class VoidNullaryFunctor {
...
@@ -1031,68 +1031,12 @@ class VoidNullaryFunctor {
void
operator
()()
{
g_done
=
true
;
}
void
operator
()()
{
g_done
=
true
;
}
};
};
bool
Unary
(
int
x
)
{
return
x
<
0
;
}
const
char
*
Plus1
(
const
char
*
s
)
{
return
s
+
1
;
}
void
VoidUnary
(
int
/* n */
)
{
g_done
=
true
;
}
bool
ByConstRef
(
const
std
::
string
&
s
)
{
return
s
==
"Hi"
;
}
const
double
g_double
=
0
;
bool
ReferencesGlobalDouble
(
const
double
&
x
)
{
return
&
x
==
&
g_double
;
}
std
::
string
ByNonConstRef
(
std
::
string
&
s
)
{
return
s
+=
"+"
;
}
// NOLINT
struct
UnaryFunctor
{
int
operator
()(
bool
x
)
{
return
x
?
1
:
-
1
;
}
};
const
char
*
Binary
(
const
char
*
input
,
short
n
)
{
return
input
+
n
;
}
// NOLINT
void
VoidBinary
(
int
,
char
)
{
g_done
=
true
;
}
int
Ternary
(
int
x
,
char
y
,
short
z
)
{
return
x
+
y
+
z
;
}
// NOLINT
void
VoidTernary
(
int
,
char
,
bool
)
{
g_done
=
true
;
}
int
SumOf4
(
int
a
,
int
b
,
int
c
,
int
d
)
{
return
a
+
b
+
c
+
d
;
}
void
VoidFunctionWithFourArguments
(
char
,
int
,
float
,
double
)
{
g_done
=
true
;
}
int
SumOf5
(
int
a
,
int
b
,
int
c
,
int
d
,
int
e
)
{
return
a
+
b
+
c
+
d
+
e
;
}
struct
SumOf5Functor
{
int
operator
()(
int
a
,
int
b
,
int
c
,
int
d
,
int
e
)
{
return
a
+
b
+
c
+
d
+
e
;
}
};
int
SumOf6
(
int
a
,
int
b
,
int
c
,
int
d
,
int
e
,
int
f
)
{
return
a
+
b
+
c
+
d
+
e
+
f
;
}
struct
SumOf6Functor
{
int
operator
()(
int
a
,
int
b
,
int
c
,
int
d
,
int
e
,
int
f
)
{
return
a
+
b
+
c
+
d
+
e
+
f
;
}
};
class
Foo
{
class
Foo
{
public
:
public
:
Foo
()
:
value_
(
123
)
{}
Foo
()
:
value_
(
123
)
{}
int
Nullary
()
const
{
return
value_
;
}
int
Nullary
()
const
{
return
value_
;
}
short
Unary
(
long
x
)
{
return
static_cast
<
short
>
(
value_
+
x
);
}
// NOLINT
std
::
string
Binary
(
const
std
::
string
&
str
,
char
c
)
const
{
return
str
+
c
;
}
int
Ternary
(
int
x
,
bool
y
,
char
z
)
{
return
value_
+
x
+
y
*
z
;
}
int
SumOf4
(
int
a
,
int
b
,
int
c
,
int
d
)
const
{
return
a
+
b
+
c
+
d
+
value_
;
}
int
SumOf5
(
int
a
,
int
b
,
int
c
,
int
d
,
int
e
)
{
return
a
+
b
+
c
+
d
+
e
;
}
int
SumOf6
(
int
a
,
int
b
,
int
c
,
int
d
,
int
e
,
int
f
)
{
return
a
+
b
+
c
+
d
+
e
+
f
;
}
private
:
private
:
int
value_
;
int
value_
;
};
};
...
...
test/gmock-generated-actions_test.cc
View file @
29be9238
...
@@ -956,6 +956,19 @@ TEST(ActionPnMacroTest, TypesAreCorrect) {
...
@@ -956,6 +956,19 @@ TEST(ActionPnMacroTest, TypesAreCorrect) {
Plus
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
'9'
);
Plus
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
'9'
);
PlusActionP10
<
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
char
>
a10
=
PlusActionP10
<
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
char
>
a10
=
Plus
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
'0'
);
Plus
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
'0'
);
// Avoid "unused variable" warnings.
(
void
)
a0
;
(
void
)
a1
;
(
void
)
a2
;
(
void
)
a3
;
(
void
)
a4
;
(
void
)
a5
;
(
void
)
a6
;
(
void
)
a7
;
(
void
)
a8
;
(
void
)
a9
;
(
void
)
a10
;
}
}
// Tests that an ACTION_P*() action can be explicitly instantiated
// Tests that an ACTION_P*() action can be explicitly instantiated
...
...
test/gmock-generated-matchers_test.cc
View file @
29be9238
...
@@ -1039,6 +1039,19 @@ TEST(MatcherPnMacroTest, TypesAreCorrect) {
...
@@ -1039,6 +1039,19 @@ TEST(MatcherPnMacroTest, TypesAreCorrect) {
EqualsSumOf
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
'9'
);
EqualsSumOf
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
'9'
);
EqualsSumOfMatcherP10
<
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
char
>
a10
=
EqualsSumOfMatcherP10
<
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
char
>
a10
=
EqualsSumOf
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
'0'
);
EqualsSumOf
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
'0'
);
// Avoid "unused variable" warnings.
(
void
)
a0
;
(
void
)
a1
;
(
void
)
a2
;
(
void
)
a3
;
(
void
)
a4
;
(
void
)
a5
;
(
void
)
a6
;
(
void
)
a7
;
(
void
)
a8
;
(
void
)
a9
;
(
void
)
a10
;
}
}
// Tests that matcher-typed parameters can be used in Value() inside a
// Tests that matcher-typed parameters can be used in Value() inside a
...
...
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