Home | History | Annotate | Download | only in gmock

Lines Matching refs:Const

147       const void* untyped_args,
148 const string& call_description) const = 0;
154 const void* untyped_action,
155 const void* untyped_args) const = 0;
161 const void* untyped_args,
162 ::std::ostream* os) const
171 virtual const ExpectationBase* UntypedFindMatchingExpectation(
172 const void* untyped_args,
173 const void** untyped_action, bool* is_excessive,
178 virtual void UntypedPrintArgs(const void* untyped_args,
179 ::std::ostream* os) const = 0;
186 void RegisterOwner(const void* mock_obj)
192 void SetOwnerAndName(const void* mock_obj, const char* name)
198 const void* MockObject() const
203 const char* Name() const
210 const UntypedActionResultHolderBase* UntypedInvokeWith(
211 const void* untyped_args)
215 typedef std::vector<const void*> UntypedOnCallSpecs;
227 const void* mock_obj_; // Protected by g_gmock_mutex.
231 const char* name_; // Protected by g_gmock_mutex.
244 UntypedOnCallSpecBase(const char* a_file, int a_line)
248 const char* file() const { return file_; }
249 int line() const { return line_; }
262 void AssertSpecProperty(bool property, const string& failure_message) const {
267 void ExpectSpecProperty(bool property, const string& failure_message) const {
271 const char* file_;
288 OnCallSpec(const char* a_file, int a_line,
289 const ArgumentMatcherTuple& matchers)
295 // overloaded constructors of Matcher<const ArgumentTuple&>).
296 extra_matcher_(A<const ArgumentTuple&>()) {
300 OnCallSpec& With(const Matcher<const ArgumentTuple&>& m) {
312 OnCallSpec& WillByDefault(const Action<F>& action) {
325 bool Matches(const ArgumentTuple& args) const {
330 const Action<F>& GetAction() const {
352 Matcher<const ArgumentTuple&> extra_matcher_;
372 static void AllowLeak(const void* mock_obj)
403 static void AllowUninterestingCalls(const void* mock_obj)
408 static void WarnUninterestingCalls(const void* mock_obj)
413 static void FailUninterestingCalls(const void* mock_obj)
418 static void UnregisterCallReaction(const void* mock_obj)
424 const void* mock_obj)
439 const void* mock_obj,
447 const void* mock_obj, const char* file, int line)
470 // - Constness is shallow: a const Expectation object itself cannot
491 // Expectation objects, and needs to call the non-const Retire()
493 // Expectation must receive a *non-const* reference to the
501 bool operator==(const Expectation& rhs) const {
505 bool operator!=(const Expectation& rhs) const { return !(*this == rhs); }
522 bool operator()(const Expectation& lhs, const Expectation& rhs) const {
530 const internal::linked_ptr<internal::ExpectationBase>& expectation_base);
533 const internal::linked_ptr<internal::ExpectationBase>&
534 expectation_base() const {
557 // A bidirectional iterator that can read a const element in the set.
576 ExpectationSet(const Expectation& e) { // NOLINT
585 bool operator==(const ExpectationSet& rhs) const {
589 bool operator!=(const ExpectationSet& rhs) const { return !(*this == rhs); }
593 ExpectationSet& operator+=(const Expectation& e) {
598 int size() const { return static_cast<int>(expectations_.size()); }
600 const_iterator begin() const { return expectations_.begin(); }
601 const_iterator end() const { return expectations_.end(); }
618 void AddExpectation(const Expectation& expectation) const;
685 ExpectationBase(const char* file, int line, const string& source_text);
690 const char* file() const { return file_; }
691 int line() const { return line_; }
692 const char* source_text() const { return source_text_.c_str(); }
694 const Cardinality& cardinality() const { return cardinality_; }
697 void DescribeLocationTo(::std::ostream* os) const {
703 void DescribeCallCountTo(::std::ostream* os) const
726 typedef std::vector<const void*> UntypedActions;
733 void AssertSpecProperty(bool property, const string& failure_message) const {
738 void ExpectSpecProperty(bool property, const string& failure_message) const {
744 void SpecifyCardinality(const Cardinality& cardinality);
748 bool cardinality_specified() const { return cardinality_specified_; }
751 void set_cardinality(const Cardinality& a_cardinality) {
764 bool is_retired() const
778 bool IsSatisfied() const
785 bool IsSaturated() const
792 bool IsOverSaturated() const
799 bool AllPrerequisitesAreSatisfied() const
803 void FindUnsatisfiedPrerequisites(ExpectationSet* result) const
807 int call_count() const
824 void CheckActionCountIfNotDone() const
834 void UntypedTimes(const Cardinality& a_cardinality);
838 const char* file_; // The file that contains the expectation.
840 const string source_text_; // The EXPECT_CALL(...) source text.
876 const char* a_file, int a_line, const string& a_source_text,
877 const ArgumentMatcherTuple& m)
884 // overloaded constructors of Matcher<const ArgumentTuple&>).
885 extra_matcher_(A<const ArgumentTuple&>()),
894 delete static_cast<const Action<F>*>(*it);
899 TypedExpectation& With(const Matcher<const ArgumentTuple&>& m) {
917 TypedExpectation& Times(const Cardinality& a_cardinality) {
928 TypedExpectation& InSequence(const Sequence& s) {
938 TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2) {
941 TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
942 const Sequence& s3) {
945 TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
946 const Sequence& s3, const Sequence& s4) {
949 TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
950 const Sequence& s3, const Sequence& s4,
951 const Sequence& s5) {
956 TypedExpectation& After(const ExpectationSet& s) {
968 TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2) {
971 TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
972 const ExpectationSet& s3) {
975 TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
976 const ExpectationSet& s3, const ExpectationSet& s4) {
979 TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
980 const ExpectationSet& s3, const ExpectationSet& s4,
981 const ExpectationSet& s5) {
986 TypedExpectation& WillOnce(const Action<F>& action) {
1000 TypedExpectation& WillRepeatedly(const Action<F>& action) {
1040 const ArgumentMatcherTuple& matchers() const {
1045 const Matcher<const ArgumentTuple&>& extra_matcher() const {
1050 const Action<F>& repeated_action() const { return repeated_action_; }
1077 bool Matches(const ArgumentTuple& args) const
1084 bool ShouldHandleArguments(const ArgumentTuple& args) const
1099 const ArgumentTuple& args,
1100 ::std::ostream* os) const
1143 const Action<F>& GetCurrentAction(
1144 const FunctionMockerBase<F>* mocker,
1145 const ArgumentTuple& args) const
1148 const int count = call_count();
1153 const int action_count = static_cast<int>(untyped_actions_.size());
1169 *static_cast<const Action<F>*>(untyped_actions_[count - 1]) :
1177 // Mock does it to 'why'. This method is not const as it calls
1180 const Action<F>* GetActionForArguments(
1181 const FunctionMockerBase<F>* mocker,
1182 const ArgumentTuple& args,
1214 FunctionMockerBase<F>* const owner_;
1216 Matcher<const ArgumentTuple&> extra_matcher_;
1234 const char* file, int line,
1235 const string& message);
1252 const char* file, int line, const char* obj, const char* call) {
1261 const char* file, int line, const char* obj, const char* call) {
1262 const string source_text(string("EXPECT_CALL(") + obj + ", " + call + ")");
1272 void SetMatchers(const ArgumentMatcherTuple& matchers) {
1277 internal::FunctionMockerBase<F>* const function_mocker_;
1308 virtual void PrintAsActionResult(::std::ostream* os) const = 0;
1321 T GetValueAndDelete() const {
1328 virtual void PrintAsActionResult(::std::ostream* os) const {
1338 const FunctionMockerBase<F>* func_mocker,
1339 const typename Function<F>::ArgumentTuple& args,
1340 const string& call_description) {
1349 PerformAction(const Action<F>& action,
1350 const typename Function<F>::ArgumentTuple& args) {
1365 void GetValueAndDelete() const { delete this; }
1367 virtual void PrintAsActionResult(::std::ostream* /* os */) const {}
1372 const FunctionMockerBase<F>* func_mocker,
1373 const typename Function<F>::ArgumentTuple& args,
1374 const string& call_description) {
1382 const Action<F>& action,
1383 const typename Function<F>::ArgumentTuple& args) {
1415 const OnCallSpec<F>* FindOnCallSpec(
1416 const ArgumentTuple& args) const {
1420 const OnCallSpec<F>* spec = static_cast<const OnCallSpec<F>*>(*it);
1433 Result PerformDefaultAction(const ArgumentTuple& args,
1434 const string& call_description) const {
1435 const OnCallSpec<F>* const spec =
1452 const void* untyped_args, // must point to an ArgumentTuple
1453 const string& call_description) const {
1454 const ArgumentTuple& args =
1455 *static_cast<const ArgumentTuple*>(untyped_args);
1464 const void* untyped_action, const void* untyped_args) const {
1467 const Action<F> action = *static_cast<const Action<F>*>(untyped_action);
1468 const ArgumentTuple& args =
1469 *static_cast<const ArgumentTuple*>(untyped_args);
1493 delete static_cast<const OnCallSpec<F>*>(*it);
1510 Result InvokeWith(const ArgumentTuple& args)
1512 return static_cast<const ResultHolder*>(
1518 const char* file, int line,
1519 const ArgumentMatcherTuple& m)
1522 OnCallSpec<F>* const on_call_spec = new OnCallSpec<F>(file, line, m);
1529 const char* file,
1531 const string& source_text,
1532 const ArgumentMatcherTuple& m)
1535 TypedExpectation<F>* const expectation =
1537 const linked_ptr<ExpectationBase> untyped_expectation(expectation);
1541 Sequence* const implicit_sequence = g_gmock_implicit_sequence.get();
1561 void DescribeDefaultActionTo(const ArgumentTuple& args,
1562 ::std::ostream* os) const {
1563 const OnCallSpec<F>* const spec = FindOnCallSpec(args);
1579 const void* untyped_args,
1580 ::std::ostream* os) const
1582 const ArgumentTuple& args =
1583 *static_cast<const ArgumentTuple*>(untyped_args);
1606 virtual const ExpectationBase* UntypedFindMatchingExpectation(
1607 const void* untyped_args,
1608 const void** untyped_action, bool* is_excessive,
1611 const ArgumentTuple& args =
1612 *static_cast<const ArgumentTuple*>(untyped_args);
1624 const Action<F>* action = exp->GetActionForArguments(this, args, what, why);
1632 virtual void UntypedPrintArgs(const void* untyped_args,
1633 ::std::ostream* os) const {
1634 const ArgumentTuple& args =
1635 *static_cast<const ArgumentTuple*>(untyped_args);
1642 const ArgumentTuple& args) const
1648 TypedExpectation<F>* const exp =
1659 const ArgumentTuple& args,
1661 ::std::ostream* why) const
1672 const ArgumentTuple& args,
1673 ::std::ostream* why) const
1676 const int count = static_cast<int>(untyped_expectations_.size());
1682 TypedExpectation<F>* const expectation =
1708 // MockFoo(const MockFoo& src) {}
1726 void ReportUninterestingCall(CallReaction reaction, const string& msg);
1737 // Const(x) is a convenient function for obtaining a const reference
1739 // const mock method, e.g.
1748 // // Expects a call to non-const MockFoo::Bar().
1750 // // Expects a call to const MockFoo::Bar().
1751 // EXPECT_CALL(Const(foo), Bar());
1753 inline const T& Const(const T& x) { return x; }