60#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
61#define GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
75#if GTEST_HAS_EXCEPTIONS
133 bool VerifyAndClearExpectationsLocked()
150 void* untyped_args, const
std::
string& call_description) const = 0;
156 const
void* untyped_action,
void* untyped_args) const = 0;
161 virtual
void UntypedDescribeUninterestingCall(
162 const
void* untyped_args,
163 ::
std::ostream*
os) const
173 const
void* untyped_args,
174 const
void** untyped_action,
bool* is_excessive,
175 ::
std::ostream* what, ::
std::ostream* why)
179 virtual
void UntypedPrintArgs(const
void* untyped_args,
180 ::
std::ostream*
os) const = 0;
187 void RegisterOwner(const
void* mock_obj)
193 void SetOwnerAndName(const
void* mock_obj, const
char*
name)
199 const
void* MockObject() const
204 const
char* Name() const
227 const
void* mock_obj_;
253 : file_(a_file), line_(a_line), last_clause_(kNone) {}
256 const char*
file()
const {
return file_; }
257 int line()
const {
return line_; }
271 const std::string& failure_message)
const {
272 Assert(property, file_, line_, failure_message);
277 const std::string& failure_message)
const {
278 Expect(property, file_, line_, failure_message);
312 ExpectSpecProperty(last_clause_ < kWith,
313 ".With() cannot appear "
314 "more than once in an ON_CALL().");
315 last_clause_ = kWith;
323 ExpectSpecProperty(last_clause_ < kWillByDefault,
324 ".WillByDefault() must appear "
325 "exactly once in an ON_CALL().");
326 last_clause_ = kWillByDefault;
328 ExpectSpecProperty(!
action.IsDoDefault(),
329 "DoDefault() cannot be used in ON_CALL().");
336 return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
341 AssertSpecProperty(last_clause_ == kWillByDefault,
342 ".WillByDefault() must appear exactly "
343 "once in an ON_CALL().");
361 ArgumentMatcherTuple matchers_;
382 static void AllowLeak(
const void* mock_obj)
388 static bool VerifyAndClearExpectations(
void* mock_obj)
394 static bool VerifyAndClear(
void* mock_obj)
402 template <
typename F>
405 template <
typename M>
408 template <
typename M>
411 template <
typename M>
416 static void AllowUninterestingCalls(
const void* mock_obj)
421 static void WarnUninterestingCalls(
const void* mock_obj)
426 static void FailUninterestingCalls(
const void* mock_obj)
431 static void UnregisterCallReaction(
const void* mock_obj)
437 const void* mock_obj)
443 static bool VerifyAndClearExpectationsLocked(
void* mock_obj)
447 static void ClearDefaultActionsLocked(
void* mock_obj)
451 static void Register(
452 const void* mock_obj,
459 static void RegisterUseByOnCallOrExpectCall(
460 const void* mock_obj,
const char* file,
int line)
515 return expectation_base_ == rhs.expectation_base_;
523 friend class ::testing::internal::ExpectationBase;
524 friend class ::testing::internal::UntypedFunctionMockerBase;
526 template <
typename F>
527 friend class ::testing::internal::FunctionMockerBase;
529 template <
typename F>
530 friend class ::testing::internal::TypedExpectation;
536 return lhs.expectation_base_.get() < rhs.expectation_base_.get();
540 typedef ::std::set<Expectation, Less> Set;
547 expectation_base()
const {
548 return expectation_base_;
552 internal::linked_ptr<internal::ExpectationBase> expectation_base_;
599 return expectations_ == rhs.expectations_;
607 expectations_.insert(e);
611 int size()
const {
return static_cast<int>(expectations_.size()); }
617 Expectation::Set expectations_;
631 void AddExpectation(
const Expectation& expectation)
const;
670 bool sequence_created_;
679GTEST_API_ extern ThreadLocal<Sequence*> g_gmock_implicit_sequence;
698 ExpectationBase(
const char* file,
int line,
const std::string& source_text);
703 const char*
file()
const {
return file_; }
704 int line()
const {
return line_; }
711 *
os << FormatFileLocation(file(), line()) <<
" ";
716 void DescribeCallCountTo(::std::ostream*
os)
const
724 friend class ::testing::Expectation;
747 const std::string& failure_message)
const {
748 Assert(property, file_, line_, failure_message);
753 const std::string& failure_message)
const {
754 Expect(property, file_, line_, failure_message);
759 void SpecifyCardinality(
const Cardinality& cardinality);
767 cardinality_ = a_cardinality;
775 void RetireAllPreRequisites()
779 bool is_retired() const
781 g_gmock_mutex.AssertHeld();
788 g_gmock_mutex.AssertHeld();
795 g_gmock_mutex.AssertHeld();
796 return cardinality().IsSatisfiedByCallCount(call_count_);
802 g_gmock_mutex.AssertHeld();
803 return cardinality().IsSaturatedByCallCount(call_count_);
809 g_gmock_mutex.AssertHeld();
810 return cardinality().IsOverSaturatedByCallCount(call_count_);
814 bool AllPrerequisitesAreSatisfied() const
822 int call_count() const
824 g_gmock_mutex.AssertHeld();
831 g_gmock_mutex.AssertHeld();
839 void CheckActionCountIfNotDone() const
849 void UntypedTimes(const
Cardinality& a_cardinality);
855 const
std::
string source_text_;
857 bool cardinality_specified_;
872 bool extra_matcher_specified_;
873 bool repeated_action_specified_;
874 bool retires_on_saturation_;
876 mutable
bool action_count_checked_;
891 const std::string& a_source_text,
901 repeated_action_(DoDefault()) {}
906 CheckActionCountIfNotDone();
907 for (UntypedActions::const_iterator it = untyped_actions_.begin();
908 it != untyped_actions_.end(); ++it) {
909 delete static_cast<const Action<F>*
>(*it);
915 if (last_clause_ == kWith) {
916 ExpectSpecProperty(
false,
917 ".With() cannot appear "
918 "more than once in an EXPECT_CALL().");
920 ExpectSpecProperty(last_clause_ < kWith,
921 ".With() must be the first "
922 "clause in an EXPECT_CALL().");
924 last_clause_ = kWith;
927 extra_matcher_specified_ =
true;
933 ExpectationBase::UntypedTimes(a_cardinality);
939 return Times(Exactly(n));
944 ExpectSpecProperty(last_clause_ <= kInSequence,
945 ".InSequence() cannot appear after .After(),"
946 " .WillOnce(), .WillRepeatedly(), or "
947 ".RetiresOnSaturation().");
948 last_clause_ = kInSequence;
950 s.AddExpectation(GetHandle());
972 ExpectSpecProperty(last_clause_ <= kAfter,
973 ".After() cannot appear after .WillOnce(),"
974 " .WillRepeatedly(), or "
975 ".RetiresOnSaturation().");
976 last_clause_ = kAfter;
979 immediate_prerequisites_ += *it;
984 return After(s1).
After(s2);
988 return After(s1, s2).
After(s3);
992 return After(s1, s2, s3).
After(s4);
997 return After(s1, s2, s3, s4).
After(s5);
1002 ExpectSpecProperty(last_clause_ <= kWillOnce,
1003 ".WillOnce() cannot appear after "
1004 ".WillRepeatedly() or .RetiresOnSaturation().");
1005 last_clause_ = kWillOnce;
1008 if (!cardinality_specified()) {
1009 set_cardinality(Exactly(
static_cast<int>(untyped_actions_.size())));
1016 if (last_clause_ == kWillRepeatedly) {
1017 ExpectSpecProperty(
false,
1018 ".WillRepeatedly() cannot appear "
1019 "more than once in an EXPECT_CALL().");
1021 ExpectSpecProperty(last_clause_ < kWillRepeatedly,
1022 ".WillRepeatedly() cannot appear "
1023 "after .RetiresOnSaturation().");
1025 last_clause_ = kWillRepeatedly;
1026 repeated_action_specified_ =
true;
1028 repeated_action_ =
action;
1029 if (!cardinality_specified()) {
1030 set_cardinality(AtLeast(
static_cast<int>(untyped_actions_.size())));
1035 CheckActionCountIfNotDone();
1041 ExpectSpecProperty(last_clause_ < kRetiresOnSaturation,
1042 ".RetiresOnSaturation() cannot appear "
1044 last_clause_ = kRetiresOnSaturation;
1045 retires_on_saturation_ =
true;
1049 CheckActionCountIfNotDone();
1061 return extra_matcher_;
1070 if (extra_matcher_specified_) {
1071 *
os <<
" Expected args: ";
1072 extra_matcher_.DescribeTo(
os);
1078 template <
typename Function>
1084 return owner_->GetHandleOf(
this);
1092 bool Matches(
const ArgumentTuple& args)
const
1094 g_gmock_mutex.AssertHeld();
1095 return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
1099 bool ShouldHandleArguments(
const ArgumentTuple& args)
const
1101 g_gmock_mutex.AssertHeld();
1107 CheckActionCountIfNotDone();
1108 return !is_retired() && AllPrerequisitesAreSatisfied() && Matches(args);
1113 void ExplainMatchResultTo(
1114 const ArgumentTuple& args,
1115 ::std::ostream*
os)
const
1117 g_gmock_mutex.AssertHeld();
1120 *
os <<
" Expected: the expectation is active\n"
1121 <<
" Actual: it is retired\n";
1122 }
else if (!Matches(args)) {
1124 ExplainMatchFailureTupleTo(matchers_, args,
os);
1126 StringMatchResultListener listener;
1127 if (!extra_matcher_.MatchAndExplain(args, &listener)) {
1128 *
os <<
" Expected args: ";
1129 extra_matcher_.DescribeTo(
os);
1130 *
os <<
"\n Actual: don't match";
1132 internal::PrintIfNotEmpty(listener.str(),
os);
1135 }
else if (!AllPrerequisitesAreSatisfied()) {
1136 *
os <<
" Expected: all pre-requisites are satisfied\n"
1137 <<
" Actual: the following immediate pre-requisites "
1138 <<
"are not satisfied:\n";
1139 ExpectationSet unsatisfied_prereqs;
1140 FindUnsatisfiedPrerequisites(&unsatisfied_prereqs);
1142 for (ExpectationSet::const_iterator it = unsatisfied_prereqs.begin();
1143 it != unsatisfied_prereqs.end(); ++it) {
1144 it->expectation_base()->DescribeLocationTo(
os);
1145 *
os <<
"pre-requisite #" << i++ <<
"\n";
1147 *
os <<
" (end of pre-requisites)\n";
1153 *
os <<
"The call matches the expectation.\n";
1158 const Action<F>& GetCurrentAction(
1159 const FunctionMockerBase<F>* mocker,
1160 const ArgumentTuple& args)
const
1162 g_gmock_mutex.AssertHeld();
1163 const int count = call_count();
1165 "call_count() is <= 0 when GetCurrentAction() is "
1166 "called - this should never happen.");
1168 const int action_count =
static_cast<int>(untyped_actions_.size());
1169 if (action_count > 0 && !repeated_action_specified_ &&
1170 count > action_count) {
1173 ::std::stringstream
ss;
1174 DescribeLocationTo(&ss);
1175 ss <<
"Actions ran out in " << source_text() <<
"...\n"
1176 <<
"Called " <<
count <<
" times, but only "
1177 << action_count <<
" WillOnce()"
1178 << (action_count == 1 ?
" is" :
"s are") <<
" specified - ";
1179 mocker->DescribeDefaultActionTo(args, &ss);
1180 Log(kWarning,
ss.str(), 1);
1183 return count <= action_count ?
1184 *
static_cast<const Action<F>*
>(untyped_actions_[
count - 1]) :
1195 const Action<F>* GetActionForArguments(
1196 const FunctionMockerBase<F>* mocker,
1197 const ArgumentTuple& args,
1198 ::std::ostream* what,
1199 ::std::ostream* why)
1201 g_gmock_mutex.AssertHeld();
1202 if (IsSaturated()) {
1204 IncrementCallCount();
1205 *what <<
"Mock function called more times than expected - ";
1206 mocker->DescribeDefaultActionTo(args, what);
1207 DescribeCallCountTo(why);
1215 IncrementCallCount();
1216 RetireAllPreRequisites();
1218 if (retires_on_saturation_ && IsSaturated()) {
1223 *what <<
"Mock function call matches " << source_text() <<
"...\n";
1224 return &(GetCurrentAction(mocker, args));
1229 FunctionMockerBase<F>*
const owner_;
1230 ArgumentMatcherTuple matchers_;
1231 Matcher<const ArgumentTuple&> extra_matcher_;
1232 Action<F> repeated_action_;
1249 const char* file,
int line,
1250 const std::string& message);
1252template <
typename F>
1263 : function_mocker_(function_mocker), matchers_(matchers) {}
1268 const char* file,
int line,
const char* obj,
const char*
call) {
1270 std::string(
"ON_CALL(") + obj +
", " +
call +
") invoked");
1271 return function_mocker_->AddNewOnCallSpec(file, line, matchers_);
1277 const char* file,
int line,
const char* obj,
const char*
call) {
1278 const std::string source_text(std::string(
"EXPECT_CALL(") + obj +
", " +
1280 LogWithLocation(internal::kInfo, file, line, source_text +
" invoked");
1281 return function_mocker_->AddNewExpectation(
1282 file, line, source_text, matchers_);
1293 template <
typename Function>
1313template <
typename T>
1324 T Unwrap() { return ::testing::internal::move(value_); }
1340template <
typename T>
1347 : value_ptr_(&ref) {}
1349 const T&
Peek()
const {
return *value_ptr_; }
1361# pragma warning(push)
1362# pragma warning(disable:4355)
1383template <
typename T>
1388 return result_.Unwrap();
1393 *
os <<
"\n Returns: ";
1400 template <
typename F>
1404 const std::string& call_description) {
1406 internal::move(args), call_description)));
1411 template <
typename F>
1441 template <
typename F>
1445 const std::string& call_description) {
1452 template <
typename F>
1456 action.Perform(internal::move(args));
1468template <
typename F>
1483 VerifyAndClearExpectationsLocked();
1484 Mock::UnregisterLocked(
this);
1485 ClearDefaultActionsLocked();
1493 for (UntypedOnCallSpecs::const_reverse_iterator it
1494 = untyped_on_call_specs_.rbegin();
1495 it != untyped_on_call_specs_.rend(); ++it) {
1513 const std::string& call_description)
const {
1515 this->FindOnCallSpec(args);
1517 return spec->
GetAction().Perform(internal::move(args));
1519 const std::string message =
1521 "\n The mock function has no default action "
1522 "set, and its return type has no default value set.";
1523#if GTEST_HAS_EXCEPTIONS
1525 throw std::runtime_error(message);
1540 const std::string& call_description)
const {
1542 return ResultHolder::PerformDefaultAction(
this, internal::move(*args),
1551 const void* untyped_action,
void* untyped_args)
const {
1556 return ResultHolder::PerformAction(
action, internal::move(*args));
1563 g_gmock_mutex.AssertHeld();
1573 untyped_on_call_specs_.swap(specs_to_delete);
1575 g_gmock_mutex.Unlock();
1576 for (UntypedOnCallSpecs::const_iterator it =
1577 specs_to_delete.begin();
1578 it != specs_to_delete.end(); ++it) {
1579 delete static_cast<const OnCallSpec<F>*>(*it);
1584 g_gmock_mutex.Lock();
1588 template <
typename Function>
1601 void* untyped_args =
const_cast<void*
>(
static_cast<const void*
>(&args));
1603 DownCast_<ResultHolder*>(this->UntypedInvokeWith(untyped_args)));
1604 return holder->Unwrap();
1609 const char* file,
int line,
1612 Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);
1614 untyped_on_call_specs_.push_back(on_call_spec);
1615 return *on_call_spec;
1620 const std::string& source_text,
1623 Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);
1629 untyped_expectations_.push_back(untyped_expectation);
1633 if (implicit_sequence != NULL) {
1637 return *expectation;
1649 ::std::ostream*
os)
const {
1654 "returning directly.\n" :
1655 "returning default value.\n");
1657 *
os <<
"taking default action specified at:\n"
1658 << FormatFileLocation(spec->
file(), spec->
line()) <<
"\n";
1665 virtual void UntypedDescribeUninterestingCall(
1666 const void* untyped_args,
1667 ::std::ostream*
os)
const
1669 const ArgumentTuple& args =
1670 *
static_cast<const ArgumentTuple*
>(untyped_args);
1671 *
os <<
"Uninteresting mock function call - ";
1672 DescribeDefaultActionTo(args,
os);
1673 *
os <<
" Function call: " << Name();
1674 UniversalPrint(args,
os);
1693 virtual const ExpectationBase* UntypedFindMatchingExpectation(
1694 const void* untyped_args,
1695 const void** untyped_action,
bool* is_excessive,
1696 ::std::ostream* what, ::std::ostream* why)
1698 const ArgumentTuple& args =
1699 *
static_cast<const ArgumentTuple*
>(untyped_args);
1701 TypedExpectation<F>* exp = this->FindMatchingExpectationLocked(args);
1703 this->FormatUnexpectedCallMessageLocked(args, what, why);
1710 *is_excessive = exp->IsSaturated();
1711 const Action<F>*
action = exp->GetActionForArguments(
this, args, what, why);
1714 *untyped_action =
action;
1719 virtual void UntypedPrintArgs(
const void* untyped_args,
1720 ::std::ostream*
os)
const {
1721 const ArgumentTuple& args =
1722 *
static_cast<const ArgumentTuple*
>(untyped_args);
1728 TypedExpectation<F>* FindMatchingExpectationLocked(
1729 const ArgumentTuple& args)
const
1731 g_gmock_mutex.AssertHeld();
1734 for (
typename UntypedExpectations::const_reverse_iterator it =
1735 untyped_expectations_.rbegin();
1736 it != untyped_expectations_.rend(); ++it) {
1737 TypedExpectation<F>*
const exp =
1738 static_cast<TypedExpectation<F>*
>(it->get());
1739 if (exp->ShouldHandleArguments(args)) {
1747 void FormatUnexpectedCallMessageLocked(
1748 const ArgumentTuple& args,
1750 ::std::ostream* why)
const
1752 g_gmock_mutex.AssertHeld();
1753 *
os <<
"\nUnexpected mock function call - ";
1754 DescribeDefaultActionTo(args,
os);
1755 PrintTriedExpectationsLocked(args, why);
1760 void PrintTriedExpectationsLocked(
1761 const ArgumentTuple& args,
1762 ::std::ostream* why)
const
1764 g_gmock_mutex.AssertHeld();
1765 const int count =
static_cast<int>(untyped_expectations_.size());
1766 *why <<
"Google Mock tried the following " <<
count <<
" "
1767 << (
count == 1 ?
"expectation, but it didn't match" :
1768 "expectations, but none matched")
1770 for (
int i = 0; i <
count; i++) {
1771 TypedExpectation<F>*
const expectation =
1772 static_cast<TypedExpectation<F>*
>(untyped_expectations_[i].get());
1774 expectation->DescribeLocationTo(why);
1776 *why <<
"tried expectation #" << i <<
": ";
1778 *why << expectation->source_text() <<
"...\n";
1779 expectation->ExplainMatchResultTo(args, why);
1780 expectation->DescribeCallCountTo(why);
1800# pragma warning(pop)
1820using internal::MockSpec;
1837template <
typename T>
1838inline const T& Const(
const T& x) {
return x; }
1842 : expectation_base_(exp.GetHandle().expectation_base()) {}
1908#define GMOCK_ON_CALL_IMPL_(mock_expr, Setter, call) \
1909 ((mock_expr).gmock_##call)(::testing::internal::GetWithoutMatchers(), NULL) \
1910 .Setter(__FILE__, __LINE__, #mock_expr, #call)
1912#define ON_CALL(obj, call) \
1913 GMOCK_ON_CALL_IMPL_(obj, InternalDefaultActionSetAt, call)
1915#define EXPECT_CALL(obj, call) \
1916 GMOCK_ON_CALL_IMPL_(obj, InternalExpectedAt, call)
bool operator==(const Expectation &rhs) const
bool operator!=(const Expectation &rhs) const
bool operator==(const ExpectationSet &rhs) const
Expectation::Set::const_iterator const_iterator
ExpectationSet(internal::ExpectationBase &exp)
ExpectationSet(const Expectation &e)
ExpectationSet & operator+=(const Expectation &e)
Expectation::Set::value_type value_type
const_iterator end() const
const_iterator begin() const
bool operator!=(const ExpectationSet &rhs) const
void AddExpectation(const Expectation &expectation) const
static ActionResultHolder * PerformAction(const Action< F > &action, typename RvalueRef< typename Function< F >::ArgumentTuple >::type args)
static ActionResultHolder * PerformDefaultAction(const FunctionMockerBase< F > *func_mocker, typename RvalueRef< typename Function< F >::ArgumentTuple >::type args, const std::string &call_description)
virtual void PrintAsActionResult(::std::ostream *) const
virtual void PrintAsActionResult(::std::ostream *os) const
static ActionResultHolder * PerformAction(const Action< F > &action, typename RvalueRef< typename Function< F >::ArgumentTuple >::type args)
static ActionResultHolder * PerformDefaultAction(const FunctionMockerBase< F > *func_mocker, typename RvalueRef< typename Function< F >::ArgumentTuple >::type args, const std::string &call_description)
bool IsOverSaturated() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void Retire() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
const char * source_text() const
const char * file() const
virtual void MaybeDescribeExtraMatcherTo(::std::ostream *os)=0
void DescribeLocationTo(::std::ostream *os) const
virtual Expectation GetHandle()=0
void set_cardinality(const Cardinality &a_cardinality)
bool cardinality_specified() const
std::vector< const void * > UntypedActions
void AssertSpecProperty(bool property, const std::string &failure_message) const
bool IsSaturated() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
const Cardinality & cardinality() const
bool IsSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void IncrementCallCount() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void ExpectSpecProperty(bool property, const std::string &failure_message) const
virtual UntypedActionResultHolderBase * UntypedPerformAction(const void *untyped_action, void *untyped_args) const
OnCallSpec< F > & AddNewOnCallSpec(const char *file, int line, const ArgumentMatcherTuple &m) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Function< F >::ArgumentTuple ArgumentTuple
Result PerformDefaultAction(typename RvalueRef< typename Function< F >::ArgumentTuple >::type args, const std::string &call_description) const
virtual ~FunctionMockerBase() GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
virtual UntypedActionResultHolderBase * UntypedPerformDefaultAction(void *untyped_args, const std::string &call_description) const
ActionResultHolder< Result > ResultHolder
Function< F >::Result Result
Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
TypedExpectation< F > & AddNewExpectation(const char *file, int line, const std::string &source_text, const ArgumentMatcherTuple &m) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Result InvokeWith(typename RvalueRef< typename Function< F >::ArgumentTuple >::type args) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
virtual void ClearDefaultActionsLocked() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
const OnCallSpec< F > * FindOnCallSpec(const ArgumentTuple &args) const
MockSpec< F > & operator()(const internal::WithoutMatchers &, void *const)
internal::OnCallSpec< F > & InternalDefaultActionSetAt(const char *file, int line, const char *obj, const char *call)
MockSpec(internal::FunctionMockerBase< F > *function_mocker, const ArgumentMatcherTuple &matchers)
internal::Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
internal::TypedExpectation< F > & InternalExpectedAt(const char *file, int line, const char *obj, const char *call)
internal::Function< F >::ArgumentTuple ArgumentTuple
OnCallSpec & With(const Matcher< const ArgumentTuple & > &m)
bool Matches(const ArgumentTuple &args) const
OnCallSpec & WillByDefault(const Action< F > &action)
const Action< F > & GetAction() const
Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
OnCallSpec(const char *a_file, int a_line, const ArgumentMatcherTuple &matchers)
Function< F >::ArgumentTuple ArgumentTuple
ReferenceOrValueWrapper(reference ref)
ReferenceOrValueWrapper(T value)
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4)
Function< F >::Result Result
TypedExpectation & After(const ExpectationSet &s)
TypedExpectation & InSequence(const Sequence &s)
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4)
const ArgumentMatcherTuple & matchers() const
Function< F >::ArgumentTuple ArgumentTuple
TypedExpectation & WillRepeatedly(const Action< F > &action)
TypedExpectation(FunctionMockerBase< F > *owner, const char *a_file, int a_line, const std::string &a_source_text, const ArgumentMatcherTuple &m)
TypedExpectation & WillOnce(const Action< F > &action)
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3)
TypedExpectation & With(const Matcher< const ArgumentTuple & > &m)
virtual ~TypedExpectation()
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2, const Sequence &s3)
Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
TypedExpectation & RetiresOnSaturation()
const Action< F > & repeated_action() const
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4, const Sequence &s5)
TypedExpectation & Times(const Cardinality &a_cardinality)
virtual void MaybeDescribeExtraMatcherTo(::std::ostream *os)
TypedExpectation & Times(int n)
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2)
const Matcher< const ArgumentTuple & > & extra_matcher() const
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4, const ExpectationSet &s5)
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2)
virtual ~UntypedActionResultHolderBase()
virtual void PrintAsActionResult(::std::ostream *os) const =0
std::vector< const void * > UntypedOnCallSpecs
virtual void ClearDefaultActionsLocked() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)=0
std::vector< internal::linked_ptr< ExpectationBase > > UntypedExpectations
void ExpectSpecProperty(bool property, const std::string &failure_message) const
void AssertSpecProperty(bool property, const std::string &failure_message) const
const char * file() const
UntypedOnCallSpecBase(const char *a_file, int a_line)
#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
#define GTEST_LOCK_EXCLUDED_(locks)
#define GTEST_DISALLOW_ASSIGN_(type)
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
#define GTEST_DECLARE_STATIC_MUTEX_(mutex)
static const Segment ss(Segment::ss)
GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity, const char *file, int line, const std::string &message)
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
void UniversalPrint(const T &value, ::std::ostream *os)
class testing::internal::GTestFlagSaver GTEST_ATTRIBUTE_UNUSED_
void Assert(bool condition, const char *file, int line)
void Expect(bool condition, const char *file, int line, const std::string &msg)
void ReportUninterestingCall(CallReaction reaction, const std::string &msg)
GTEST_API_ ThreadLocal< Sequence * > g_gmock_implicit_sequence
#define T(meth, val, expected)
fc::variant call(const std::string &url, const std::string &path, const T &v)
yubihsm_pkcs11_object_template template