60 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_ 61 #define GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_ 69 #if GTEST_HAS_EXCEPTIONS 73 #include "gmock/gmock-actions.h" 74 #include "gmock/gmock-cardinalities.h" 75 #include "gmock/gmock-matchers.h" 76 #include "gmock/internal/gmock-internal-utils.h" 77 #include "gmock/internal/gmock-port.h" 78 #include "gtest/gtest.h" 93 template <
typename F>
class FunctionMocker;
96 class ExpectationBase;
102 class ExpectationTester;
134 bool VerifyAndClearExpectationsLocked()
138 virtual void ClearDefaultActionsLocked()
151 const void* untyped_args,
152 const string& call_description)
const = 0;
158 const void* untyped_action,
159 const void* untyped_args)
const = 0;
164 virtual void UntypedDescribeUninterestingCall(
165 const void* untyped_args,
166 ::std::ostream* os)
const 176 const void* untyped_args,
177 const void** untyped_action,
bool* is_excessive,
178 ::std::ostream* what, ::std::ostream* why)
182 virtual void UntypedPrintArgs(
const void* untyped_args,
183 ::std::ostream* os)
const = 0;
190 void RegisterOwner(
const void* mock_obj)
196 void SetOwnerAndName(
const void* mock_obj,
const char* name)
202 const void* MockObject()
const 207 const char* Name()
const 215 const void* untyped_args)
221 typedef std::vector<internal::linked_ptr<ExpectationBase> >
284 template <
typename F>
307 ".With() cannot appear " 308 "more than once in an ON_CALL().");
318 ".WillByDefault() must appear " 319 "exactly once in an ON_CALL().");
323 "DoDefault() cannot be used in ON_CALL().");
336 ".WillByDefault() must appear exactly " 337 "once in an ON_CALL().");
377 static void AllowLeak(
const void* mock_obj)
383 static bool VerifyAndClearExpectations(
void* mock_obj)
389 static bool VerifyAndClear(
void* mock_obj)
397 template <
typename F>
400 template <
typename M>
403 template <
typename M>
406 template <
typename M>
411 static void AllowUninterestingCalls(
const void* mock_obj)
416 static void WarnUninterestingCalls(
const void* mock_obj)
421 static void FailUninterestingCalls(
const void* mock_obj)
426 static void UnregisterCallReaction(
const void* mock_obj)
432 const void* mock_obj)
438 static bool VerifyAndClearExpectationsLocked(
void* mock_obj)
442 static void ClearDefaultActionsLocked(
void* mock_obj)
446 static void Register(
447 const void* mock_obj,
454 static void RegisterUseByOnCallOrExpectCall(
455 const void* mock_obj,
const char* file,
int line)
510 return expectation_base_ == rhs.expectation_base_;
518 friend class ::testing::internal::ExpectationBase;
519 friend class ::testing::internal::UntypedFunctionMockerBase;
521 template <
typename F>
522 friend class ::testing::internal::FunctionMockerBase;
524 template <
typename F>
525 friend class ::testing::internal::TypedExpectation;
531 return lhs.expectation_base_.get() < rhs.expectation_base_.get();
535 typedef ::std::set<Expectation, Less> Set;
542 expectation_base()
const {
543 return expectation_base_;
547 internal::linked_ptr<internal::ExpectationBase> expectation_base_;
594 return expectations_ == rhs.expectations_;
602 expectations_.insert(e);
606 int size()
const {
return static_cast<int>(expectations_.size()); }
612 Expectation::Set expectations_;
626 void AddExpectation(
const Expectation& expectation)
const;
665 bool sequence_created_;
693 ExpectationBase(
const char* file,
int line,
const string& source_text);
698 const char*
file()
const {
return file_; }
699 int line()
const {
return line_; }
711 void DescribeCallCountTo(::std::ostream* os)
const 716 virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) = 0;
719 friend class ::testing::Expectation;
742 Assert(property, file_, line_, failure_message);
747 Expect(property, file_, line_, failure_message);
752 void SpecifyCardinality(
const Cardinality& cardinality);
760 cardinality_ = a_cardinality;
768 void RetireAllPreRequisites()
772 bool is_retired() const
774 g_gmock_mutex.AssertHeld();
781 g_gmock_mutex.AssertHeld();
788 g_gmock_mutex.AssertHeld();
789 return cardinality().IsSatisfiedByCallCount(call_count_);
795 g_gmock_mutex.AssertHeld();
796 return cardinality().IsSaturatedByCallCount(call_count_);
802 g_gmock_mutex.AssertHeld();
803 return cardinality().IsOverSaturatedByCallCount(call_count_);
807 bool AllPrerequisitesAreSatisfied() const
815 int call_count() const
817 g_gmock_mutex.AssertHeld();
824 g_gmock_mutex.AssertHeld();
832 void CheckActionCountIfNotDone() const
836 friend class ::
testing::internal::ExpectationTester;
842 void UntypedTimes(const
Cardinality& a_cardinality);
848 const
string source_text_;
850 bool cardinality_specified_;
865 bool extra_matcher_specified_;
866 bool repeated_action_specified_;
867 bool retires_on_saturation_;
869 mutable
bool action_count_checked_;
876 template <typename F>
884 const char* a_file,
int a_line,
const string& a_source_text,
899 CheckActionCountIfNotDone();
900 for (UntypedActions::const_iterator it = untyped_actions_.begin();
901 it != untyped_actions_.end(); ++it) {
902 delete static_cast<const Action<F>*
>(*it);
908 if (last_clause_ == kWith) {
909 ExpectSpecProperty(
false,
910 ".With() cannot appear " 911 "more than once in an EXPECT_CALL().");
913 ExpectSpecProperty(last_clause_ < kWith,
914 ".With() must be the first " 915 "clause in an EXPECT_CALL().");
917 last_clause_ = kWith;
920 extra_matcher_specified_ =
true;
937 ExpectSpecProperty(last_clause_ <= kInSequence,
938 ".InSequence() cannot appear after .After()," 939 " .WillOnce(), .WillRepeatedly(), or " 940 ".RetiresOnSaturation().");
941 last_clause_ = kInSequence;
965 ExpectSpecProperty(last_clause_ <= kAfter,
966 ".After() cannot appear after .WillOnce()," 967 " .WillRepeatedly(), or " 968 ".RetiresOnSaturation().");
969 last_clause_ = kAfter;
972 immediate_prerequisites_ += *it;
977 return After(s1).
After(s2);
981 return After(s1, s2).
After(s3);
985 return After(s1, s2, s3).
After(s4);
990 return After(s1, s2, s3, s4).
After(s5);
995 ExpectSpecProperty(last_clause_ <= kWillOnce,
996 ".WillOnce() cannot appear after " 997 ".WillRepeatedly() or .RetiresOnSaturation().");
998 last_clause_ = kWillOnce;
1000 untyped_actions_.push_back(
new Action<F>(action));
1001 if (!cardinality_specified()) {
1002 set_cardinality(
Exactly(static_cast<int>(untyped_actions_.size())));
1009 if (last_clause_ == kWillRepeatedly) {
1010 ExpectSpecProperty(
false,
1011 ".WillRepeatedly() cannot appear " 1012 "more than once in an EXPECT_CALL().");
1014 ExpectSpecProperty(last_clause_ < kWillRepeatedly,
1015 ".WillRepeatedly() cannot appear " 1016 "after .RetiresOnSaturation().");
1018 last_clause_ = kWillRepeatedly;
1019 repeated_action_specified_ =
true;
1021 repeated_action_ = action;
1022 if (!cardinality_specified()) {
1023 set_cardinality(
AtLeast(static_cast<int>(untyped_actions_.size())));
1028 CheckActionCountIfNotDone();
1034 ExpectSpecProperty(last_clause_ < kRetiresOnSaturation,
1035 ".RetiresOnSaturation() cannot appear " 1037 last_clause_ = kRetiresOnSaturation;
1038 retires_on_saturation_ =
true;
1042 CheckActionCountIfNotDone();
1054 return extra_matcher_;
1063 if (extra_matcher_specified_) {
1064 *os <<
" Expected args: ";
1065 extra_matcher_.DescribeTo(os);
1071 template <
typename Function>
1077 return owner_->GetHandleOf(
this);
1085 bool Matches(
const ArgumentTuple& args)
const 1087 g_gmock_mutex.AssertHeld();
1088 return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
1092 bool ShouldHandleArguments(
const ArgumentTuple& args)
const 1094 g_gmock_mutex.AssertHeld();
1100 CheckActionCountIfNotDone();
1101 return !is_retired() && AllPrerequisitesAreSatisfied() &&
Matches(args);
1106 void ExplainMatchResultTo(
1107 const ArgumentTuple& args,
1108 ::std::ostream* os)
const 1110 g_gmock_mutex.AssertHeld();
1113 *os <<
" Expected: the expectation is active\n" 1114 <<
" Actual: it is retired\n";
1119 StringMatchResultListener listener;
1120 if (!extra_matcher_.MatchAndExplain(args, &listener)) {
1121 *os <<
" Expected args: ";
1122 extra_matcher_.DescribeTo(os);
1123 *os <<
"\n Actual: don't match";
1128 }
else if (!AllPrerequisitesAreSatisfied()) {
1129 *os <<
" Expected: all pre-requisites are satisfied\n" 1130 <<
" Actual: the following immediate pre-requisites " 1131 <<
"are not satisfied:\n";
1132 ExpectationSet unsatisfied_prereqs;
1133 FindUnsatisfiedPrerequisites(&unsatisfied_prereqs);
1136 it != unsatisfied_prereqs.end(); ++it) {
1137 it->expectation_base()->DescribeLocationTo(os);
1138 *os <<
"pre-requisite #" << i++ <<
"\n";
1140 *os <<
" (end of pre-requisites)\n";
1146 *os <<
"The call matches the expectation.\n";
1151 const Action<F>& GetCurrentAction(
1152 const FunctionMockerBase<F>* mocker,
1153 const ArgumentTuple& args)
const 1155 g_gmock_mutex.AssertHeld();
1156 const int count = call_count();
1157 Assert(count >= 1, __FILE__, __LINE__,
1158 "call_count() is <= 0 when GetCurrentAction() is " 1159 "called - this should never happen.");
1161 const int action_count =
static_cast<int>(untyped_actions_.size());
1162 if (action_count > 0 && !repeated_action_specified_ &&
1163 count > action_count) {
1166 ::std::stringstream ss;
1167 DescribeLocationTo(&ss);
1168 ss <<
"Actions ran out in " << source_text() <<
"...\n" 1169 <<
"Called " << count <<
" times, but only " 1170 << action_count <<
" WillOnce()" 1171 << (action_count == 1 ?
" is" :
"s are") <<
" specified - ";
1172 mocker->DescribeDefaultActionTo(args, &ss);
1176 return count <= action_count ?
1177 *
static_cast<const Action<F>*
>(untyped_actions_[count - 1]) :
1188 const Action<F>* GetActionForArguments(
1189 const FunctionMockerBase<F>* mocker,
1190 const ArgumentTuple& args,
1191 ::std::ostream* what,
1192 ::std::ostream* why)
1194 g_gmock_mutex.AssertHeld();
1195 if (IsSaturated()) {
1197 IncrementCallCount();
1198 *what <<
"Mock function called more times than expected - ";
1199 mocker->DescribeDefaultActionTo(args, what);
1200 DescribeCallCountTo(why);
1208 IncrementCallCount();
1209 RetireAllPreRequisites();
1211 if (retires_on_saturation_ && IsSaturated()) {
1216 *what <<
"Mock function call matches " << source_text() <<
"...\n";
1217 return &(GetCurrentAction(mocker, args));
1222 FunctionMockerBase<F>*
const owner_;
1223 ArgumentMatcherTuple matchers_;
1224 Matcher<const ArgumentTuple&> extra_matcher_;
1225 Action<F> repeated_action_;
1242 const char* file,
int line,
1243 const string& message);
1245 template <
typename F>
1255 : function_mocker_(function_mocker) {}
1260 const char* file,
int line,
const char* obj,
const char* call) {
1262 string(
"ON_CALL(") + obj +
", " + call +
") invoked");
1263 return function_mocker_->AddNewOnCallSpec(file, line, matchers_);
1269 const char* file,
int line,
const char* obj,
const char* call) {
1270 const string source_text(
string(
"EXPECT_CALL(") + obj +
", " + call +
")");
1272 return function_mocker_->AddNewExpectation(
1273 file, line, source_text, matchers_);
1277 template <
typename Function>
1281 matchers_ = matchers;
1287 ArgumentMatcherTuple matchers_;
1298 # pragma warning(push) // Saves the current warning state. 1299 # pragma warning(disable:4355) // Temporarily disables warning 4355. 1316 virtual void PrintAsActionResult(::std::ostream* os)
const = 0;
1320 template <
typename T>
1337 *os <<
"\n Returns: ";
1344 template <
typename F>
1348 const string& call_description) {
1355 template <
typename F>
1378 template <
typename F>
1382 const string& call_description) {
1388 template <
typename F>
1400 template <
typename F>
1401 class FunctionMockerBase :
public UntypedFunctionMockerBase {
1415 VerifyAndClearExpectationsLocked();
1416 Mock::UnregisterLocked(
this);
1417 ClearDefaultActionsLocked();
1425 for (UntypedOnCallSpecs::const_reverse_iterator it
1426 = untyped_on_call_specs_.rbegin();
1427 it != untyped_on_call_specs_.rend(); ++it) {
1444 const string& call_description)
const {
1446 this->FindOnCallSpec(args);
1450 const string message = call_description +
1451 "\n The mock function has no default action " 1452 "set, and its return type has no default value set.";
1453 #if GTEST_HAS_EXCEPTIONS 1455 throw std::runtime_error(message);
1469 const void* untyped_args,
1470 const string& call_description)
const {
1473 return ResultHolder::PerformDefaultAction(
this, args, call_description);
1481 const void* untyped_action,
const void* untyped_args)
const {
1487 return ResultHolder::PerformAction(action, args);
1494 g_gmock_mutex.AssertHeld();
1504 untyped_on_call_specs_.swap(specs_to_delete);
1506 g_gmock_mutex.Unlock();
1507 for (UntypedOnCallSpecs::const_iterator it =
1508 specs_to_delete.begin();
1509 it != specs_to_delete.end(); ++it) {
1515 g_gmock_mutex.Lock();
1519 template <
typename Function>
1530 this->UntypedInvokeWith(&args))->GetValueAndDelete();
1535 const char* file,
int line,
1538 Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);
1540 untyped_on_call_specs_.push_back(on_call_spec);
1541 return *on_call_spec;
1548 const string& source_text,
1551 Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);
1555 untyped_expectations_.push_back(untyped_expectation);
1559 if (implicit_sequence != NULL) {
1563 return *expectation;
1579 ::std::ostream* os)
const {
1583 *os << (internal::type_equals<Result, void>::value ?
1584 "returning directly.\n" :
1585 "returning default value.\n");
1587 *os <<
"taking default action specified at:\n" 1595 virtual void UntypedDescribeUninterestingCall(
1596 const void* untyped_args,
1597 ::std::ostream* os)
const 1599 const ArgumentTuple& args =
1600 *
static_cast<const ArgumentTuple*
>(untyped_args);
1601 *os <<
"Uninteresting mock function call - ";
1602 DescribeDefaultActionTo(args, os);
1603 *os <<
" Function call: " << Name();
1623 virtual const ExpectationBase* UntypedFindMatchingExpectation(
1624 const void* untyped_args,
1625 const void** untyped_action,
bool* is_excessive,
1626 ::std::ostream* what, ::std::ostream* why)
1628 const ArgumentTuple& args =
1629 *
static_cast<const ArgumentTuple*
>(untyped_args);
1631 TypedExpectation<F>* exp = this->FindMatchingExpectationLocked(args);
1633 this->FormatUnexpectedCallMessageLocked(args, what, why);
1640 *is_excessive = exp->IsSaturated();
1641 const Action<F>* action = exp->GetActionForArguments(
this, args, what, why);
1642 if (action != NULL && action->IsDoDefault())
1644 *untyped_action = action;
1649 virtual void UntypedPrintArgs(
const void* untyped_args,
1650 ::std::ostream* os)
const {
1651 const ArgumentTuple& args =
1652 *
static_cast<const ArgumentTuple*
>(untyped_args);
1658 TypedExpectation<F>* FindMatchingExpectationLocked(
1659 const ArgumentTuple& args)
const 1661 g_gmock_mutex.AssertHeld();
1662 for (
typename UntypedExpectations::const_reverse_iterator it =
1663 untyped_expectations_.rbegin();
1664 it != untyped_expectations_.rend(); ++it) {
1665 TypedExpectation<F>*
const exp =
1666 static_cast<TypedExpectation<F>*
>(it->get());
1667 if (exp->ShouldHandleArguments(args)) {
1675 void FormatUnexpectedCallMessageLocked(
1676 const ArgumentTuple& args,
1678 ::std::ostream* why)
const 1680 g_gmock_mutex.AssertHeld();
1681 *os <<
"\nUnexpected mock function call - ";
1682 DescribeDefaultActionTo(args, os);
1683 PrintTriedExpectationsLocked(args, why);
1688 void PrintTriedExpectationsLocked(
1689 const ArgumentTuple& args,
1690 ::std::ostream* why)
const 1692 g_gmock_mutex.AssertHeld();
1693 const int count =
static_cast<int>(untyped_expectations_.size());
1694 *why <<
"Google Mock tried the following " << count <<
" " 1695 << (count == 1 ?
"expectation, but it didn't match" :
1696 "expectations, but none matched")
1698 for (
int i = 0; i < count; i++) {
1699 TypedExpectation<F>*
const expectation =
1700 static_cast<TypedExpectation<F>*
>(untyped_expectations_[i].get());
1702 expectation->DescribeLocationTo(why);
1704 *why <<
"tried expectation #" << i <<
": ";
1706 *why << expectation->source_text() <<
"...\n";
1707 expectation->ExplainMatchResultTo(args, why);
1708 expectation->DescribeCallCountTo(why);
1714 MockSpec<F> current_spec_;
1732 # pragma warning(pop) // Restores the warning state. 1752 using internal::MockSpec;
1769 template <
typename T>
1770 inline const T&
Const(
const T& x) {
return x; }
1774 : expectation_base_(exp.GetHandle().expectation_base()) {}
1782 #define GMOCK_ON_CALL_IMPL_(obj, call) \ 1783 ((obj).gmock_##call).InternalDefaultActionSetAt(__FILE__, __LINE__, \ 1785 #define ON_CALL(obj, call) GMOCK_ON_CALL_IMPL_(obj, call) 1787 #define GMOCK_EXPECT_CALL_IMPL_(obj, call) \ 1788 ((obj).gmock_##call).InternalExpectedAt(__FILE__, __LINE__, #obj, #call) 1789 #define EXPECT_CALL(obj, call) GMOCK_EXPECT_CALL_IMPL_(obj, call) 1791 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_ virtual ~TypedExpectation()
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:896
Definition: dsd/test/gmock/include/gmock/gmock-generated-nice-strict.h:80
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:728
Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:880
GTEST_API_ ThreadLocal< Sequence * > g_gmock_implicit_sequence
Definition: mbelib/test/gmock/include/gmock/gmock-spec-builders.h:674
int size() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:606
OnCallSpec(const char *a_file, int a_line, const ArgumentMatcherTuple &matchers)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:292
virtual ~UntypedActionResultHolderBase()
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1313
Definition: dsd/test/gmock/include/gmock/gmock-actions.h:49
virtual ~FunctionMockerBase() GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1412
ExpectationSet(const Expectation &e)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:584
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:660
TypedExpectation & Times(int n)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:931
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:724
GTEST_API_ Cardinality AtLeast(int n)
bool operator==(const ExpectationSet &rhs) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:593
TypedExpectation(FunctionMockerBase< F > *owner, const char *a_file, int a_line, const string &a_source_text, const ArgumentMatcherTuple &m)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:883
bool operator==(const Expectation &rhs) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:509
const char * file() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:252
int line() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:253
ExpectationSet(internal::ExpectationBase &exp)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:577
virtual UntypedActionResultHolderBase * UntypedPerformAction(const void *untyped_action, const void *untyped_args) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1480
TypedExpectation & WillOnce(const Action< F > &action)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:994
int line_
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:276
const char * file() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:698
static ActionResultHolder * PerformAction(const Action< F > &action, const typename Function< F >::ArgumentTuple &args)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1357
const Action< F > & GetAction() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:334
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1321
static void Print(const T &value, ::std::ostream *os)
Definition: dsd/test/gtest/include/gtest/gtest-printers.h:591
void DescribeLocationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:705
bool IsSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:786
#define GTEST_LOCK_EXCLUDED_(locks)
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:1928
std::vector< internal::linked_ptr< ExpectationBase > > UntypedExpectations
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:222
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1246
GTEST_API_ ::std::string FormatFileLocation(const char *file, int line)
UntypedExpectations untyped_expectations_
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:241
MockSpec(internal::FunctionMockerBase< F > *function_mocker)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1254
TypedExpectation & Times(const Cardinality &a_cardinality)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:925
virtual void PrintAsActionResult(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1336
TypedExpectation< F > & AddNewExpectation(const char *file, int line, const string &source_text, const ArgumentMatcherTuple &m) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1545
Result PerformDefaultAction(const ArgumentTuple &args, const string &call_description) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1443
virtual UntypedActionResultHolderBase * UntypedPerformDefaultAction(const void *untyped_args, const string &call_description) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1468
internal::OnCallSpec< F > & InternalDefaultActionSetAt(const char *file, int line, const char *obj, const char *call)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1259
const char * source_text() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:700
#define GTEST_API_
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:768
const char * file_
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:275
int line() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:699
static ActionResultHolder * PerformDefaultAction(const FunctionMockerBase< F > *func_mocker, const typename Function< F >::ArgumentTuple &args, const string &call_description)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1379
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:953
GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_gmock_mutex)
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:976
bool Matches(const ArgumentTuple &args) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:329
void ExpectSpecProperty(bool property, const string &failure_message) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:271
const ArgumentMatcherTuple & matchers() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1048
Function< F >::ArgumentTuple ArgumentTuple
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1404
void IncrementCallCount() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:822
const_iterator begin() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:608
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:775
void UntypedTimes(const Cardinality &a_cardinality)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:362
static ActionResultHolder * PerformAction(const Action< F > &action, const typename Function< F >::ArgumentTuple &args)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1389
void AssertSpecProperty(bool property, const string &failure_message) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:741
Result InvokeWith(const ArgumentTuple &args) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1527
Function< F >::ArgumentTuple ArgumentTuple
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:287
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4, const ExpectationSet &s5)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:987
const Cardinality & cardinality() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:702
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:983
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:294
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:946
Expectation::Set::const_iterator const_iterator
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:566
OnCallSpec< F > & AddNewOnCallSpec(const char *file, int line, const ArgumentMatcherTuple &m) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1534
OnCallSpec & With(const Matcher< const ArgumentTuple &> &m)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:304
TypedExpectation & RetiresOnSaturation()
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1033
void ReportUninterestingCall(CallReaction reaction, const string &msg)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:690
Clause last_clause_
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:280
Definition: dsd/test/gmock/include/gmock/gmock-actions.h:161
Clause
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:257
Definition: dsd/test/gmock/include/gmock/gmock-actions.h:280
internal::TypedExpectation< F > & InternalExpectedAt(const char *file, int line, const char *obj, const char *call)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1268
T GetValueAndDelete() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1329
Expectation::Set::value_type value_type
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:569
UntypedOnCallSpecs untyped_on_call_specs_
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:238
internal::Function< F >::ArgumentTuple ArgumentTuple
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1248
TypedExpectation & With(const Matcher< const ArgumentTuple &> &m)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:907
TypedExpectation & InSequence(const Sequence &s)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:936
void Expect(bool condition, const char *file, int line, const string &msg)
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:294
Definition: dsd/test/gtest/include/gtest/internal/gtest-linked_ptr.h:136
Definition: dsd/test/gmock/include/gmock/gmock-generated-function-mockers.h:50
bool IsDoDefault() const
Definition: dsd/test/gmock/include/gmock/gmock-actions.h:304
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:1545
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:1558
FunctionMockerBase()
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1407
GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity, const char *file, int line, const string &message)
internal::MatcherAsPredicate< M > Matches(M matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3932
Function< F >::Result Result
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:881
TypedExpectation & WillRepeatedly(const Action< F > &action)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1008
GTestMutexLock MutexLock
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:1563
GTEST_API_ void Log(LogSeverity severity, const string &message, int stack_frames_to_skip)
UntypedOnCallSpecBase(const char *a_file, int a_line)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:248
class GTEST_API_ testing::InSequence GTEST_ATTRIBUTE_UNUSED_
Definition: dsd/test/gmock/include/gmock/gmock-generated-nice-strict.h:176
ExpectationSet()
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:572
ActionResultHolder(T a_value)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1323
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:619
#define GTEST_DISALLOW_ASSIGN_(type)
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:721
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:308
void AddExpectation(const Expectation &expectation) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:725
virtual void PrintAsActionResult(::std::ostream *) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1375
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:371
Function< F >::ArgumentTuple ArgumentTuple
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:879
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:363
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:979
#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:1927
internal::Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1250
LogSeverity
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:306
void Retire() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:779
ExpectationSet & operator+=(const Expectation &e)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:601
Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1405
virtual void ClearDefaultActionsLocked() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1492
bool IsSaturated() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:793
GTEST_API_ Cardinality Exactly(int n)
bool cardinality_specified() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:756
void set_cardinality(const Cardinality &a_cardinality)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:759
CallReaction
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:361
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:730
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:99
ActionResultHolder< Result > ResultHolder
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1522
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:726
internal::DoDefaultAction DoDefault()
Definition: dsd/test/gmock/include/gmock/gmock-actions.h:972
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4, const Sequence &s5)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:957
MockSpec< F > & current_spec()
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1568
const OnCallSpec< F > * FindOnCallSpec(const ArgumentTuple &args) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1423
OnCallSpec & WillByDefault(const Action< F > &action)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:316
void Assert(bool condition, const char *file, int line)
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:288
TypedExpectation & After(const ExpectationSet &s)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:964
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:563
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:245
const_iterator end() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:609
Matcher< T > A()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3415
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:307
void PrintIfNotEmpty(const internal::string &explanation, ::std::ostream *os)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:653
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:260
std::vector< const void * > UntypedActions
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:734
Definition: dsd/test/gmock/include/gmock/internal/gmock-generated-internal-utils.h:154
static ActionResultHolder * PerformDefaultAction(const FunctionMockerBase< F > *func_mocker, const typename Function< F >::ArgumentTuple &args, const string &call_description)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1345
const Action< F > & repeated_action() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1058
void AssertSpecProperty(bool property, const string &failure_message) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:266
const void * mock_obj_
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:231
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:285
bool Matches(T x) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:236
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:126
Result Perform(const ArgumentTuple &args) const
Definition: dsd/test/gmock/include/gmock/gmock-actions.h:312
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:261
const char * name_
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:235
Definition: dsd/test/gmock/include/gmock/gmock-generated-function-mockers.h:58
Definition: dsd/test/gmock/include/gmock/gmock-generated-nice-strict.h:272
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1311
Clause
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:722
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:262
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:364
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:365
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:729
void ExplainMatchFailureTupleTo(const MatcherTuple &matchers, const ValueTuple &values, ::std::ostream *os)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:790
Sequence()
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:622
bool IsOverSaturated() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:800
Definition: dsd/test/gmock/include/gmock/gmock-cardinalities.h:83
bool operator!=(const Expectation &rhs) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:513
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2, const Sequence &s3)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:949
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:726
void ExpectSpecProperty(bool property, const string &failure_message) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:746
const T & Const(const T &x)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1770
Function< F >::Result Result
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1403
const Matcher< const ArgumentTuple & > & extra_matcher() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1053
Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:288
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:727
void UniversalPrint(const T &value, ::std::ostream *os)
Definition: dsd/test/gtest/include/gtest/gtest-printers.h:752
bool operator!=(const ExpectationSet &rhs) const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:597
std::vector< const void * > UntypedOnCallSpecs
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:219
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:487
static T Get()
Definition: dsd/test/gmock/include/gmock/gmock-actions.h:188
virtual void MaybeDescribeExtraMatcherTo(::std::ostream *os)
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1062
void GetValueAndDelete() const
Definition: dsd/test/gmock/include/gmock/gmock-spec-builders.h:1373