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
3fbd2dd0
Commit
3fbd2dd0
authored
Mar 26, 2009
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makes gmock compile with gcc -Wall -Wextra -Wno-unused-parameter.
parent
68be111b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
16 deletions
+17
-16
gmock-actions.h
include/gmock/gmock-actions.h
+2
-2
gmock-generated-actions.h
include/gmock/gmock-generated-actions.h
+1
-2
gmock-generated-actions.h.pump
include/gmock/gmock-generated-actions.h.pump
+2
-1
gmock-matchers.h
include/gmock/gmock-matchers.h
+10
-9
Makefile
make/Makefile
+1
-1
gmock_link_test.h
test/gmock_link_test.h
+1
-1
No files found.
include/gmock/gmock-actions.h
View file @
3fbd2dd0
...
@@ -597,7 +597,7 @@ class AssignAction {
...
@@ -597,7 +597,7 @@ class AssignAction {
AssignAction
(
T1
*
ptr
,
T2
value
)
:
ptr_
(
ptr
),
value_
(
value
)
{}
AssignAction
(
T1
*
ptr
,
T2
value
)
:
ptr_
(
ptr
),
value_
(
value
)
{}
template
<
typename
Result
,
typename
ArgumentTuple
>
template
<
typename
Result
,
typename
ArgumentTuple
>
void
Perform
(
const
ArgumentTuple
&
args
)
const
{
void
Perform
(
const
ArgumentTuple
&
/* args */
)
const
{
*
ptr_
=
value_
;
*
ptr_
=
value_
;
}
}
private
:
private
:
...
@@ -616,7 +616,7 @@ class SetErrnoAndReturnAction {
...
@@ -616,7 +616,7 @@ class SetErrnoAndReturnAction {
:
errno_
(
errno_value
),
:
errno_
(
errno_value
),
result_
(
result
)
{}
result_
(
result
)
{}
template
<
typename
Result
,
typename
ArgumentTuple
>
template
<
typename
Result
,
typename
ArgumentTuple
>
Result
Perform
(
const
ArgumentTuple
&
args
)
const
{
Result
Perform
(
const
ArgumentTuple
&
/* args */
)
const
{
errno
=
errno_
;
errno
=
errno_
;
return
result_
;
return
result_
;
}
}
...
...
include/gmock/gmock-generated-actions.h
View file @
3fbd2dd0
...
@@ -749,7 +749,7 @@ class SelectArgs<Result, ArgumentTuple,
...
@@ -749,7 +749,7 @@ class SelectArgs<Result, ArgumentTuple,
public
:
public
:
typedef
Result
type
();
typedef
Result
type
();
typedef
typename
Function
<
type
>::
ArgumentTuple
SelectedArgs
;
typedef
typename
Function
<
type
>::
ArgumentTuple
SelectedArgs
;
static
SelectedArgs
Select
(
const
ArgumentTuple
&
args
)
{
static
SelectedArgs
Select
(
const
ArgumentTuple
&
/* args */
)
{
using
::
std
::
tr1
::
get
;
using
::
std
::
tr1
::
get
;
return
SelectedArgs
();
return
SelectedArgs
();
}
}
...
@@ -934,7 +934,6 @@ class WithArgsAction {
...
@@ -934,7 +934,6 @@ class WithArgsAction {
const
InnerAction
action_
;
const
InnerAction
action_
;
};
};
// Does two actions sequentially. Used for implementing the DoAll(a1,
// Does two actions sequentially. Used for implementing the DoAll(a1,
// a2, ...) action.
// a2, ...) action.
template
<
typename
Action1
,
typename
Action2
>
template
<
typename
Action1
,
typename
Action2
>
...
...
include/gmock/gmock-generated-actions.h.pump
View file @
3fbd2dd0
...
@@ -314,7 +314,8 @@ class SelectArgs<Result, ArgumentTuple,
...
@@ -314,7 +314,8 @@ class SelectArgs<Result, ArgumentTuple,
public
:
public
:
typedef
Result
type
(
$
for
j1
,
[[
GMOCK_FIELD_
(
ArgumentTuple
,
k
$
j1
)]]);
typedef
Result
type
(
$
for
j1
,
[[
GMOCK_FIELD_
(
ArgumentTuple
,
k
$
j1
)]]);
typedef
typename
Function
<
type
>::
ArgumentTuple
SelectedArgs
;
typedef
typename
Function
<
type
>::
ArgumentTuple
SelectedArgs
;
static
SelectedArgs
Select
(
const
ArgumentTuple
&
args
)
{
static
SelectedArgs
Select
(
const
ArgumentTuple
&
[[]]
$
if
i
==
1
[[
/* args */
]]
$
else
[[
args
]])
{
using
::
std
::
tr1
::
get
;
using
::
std
::
tr1
::
get
;
return
SelectedArgs
(
$
for
j1
,
[[
get
<
k
$
j1
>
(
args
)]]);
return
SelectedArgs
(
$
for
j1
,
[[
get
<
k
$
j1
>
(
args
)]]);
}
}
...
...
include/gmock/gmock-matchers.h
View file @
3fbd2dd0
...
@@ -90,7 +90,7 @@ class MatcherInterface {
...
@@ -90,7 +90,7 @@ class MatcherInterface {
// Explains why x matches, or doesn't match, the matcher. Override
// Explains why x matches, or doesn't match, the matcher. Override
// this to provide any additional information that helps a user
// this to provide any additional information that helps a user
// understand the match result.
// understand the match result.
virtual
void
ExplainMatchResultTo
(
T
x
,
::
std
::
ostream
*
os
)
const
{
virtual
void
ExplainMatchResultTo
(
T
/* x */
,
::
std
::
ostream
*
/* os */
)
const
{
// By default, nothing more needs to be explained, as Google Mock
// By default, nothing more needs to be explained, as Google Mock
// has already printed the value of x when this function is
// has already printed the value of x when this function is
// called.
// called.
...
@@ -146,8 +146,9 @@ class MatcherBase {
...
@@ -146,8 +146,9 @@ class MatcherBase {
// The default implementation of ExplainMatchResultTo() for
// The default implementation of ExplainMatchResultTo() for
// polymorphic matchers.
// polymorphic matchers.
template
<
typename
PolymorphicMatcherImpl
,
typename
T
>
template
<
typename
PolymorphicMatcherImpl
,
typename
T
>
inline
void
ExplainMatchResultTo
(
const
PolymorphicMatcherImpl
&
impl
,
const
T
&
x
,
inline
void
ExplainMatchResultTo
(
const
PolymorphicMatcherImpl
&
/* impl */
,
::
std
::
ostream
*
os
)
{
const
T
&
/* x */
,
::
std
::
ostream
*
/* os */
)
{
// By default, nothing more needs to be said, as Google Mock already
// By default, nothing more needs to be said, as Google Mock already
// prints the value of x elsewhere.
// prints the value of x elsewhere.
}
}
...
@@ -390,15 +391,15 @@ template <>
...
@@ -390,15 +391,15 @@ template <>
class
TuplePrefix
<
0
>
{
class
TuplePrefix
<
0
>
{
public
:
public
:
template
<
typename
MatcherTuple
,
typename
ValueTuple
>
template
<
typename
MatcherTuple
,
typename
ValueTuple
>
static
bool
Matches
(
const
MatcherTuple
&
matcher_tuple
,
static
bool
Matches
(
const
MatcherTuple
&
/* matcher_tuple */
,
const
ValueTuple
&
value_tuple
)
{
const
ValueTuple
&
/* value_tuple */
)
{
return
true
;
return
true
;
}
}
template
<
typename
MatcherTuple
,
typename
ValueTuple
>
template
<
typename
MatcherTuple
,
typename
ValueTuple
>
static
void
DescribeMatchFailuresTo
(
const
MatcherTuple
&
matchers
,
static
void
DescribeMatchFailuresTo
(
const
MatcherTuple
&
/* matchers */
,
const
ValueTuple
&
values
,
const
ValueTuple
&
/* values */
,
::
std
::
ostream
*
os
)
{}
::
std
::
ostream
*
/* os */
)
{}
};
};
// TupleMatches(matcher_tuple, value_tuple) returns true iff all
// TupleMatches(matcher_tuple, value_tuple) returns true iff all
...
@@ -495,7 +496,7 @@ class MatcherCastImpl<T, Matcher<T> > {
...
@@ -495,7 +496,7 @@ class MatcherCastImpl<T, Matcher<T> > {
template
<
typename
T
>
template
<
typename
T
>
class
AnyMatcherImpl
:
public
MatcherInterface
<
T
>
{
class
AnyMatcherImpl
:
public
MatcherInterface
<
T
>
{
public
:
public
:
virtual
bool
Matches
(
T
x
)
const
{
return
true
;
}
virtual
bool
Matches
(
T
/* x */
)
const
{
return
true
;
}
virtual
void
DescribeTo
(
::
std
::
ostream
*
os
)
const
{
*
os
<<
"is anything"
;
}
virtual
void
DescribeTo
(
::
std
::
ostream
*
os
)
const
{
*
os
<<
"is anything"
;
}
virtual
void
DescribeNegationTo
(
::
std
::
ostream
*
os
)
const
{
virtual
void
DescribeNegationTo
(
::
std
::
ostream
*
os
)
const
{
// This is mostly for completeness' safe, as it's not very useful
// This is mostly for completeness' safe, as it's not very useful
...
...
make/Makefile
View file @
3fbd2dd0
...
@@ -31,7 +31,7 @@ CPPFLAGS += -I$(GMOCK_DIR) -I$(GMOCK_DIR)/include \
...
@@ -31,7 +31,7 @@ CPPFLAGS += -I$(GMOCK_DIR) -I$(GMOCK_DIR)/include \
-I
$(GTEST_DIR)
-I
$(GTEST_DIR)
/include
-I
$(GTEST_DIR)
-I
$(GTEST_DIR)
/include
# Flags passed to the C++ compiler.
# Flags passed to the C++ compiler.
CXXFLAGS
+=
-g
CXXFLAGS
+=
-g
-Wall
-Wextra
-Wno-unused-parameter
# All tests produced by this Makefile. Remember to add new tests you
# All tests produced by this Makefile. Remember to add new tests you
# created to the list.
# created to the list.
...
...
test/gmock_link_test.h
View file @
3fbd2dd0
...
@@ -501,7 +501,7 @@ TEST(LinkTest, TestMatcherRef) {
...
@@ -501,7 +501,7 @@ TEST(LinkTest, TestMatcherRef) {
// Tests the linkage of the TypedEq matcher.
// Tests the linkage of the TypedEq matcher.
TEST
(
LinkTest
,
TestMatcherTypedEq
)
{
TEST
(
LinkTest
,
TestMatcherTypedEq
)
{
Mock
mock
;
Mock
mock
;
unsigned
long
a
=
0
;
long
a
=
0
;
ON_CALL
(
mock
,
VoidFromIntRef
(
TypedEq
<
int
&>
(
a
))).
WillByDefault
(
Return
());
ON_CALL
(
mock
,
VoidFromIntRef
(
TypedEq
<
int
&>
(
a
))).
WillByDefault
(
Return
());
}
}
...
...
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