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
4cd148e5
Commit
4cd148e5
authored
Jun 11, 2009
by
zhanyong.wan
Browse files
Removes the .WithArguments() clause from ON_CALL and EXPECT_CALL.
parent
07587e9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
42 deletions
+0
-42
include/gmock/gmock-spec-builders.h
include/gmock/gmock-spec-builders.h
+0
-14
test/gmock-spec-builders_test.cc
test/gmock-spec-builders_test.cc
+0
-28
No files found.
include/gmock/gmock-spec-builders.h
View file @
4cd148e5
...
...
@@ -163,14 +163,6 @@ class DefaultActionSpec {
return
*
this
;
}
// Implements the .WithArguments() clause as a synonym of .With()
// for backward compatibility. WithArguments() is deprecated and
// new code should always use With(), as .With(Args<1, 2>(m)) is
// clearer than .WithArguments(Args<1, 2>(m)).
DefaultActionSpec
&
WithArguments
(
const
Matcher
<
const
ArgumentTuple
&>&
m
)
{
return
With
(
m
);
}
// Implements the .WillByDefault() clause.
DefaultActionSpec
&
WillByDefault
(
const
Action
<
F
>&
action
)
{
ExpectSpecProperty
(
last_clause_
<
kWillByDefault
,
...
...
@@ -615,12 +607,6 @@ class Expectation : public ExpectationBase {
return
*
this
;
}
// Implements the .WithArguments() clause as a synonym of .With().
// This is deprecated and new code should always use With().
Expectation
&
WithArguments
(
const
Matcher
<
const
ArgumentTuple
&>&
m
)
{
return
With
(
m
);
}
// Implements the .Times() clause.
Expectation
&
Times
(
const
Cardinality
&
cardinality
)
{
if
(
last_clause_
==
kTimes
)
{
...
...
test/gmock-spec-builders_test.cc
View file @
4cd148e5
...
...
@@ -194,21 +194,6 @@ TEST(OnCallSyntaxTest, WithCanAppearAtMostOnce) {
},
".With() cannot appear more than once in an ON_CALL()"
);
}
TEST
(
OnCallSyntaxTest
,
WithArgumentsIsSynonymOfWith
)
{
MockA
a
;
ON_CALL
(
a
,
ReturnInt
(
_
,
_
))
.
WithArguments
(
Lt
())
.
WillByDefault
(
Return
(
1
));
ON_CALL
(
a
,
ReturnInt
(
_
,
_
))
.
WithArguments
(
Gt
())
.
WillByDefault
(
Return
(
2
));
EXPECT_CALL
(
a
,
ReturnInt
(
_
,
_
))
.
Times
(
AnyNumber
());
EXPECT_EQ
(
1
,
a
.
ReturnInt
(
1
,
2
));
EXPECT_EQ
(
2
,
a
.
ReturnInt
(
2
,
1
));
}
#if GTEST_HAS_DEATH_TEST
TEST
(
OnCallSyntaxTest
,
WillByDefaultIsMandatory
)
{
...
...
@@ -296,19 +281,6 @@ TEST(ExpectCallSyntaxTest, WithMustBeFirstClause) {
a
.
DoA
(
2
);
}
TEST
(
ExpectCallSyntaxTest
,
WithArgumentsIsSynonymOfWith
)
{
MockA
a
;
EXPECT_CALL
(
a
,
ReturnInt
(
_
,
_
))
.
WithArguments
(
Lt
())
.
WillOnce
(
Return
(
1
));
EXPECT_CALL
(
a
,
ReturnInt
(
_
,
_
))
.
WithArguments
(
Gt
())
.
WillOnce
(
Return
(
2
));
EXPECT_EQ
(
1
,
a
.
ReturnInt
(
1
,
2
));
EXPECT_EQ
(
2
,
a
.
ReturnInt
(
2
,
1
));
}
TEST
(
ExpectCallSyntaxTest
,
TimesCanBeInferred
)
{
MockA
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