Open GoogleCodeExporter opened 9 years ago
prezess, the snippet you gave uses testing::internal::Expectation. As
the namespace suggests, this is an internal class and not officially
supported. It will change in the future. In fact, it has already
changed if you sync to the trunk head. Therefore a user shouldn't use
it directly.
What you can do is:
InSequence s;
EXPECT_CALL(mock, mockMethod(_))
.Times(i)
.WillRepeatedly(doSth1());
EXPECT_CALL(mock, mockMethod(_))
.Times(j)
.WillRepeatedly(doSth2());
Therefore we don't strictly need a new construct. I'll write a recipe
about this in the cookbook instead. Thanks.
Original comment by zhanyong...@gmail.com
on 16 Jul 2009 at 7:43
WillNTimes() was supposed to become a part of Expectation class interface. I
didn't
want to use it externally. However, indeed it is not essential as can be
replaced by
sequence of expectations. The only drawback of your approach is that
declaration of s
variable forces placement of EXPECT_CALL invocation for different methods,
doesn't it?
Anyways you may reconsider addition of convenience method I proposed to
Expectation
class. Thanks.
Original comment by prez...@gmail.com
on 16 Jul 2009 at 9:07
Original issue reported on code.google.com by
prez...@gmail.com
on 25 Jun 2009 at 1:12