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
29be9238
Commit
29be9238
authored
Mar 01, 2013
by
zhanyong.wan
Browse files
Removes unused variables and functions.
parent
844fa949
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
57 deletions
+27
-57
test/gmock-actions_test.cc
test/gmock-actions_test.cc
+1
-57
test/gmock-generated-actions_test.cc
test/gmock-generated-actions_test.cc
+13
-0
test/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 {
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
{
public:
Foo
()
:
value_
(
123
)
{}
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:
int
value_
;
};
...
...
test/gmock-generated-actions_test.cc
View file @
29be9238
...
...
@@ -956,6 +956,19 @@ TEST(ActionPnMacroTest, TypesAreCorrect) {
Plus
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
'9'
);
PlusActionP10
<
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
char
>
a10
=
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
...
...
test/gmock-generated-matchers_test.cc
View file @
29be9238
...
...
@@ -1039,6 +1039,19 @@ TEST(MatcherPnMacroTest, TypesAreCorrect) {
EqualsSumOf
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
'9'
);
EqualsSumOfMatcherP10
<
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
char
>
a10
=
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
...
...
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