60 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_ 61 #define GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_ 69 #if GTEST_HAS_EXCEPTIONS 78 #include "gtest/gtest.h" 93 template <
typename F>
class FunctionMocker;
96 class ExpectationBase;
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)
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;
535 typedef ::std::set<Expectation, Less>
Set;
543 return expectation_base_;
626 void AddExpectation(
const Expectation& expectation)
const;
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()
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 817 g_gmock_mutex.AssertHeld();
824 g_gmock_mutex.AssertHeld();
832 void CheckActionCountIfNotDone()
const 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;
943 s.AddExpectation(GetHandle());
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;
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);
1087 g_gmock_mutex.AssertHeld();
1094 g_gmock_mutex.AssertHeld();
1100 CheckActionCountIfNotDone();
1101 return !is_retired() && AllPrerequisitesAreSatisfied() &&
Matches(
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";
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";
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";
1155 g_gmock_mutex.AssertHeld();
1156 const int count = call_count();
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 ?
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));
1242 const char* file,
int line,
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;
1301 template <
typename T>
1328 template <
typename T>
1335 : value_ptr_(&ref) {}
1337 const T&
Peek()
const {
return *value_ptr_; }
1349 # pragma warning(push) // Saves the current warning state. 1350 # pragma warning(disable:4355) // Temporarily disables warning 4355. 1367 virtual void PrintAsActionResult(::std::ostream* os)
const = 0;
1371 template <
typename T>
1381 *os <<
"\n Returns: ";
1388 template <
typename F>
1392 const string& call_description) {
1399 template <
typename F>
1428 template <
typename F>
1432 const string& call_description) {
1439 template <
typename F>
1455 template <
typename F>
1456 class FunctionMockerBase :
public UntypedFunctionMockerBase {
1470 VerifyAndClearExpectationsLocked();
1471 Mock::UnregisterLocked(
this);
1472 ClearDefaultActionsLocked();
1480 for (UntypedOnCallSpecs::const_reverse_iterator it
1481 = untyped_on_call_specs_.rbegin();
1482 it != untyped_on_call_specs_.rend(); ++it) {
1499 const string& call_description)
const {
1501 this->FindOnCallSpec(
args);
1505 const string message = call_description +
1506 "\n The mock function has no default action " 1507 "set, and its return type has no default value set.";
1508 #if GTEST_HAS_EXCEPTIONS 1510 throw std::runtime_error(
message);
1524 const void* untyped_args,
1525 const string& call_description)
const {
1528 return ResultHolder::PerformDefaultAction(
this,
args, call_description);
1536 const void* untyped_action,
const void* untyped_args)
const {
1542 return ResultHolder::PerformAction(
action,
args);
1549 g_gmock_mutex.AssertHeld();
1559 untyped_on_call_specs_.swap(specs_to_delete);
1561 g_gmock_mutex.Unlock();
1562 for (UntypedOnCallSpecs::const_iterator it =
1563 specs_to_delete.begin();
1564 it != specs_to_delete.end(); ++it) {
1570 g_gmock_mutex.Lock();
1574 template <
typename Function>
1585 DownCast_<ResultHolder*>(this->UntypedInvokeWith(&
args)));
1586 return holder->Unwrap();
1591 const char* file,
int line,
1594 Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file,
line);
1596 untyped_on_call_specs_.push_back(on_call_spec);
1597 return *on_call_spec;
1604 const string& source_text,
1607 Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file,
line);
1611 untyped_expectations_.push_back(untyped_expectation);
1615 if (implicit_sequence != NULL) {
1619 return *expectation;
1635 ::std::ostream* os)
const {
1640 "returning directly.\n" :
1641 "returning default value.\n");
1643 *os <<
"taking default action specified at:\n" 1652 const void* untyped_args,
1653 ::std::ostream* os)
const 1657 *os <<
"Uninteresting mock function call - ";
1658 DescribeDefaultActionTo(
args, os);
1659 *os <<
" Function call: " << Name();
1680 const void* untyped_args,
1681 const void** untyped_action,
bool* is_excessive,
1682 ::std::ostream* what, ::std::ostream* why)
1689 this->FormatUnexpectedCallMessageLocked(
args, what, why);
1700 *untyped_action =
action;
1706 ::std::ostream* os)
const {
1717 g_gmock_mutex.AssertHeld();
1718 for (
typename UntypedExpectations::const_reverse_iterator it =
1719 untyped_expectations_.rbegin();
1720 it != untyped_expectations_.rend(); ++it) {
1734 ::std::ostream* why)
const 1736 g_gmock_mutex.AssertHeld();
1737 *os <<
"\nUnexpected mock function call - ";
1738 DescribeDefaultActionTo(
args, os);
1739 PrintTriedExpectationsLocked(
args, why);
1746 ::std::ostream* why)
const 1748 g_gmock_mutex.AssertHeld();
1749 const int count =
static_cast<int>(untyped_expectations_.size());
1750 *why <<
"Google Mock tried the following " <<
count <<
" " 1751 << (
count == 1 ?
"expectation, but it didn't match" :
1752 "expectations, but none matched")
1760 *why <<
"tried expectation #" <<
i <<
": ";
1788 # pragma warning(pop) // Restores the warning state. 1825 template <
typename T>
1830 : expectation_base_(exp.GetHandle().expectation_base()) {}
1838 #define GMOCK_ON_CALL_IMPL_(obj, call) \ 1839 ((obj).gmock_##call).InternalDefaultActionSetAt(__FILE__, __LINE__, \ 1841 #define ON_CALL(obj, call) GMOCK_ON_CALL_IMPL_(obj, call) 1843 #define GMOCK_EXPECT_CALL_IMPL_(obj, call) \ 1844 ((obj).gmock_##call).InternalExpectedAt(__FILE__, __LINE__, #obj, #call) 1845 #define EXPECT_CALL(obj, call) GMOCK_EXPECT_CALL_IMPL_(obj, call) 1847 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_ virtual ~TypedExpectation()
Definition: gmock-spec-builders.h:896
ArgumentMatcherTuple matchers_
Definition: gmock-spec-builders.h:355
Definition: gmock-generated-nice-strict.h:80
Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
Definition: gmock-spec-builders.h:880
GTEST_API_ ThreadLocal< Sequence * > g_gmock_implicit_sequence
Definition: gmock-spec-builders.cc:243
int size() const
Definition: gmock-spec-builders.h:606
bool Matches(const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1085
const uint32_t T[512]
Definition: groestl_tables.h:36
OnCallSpec(const char *a_file, int a_line, const ArgumentMatcherTuple &matchers)
Definition: gmock-spec-builders.h:292
virtual ~UntypedActionResultHolderBase()
Definition: gmock-spec-builders.h:1364
T * value_ptr_
Definition: gmock-spec-builders.h:1340
Definition: gmock-actions.h:53
virtual ~FunctionMockerBase() GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1467
Definition: gmock-spec-builders.h:364
ExpectationSet(const Expectation &e)
Definition: gmock-spec-builders.h:584
Definition: gmock-spec-builders.h:660
TypedExpectation & Times(int n)
Definition: gmock-spec-builders.h:931
GTEST_API_ Cardinality AtLeast(int n)
Definition: gmock-cardinalities.cc:140
bool operator==(const ExpectationSet &rhs) const
Definition: gmock-spec-builders.h:593
int * count
Definition: gmock_stress_test.cc:176
TypedExpectation(FunctionMockerBase< F > *owner, const char *a_file, int a_line, const string &a_source_text, const ArgumentMatcherTuple &m)
Definition: gmock-spec-builders.h:883
bool operator==(const Expectation &rhs) const
Definition: gmock-spec-builders.h:509
int i
Definition: pymoduletest.py:23
const char * file() const
Definition: gmock-spec-builders.h:252
Definition: gmock-spec-builders.h:730
int line() const
Definition: gmock-spec-builders.h:253
T Unwrap()
Definition: gmock-spec-builders.h:1375
Definition: gmock-spec-builders.h:362
Definition: upnpdescgen.h:28
ExpectationSet(internal::ExpectationBase &exp)
Definition: gmock-spec-builders.h:577
virtual UntypedActionResultHolderBase * UntypedPerformAction(const void *untyped_action, const void *untyped_args) const
Definition: gmock-spec-builders.h:1535
TypedExpectation & WillOnce(const Action< F > &action)
Definition: gmock-spec-builders.h:994
#define F(w, k)
Definition: sha512-blocks.c:61
int line_
Definition: gmock-spec-builders.h:276
const char * file() const
Definition: gmock-spec-builders.h:698
static ActionResultHolder * PerformAction(const Action< F > &action, const typename Function< F >::ArgumentTuple &args)
Definition: gmock-spec-builders.h:1401
const Action< F > & GetAction() const
Definition: gmock-spec-builders.h:334
Definition: gmock-spec-builders.h:1372
static void Print(const T &value, ::std::ostream *os)
Definition: gtest-printers.h:698
void DescribeLocationTo(::std::ostream *os) const
Definition: gmock-spec-builders.h:705
bool IsSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:786
Definition: gmock-spec-builders.h:726
bool ShouldHandleArguments(const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1092
std::vector< internal::linked_ptr< ExpectationBase > > UntypedExpectations
Definition: gmock-spec-builders.h:222
const T & Peek() const
Definition: gmock-spec-builders.h:1318
virtual void UntypedDescribeUninterestingCall(const void *untyped_args, ::std::ostream *os) const GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1651
Definition: gmock-spec-builders.h:1246
GTEST_API_ ::std::string FormatFileLocation(const char *file, int line)
Definition: gtest-port.cc:880
TypedExpectation< F > * FindMatchingExpectationLocked(const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1714
UntypedExpectations untyped_expectations_
Definition: gmock-spec-builders.h:241
MockSpec(internal::FunctionMockerBase< F > *function_mocker)
Definition: gmock-spec-builders.h:1254
bool sequence_created_
Definition: gmock-spec-builders.h:665
Definition: gmock-spec-builders.h:363
handler_function * call
Definition: daemon_handler.cpp:56
TypedExpectation & Times(const Cardinality &a_cardinality)
Definition: gmock-spec-builders.h:925
virtual void PrintAsActionResult(::std::ostream *os) const
Definition: gmock-spec-builders.h:1380
TypedExpectation< F > & AddNewExpectation(const char *file, int line, const string &source_text, const ArgumentMatcherTuple &m) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1601
Result PerformDefaultAction(const ArgumentTuple &args, const string &call_description) const
Definition: gmock-spec-builders.h:1498
virtual UntypedActionResultHolderBase * UntypedPerformDefaultAction(const void *untyped_args, const string &call_description) const
Definition: gmock-spec-builders.h:1523
internal::OnCallSpec< F > & InternalDefaultActionSetAt(const char *file, int line, const char *obj, const char *call)
Definition: gmock-spec-builders.h:1259
T & Unwrap()
Definition: gmock-spec-builders.h:1336
const char * source_text() const
Definition: gmock-spec-builders.h:700
int line() const
Definition: gmock-spec-builders.h:699
Definition: gmock-spec-builders.h:260
static ActionResultHolder * PerformDefaultAction(const FunctionMockerBase< F > *func_mocker, const typename Function< F >::ArgumentTuple &args, const string &call_description)
Definition: gmock-spec-builders.h:1429
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4)
Definition: gmock-spec-builders.h:953
const char * s
Definition: minissdp.c:596
GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_gmock_mutex)
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2)
Definition: gmock-spec-builders.h:976
Wrapper result_
Definition: gmock-spec-builders.h:1413
T value_
Definition: gmock-spec-builders.h:1323
bool Matches(const ArgumentTuple &args) const
Definition: gmock-spec-builders.h:329
void ExpectSpecProperty(bool property, const string &failure_message) const
Definition: gmock-spec-builders.h:271
const ArgumentMatcherTuple & matchers() const
Definition: gmock-spec-builders.h:1048
Function< F >::ArgumentTuple ArgumentTuple
Definition: gmock-spec-builders.h:1459
void IncrementCallCount() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:822
const_iterator begin() const
Definition: gmock-spec-builders.h:608
tools::wallet2::message_signature_result_t result
Definition: signature.cpp:62
Definition: gmock-spec-builders.h:261
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Definition: gmock-matchers.h:796
void UntypedTimes(const Cardinality &a_cardinality)
Definition: gmock-spec-builders.cc:225
void FormatUnexpectedCallMessageLocked(const ArgumentTuple &args, ::std::ostream *os, ::std::ostream *why) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1731
static ActionResultHolder * PerformAction(const Action< F > &action, const typename Function< F >::ArgumentTuple &args)
Definition: gmock-spec-builders.h:1440
args
Definition: build_protob.py:10
void AssertSpecProperty(bool property, const string &failure_message) const
Definition: gmock-spec-builders.h:741
Action< F > action_
Definition: gmock-spec-builders.h:357
Definition: gmock-spec-builders.h:724
Result InvokeWith(const ArgumentTuple &args) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1582
const char * file_
Definition: gmock-spec-builders.h:275
Function< F >::ArgumentTuple ArgumentTuple
Definition: gmock-spec-builders.h:287
virtual const ExpectationBase * UntypedFindMatchingExpectation(const void *untyped_args, const void **untyped_action, bool *is_excessive, ::std::ostream *what, ::std::ostream *why) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1679
ActionResultHolder()
Definition: gmock-spec-builders.h:1448
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4, const ExpectationSet &s5)
Definition: gmock-spec-builders.h:987
void ExplainMatchResultTo(const ArgumentTuple &args, ::std::ostream *os) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1106
const T & Const(const T &x)
Definition: gmock-spec-builders.h:1826
const Cardinality & cardinality() const
Definition: gmock-spec-builders.h:702
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4)
Definition: gmock-spec-builders.h:983
virtual Expectation GetHandle()
Definition: gmock-spec-builders.h:1076
Definition: gmock-matchers.h:319
internal::linked_ptr< Expectation > last_expectation_
Definition: gmock-spec-builders.h:633
const T & Peek() const
Definition: gmock-spec-builders.h:1337
Definition: gmock-spec-builders.h:365
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2)
Definition: gmock-spec-builders.h:946
Definition: gmock-spec-builders.h:728
Expectation::Set::const_iterator const_iterator
Definition: gmock-spec-builders.h:566
OnCallSpec< F > & AddNewOnCallSpec(const char *file, int line, const ArgumentMatcherTuple &m) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1590
T & reference
Definition: gmock-spec-builders.h:1333
e
Definition: pymoduletest.py:79
OnCallSpec & With(const Matcher< const ArgumentTuple &> &m)
Definition: gmock-spec-builders.h:304
TypedExpectation & RetiresOnSaturation()
Definition: gmock-spec-builders.h:1033
void ReportUninterestingCall(CallReaction reaction, const string &msg)
Definition: gmock-spec-builders.cc:247
boost::promise< boost::asio::ip::tcp::socket > result_
Definition: net_helper.cpp:11
Definition: gmock-spec-builders.h:528
Definition: gmock-spec-builders.h:690
Clause last_clause_
Definition: gmock-spec-builders.h:280
Definition: gmock-actions.h:200
Clause
Definition: gmock-spec-builders.h:257
virtual void UntypedPrintArgs(const void *untyped_args, ::std::ostream *os) const
Definition: gmock-spec-builders.h:1705
Definition: gmock-actions.h:355
MockSpec< F > current_spec_
Definition: gmock-spec-builders.h:1770
internal::TypedExpectation< F > & InternalExpectedAt(const char *file, int line, const char *obj, const char *call)
Definition: gmock-spec-builders.h:1268
Expectation::Set::value_type value_type
Definition: gmock-spec-builders.h:569
UntypedOnCallSpecs untyped_on_call_specs_
Definition: gmock-spec-builders.h:238
Definition: gmock-spec-builders.h:729
internal::Function< F >::ArgumentTuple ArgumentTuple
Definition: gmock-spec-builders.h:1248
TypedExpectation & With(const Matcher< const ArgumentTuple &> &m)
Definition: gmock-spec-builders.h:907
TypedExpectation & InSequence(const Sequence &s)
Definition: gmock-spec-builders.h:936
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
Definition: gtest-port.h:874
void Expect(bool condition, const char *file, int line, const string &msg)
Definition: gmock-internal-utils.h:294
Definition: gmock-internal-utils.h:308
Definition: gtest-linked_ptr.h:146
Definition: gmock-generated-function-mockers.h:54
#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
Definition: gtest-port.h:2533
FunctionMockerBase< F > *const owner_
Definition: gmock-spec-builders.h:1222
bool operator()(const Expectation &lhs, const Expectation &rhs) const
Definition: gmock-spec-builders.h:530
#define GTEST_DISALLOW_ASSIGN_(type)
Definition: gtest-port.h:869
ArgumentMatcherTuple matchers_
Definition: gmock-spec-builders.h:1223
const Action< F > * GetActionForArguments(const FunctionMockerBase< F > *mocker, const ArgumentTuple &args, ::std::ostream *what, ::std::ostream *why) GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1188
Action< F > repeated_action_
Definition: gmock-spec-builders.h:1225
Matcher< const ArgumentTuple & > extra_matcher_
Definition: gmock-spec-builders.h:356
internal::MatcherAsPredicate< M > Matches(M matcher)
Definition: gmock-matchers.h:4341
Definition: gtest-port.h:2136
Definition: gtest-port.h:2154
#define GTEST_API_
Definition: gtest-port.h:934
FunctionMockerBase()
Definition: gmock-spec-builders.h:1462
GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity, const char *file, int line, const string &message)
Definition: gmock-spec-builders.cc:59
ActionResultHolder(Wrapper result)
Definition: gmock-spec-builders.h:1409
Function< F >::Result Result
Definition: gmock-spec-builders.h:881
TypedExpectation & WillRepeatedly(const Action< F > &action)
Definition: gmock-spec-builders.h:1008
GTEST_API_ void Log(LogSeverity severity, const string &message, int stack_frames_to_skip)
Definition: gmock-internal-utils.cc:131
UntypedOnCallSpecBase(const char *a_file, int a_line)
Definition: gmock-spec-builders.h:248
Definition: gmock-generated-nice-strict.h:176
ExpectationSet()
Definition: gmock-spec-builders.h:572
Definition: gmock-spec-builders.h:619
const void * mock_obj_
Definition: gmock-spec-builders.h:231
void AddExpectation(const Expectation &expectation) const
Definition: gmock-spec-builders.cc:794
InSequence()
Definition: gmock-spec-builders.cc:805
virtual void PrintAsActionResult(::std::ostream *) const
Definition: gmock-spec-builders.h:1424
Definition: gmock-spec-builders.h:371
Function< F >::ArgumentTuple ArgumentTuple
Definition: gmock-spec-builders.h:879
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3)
Definition: gmock-spec-builders.h:979
internal::Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
Definition: gmock-spec-builders.h:1250
Matcher< const ArgumentTuple & > extra_matcher_
Definition: gmock-spec-builders.h:1224
ReferenceOrValueWrapper< T > Wrapper
Definition: gmock-spec-builders.h:1407
const internal::linked_ptr< internal::ExpectationBase > & expectation_base() const
Definition: gmock-spec-builders.h:542
LogSeverity
Definition: gmock-internal-utils.h:306
internal::FunctionMockerBase< F > *const function_mocker_
Definition: gmock-spec-builders.h:1285
Definition: gmock-spec-builders.h:727
void Retire() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:779
ExpectationSet & operator+=(const Expectation &e)
Definition: gmock-spec-builders.h:601
Definition: gmock-spec-builders.h:262
Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
Definition: gmock-spec-builders.h:1460
virtual void ClearDefaultActionsLocked() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1547
bool IsSaturated() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:793
GTEST_API_ Cardinality Exactly(int n)
Definition: gmock-cardinalities.cc:154
T Unwrap()
Definition: gmock-spec-builders.h:1312
bool cardinality_specified() const
Definition: gmock-spec-builders.h:756
Definition: document.h:406
void set_cardinality(const Cardinality &a_cardinality)
Definition: gmock-spec-builders.h:759
CallReaction
Definition: gmock-spec-builders.h:361
Definition: gmock-spec-builders.h:99
ActionResultHolder< Result > ResultHolder
Definition: gmock-spec-builders.h:1577
const T & move(const T &t)
Definition: gtest-port.h:1317
internal::DoDefaultAction DoDefault()
Definition: gmock-actions.h:1099
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4, const Sequence &s5)
Definition: gmock-spec-builders.h:957
class GTEST_API_ testing::InSequence GTEST_ATTRIBUTE_UNUSED_
MockSpec< F > & current_spec()
Definition: gmock-spec-builders.h:1624
const OnCallSpec< F > * FindOnCallSpec(const ArgumentTuple &args) const
Definition: gmock-spec-builders.h:1478
Definition: gmock-spec-builders_test.cc:52
OnCallSpec & WillByDefault(const Action< F > &action)
Definition: gmock-spec-builders.h:316
void Assert(bool condition, const char *file, int line)
Definition: gmock-internal-utils.h:288
TypedExpectation & After(const ExpectationSet &s)
Definition: gmock-spec-builders.h:964
Definition: gmock-spec-builders.h:563
Definition: gmock-spec-builders.h:245
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
const_iterator end() const
Definition: gmock-spec-builders.h:609
Matcher< T > A()
Definition: gmock-matchers.h:3732
void SetMatchers(const ArgumentMatcherTuple &matchers)
Definition: gmock-spec-builders.h:1280
Expectation()
Definition: gmock-spec-builders.cc:785
void PrintIfNotEmpty(const internal::string &explanation, ::std::ostream *os)
Definition: gmock-matchers.h:678
std::vector< const void * > UntypedActions
Definition: gmock-spec-builders.h:734
internal::string str() const
Definition: gmock-matchers.h:189
Definition: 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: gmock-spec-builders.h:1389
const Action< F > & repeated_action() const
Definition: gmock-spec-builders.h:1058
Definition: gmock-internal-utils.h:307
void AssertSpecProperty(bool property, const string &failure_message) const
Definition: gmock-spec-builders.h:266
Definition: gmock-spec-builders.h:285
bool Matches(T x) const
Definition: gmock-matchers.h:261
Definition: gmock-spec-builders.h:1302
Definition: gmock-spec-builders.h:126
Definition: gmock-generated-function-mockers.h:62
void DescribeDefaultActionTo(const ArgumentTuple &args, ::std::ostream *os) const
Definition: gmock-spec-builders.h:1634
void Unwrap()
Definition: gmock-spec-builders.h:1422
Definition: gmock-generated-nice-strict.h:272
Definition: gmock-spec-builders.h:1362
ReferenceOrValueWrapper(T value)
Definition: gmock-spec-builders.h:1305
Clause
Definition: gmock-spec-builders.h:722
internal::linked_ptr< internal::ExpectationBase > expectation_base_
Definition: gmock-spec-builders.h:547
Definition: gmock-matchers.h:184
const char * name
Definition: options.c:30
Definition: gtest-port.h:1115
::std::set< Expectation, Less > Set
Definition: gmock-spec-builders.h:535
void ExplainMatchFailureTupleTo(const MatcherTuple &matchers, const ValueTuple &values, ::std::ostream *os)
Definition: gmock-matchers.h:810
Sequence()
Definition: gmock-spec-builders.h:622
ReferenceOrValueWrapper(reference ref)
Definition: gmock-spec-builders.h:1334
const Action< F > & GetCurrentAction(const FunctionMockerBase< F > *mocker, const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1151
void DescribeCallCountTo(::std::ostream *os) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.cc:150
bool IsOverSaturated() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:800
line
Definition: check.py:23
Definition: gmock-cardinalities.h:83
tuple message
Definition: gtest_output_test.py:331
#define const
Definition: ipfrdr.c:80
bool operator!=(const Expectation &rhs) const
Definition: gmock-spec-builders.h:513
Definition: gmock-spec-builders.h:725
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2, const Sequence &s3)
Definition: gmock-spec-builders.h:949
ArgumentMatcherTuple matchers_
Definition: gmock-spec-builders.h:1287
void ExpectSpecProperty(bool property, const string &failure_message) const
Definition: gmock-spec-builders.h:746
const char * name_
Definition: gmock-spec-builders.h:235
#define GTEST_LOCK_EXCLUDED_(locks)
Definition: gtest-port.h:2534
Expectation::Set expectations_
Definition: gmock-spec-builders.h:612
Function< F >::Result Result
Definition: gmock-spec-builders.h:1458
const Matcher< const ArgumentTuple & > & extra_matcher() const
Definition: gmock-spec-builders.h:1053
void PrintTriedExpectationsLocked(const ArgumentTuple &args, ::std::ostream *why) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition: gmock-spec-builders.h:1744
Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
Definition: gmock-spec-builders.h:288
void UniversalPrint(const T &value, ::std::ostream *os)
Definition: gtest-printers.h:852
bool operator!=(const ExpectationSet &rhs) const
Definition: gmock-spec-builders.h:597
std::vector< const void * > UntypedOnCallSpecs
Definition: gmock-spec-builders.h:219
Definition: gmock-spec-builders.h:487
static T Get()
Definition: gmock-actions.h:236
virtual void MaybeDescribeExtraMatcherTo(::std::ostream *os)
Definition: gmock-spec-builders.h:1062
action
Definition: upload.py:393