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"
102class ExpectationTester;
151 const
void* untyped_args,
152 const
string& call_description) const = 0;
158 const
void* untyped_action,
159 const
void* untyped_args) const = 0;
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)
183 ::
std::ostream* os) const = 0;
215 const
void* untyped_args)
285class OnCallSpec :
public UntypedOnCallSpecBase {
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().");
330 return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
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)
393 friend class internal::UntypedFunctionMockerBase;
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;
538 const internal::linked_ptr<internal::ExpectationBase>& expectation_base);
541 const internal::linked_ptr<internal::ExpectationBase>&
542 expectation_base()
const {
543 return expectation_base_;
547 internal::linked_ptr<internal::ExpectationBase> expectation_base_;
563class ExpectationSet {
594 return expectations_ == rhs.expectations_;
602 expectations_.insert(e);
606 int size()
const {
return static_cast<int>(expectations_.size()); }
612 Expectation::Set expectations_;
665 bool sequence_created_;
719 friend class ::testing::Expectation;
774 g_gmock_mutex.AssertHeld();
781 g_gmock_mutex.AssertHeld();
788 g_gmock_mutex.AssertHeld();
795 g_gmock_mutex.AssertHeld();
802 g_gmock_mutex.AssertHeld();
817 g_gmock_mutex.AssertHeld();
824 g_gmock_mutex.AssertHeld();
884 const char* a_file,
int a_line,
const string& a_source_text,
902 delete static_cast<const Action<F>*
>(*it);
910 ".With() cannot appear "
911 "more than once in an EXPECT_CALL().");
914 ".With() must be the first "
915 "clause in an EXPECT_CALL().");
938 ".InSequence() cannot appear after .After(),"
939 " .WillOnce(), .WillRepeatedly(), or "
940 ".RetiresOnSaturation().");
960 return InSequence(s1, s2, s3, s4).InSequence(s5);
966 ".After() cannot appear after .WillOnce(),"
967 " .WillRepeatedly(), or "
968 ".RetiresOnSaturation().");
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);
996 ".WillOnce() cannot appear after "
997 ".WillRepeatedly() or .RetiresOnSaturation().");
1011 ".WillRepeatedly() cannot appear "
1012 "more than once in an EXPECT_CALL().");
1015 ".WillRepeatedly() cannot appear "
1016 "after .RetiresOnSaturation().");
1021 repeated_action_ = action;
1035 ".RetiresOnSaturation() cannot appear "
1054 return extra_matcher_;
1064 *os <<
" Expected args: ";
1065 extra_matcher_.DescribeTo(os);
1071 template <
typename Function>
1077 return owner_->GetHandleOf(
this);
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";
1125 internal::PrintIfNotEmpty(listener.str(), os);
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);
1135 for (ExpectationSet::const_iterator it = unsatisfied_prereqs.begin();
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);
1173 Log(kWarning, ss.str(), 1);
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);
1245template <
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;
1298# pragma warning(push)
1299# pragma warning(disable:4355)
1311class UntypedActionResultHolderBase {
1320template <
typename T>
1337 *os <<
"\n Returns: ";
1344 template <
typename F>
1348 const string& call_description) {
1355 template <
typename F>
1371class ActionResultHolder<void> :
public UntypedActionResultHolderBase {
1378 template <
typename F>
1382 const string& call_description) {
1388 template <
typename F>
1400template <
typename F>
1416 Mock::UnregisterLocked(
this);
1425 for (UntypedOnCallSpecs::const_reverse_iterator it
1429 if (spec->Matches(args))
1444 const string& call_description)
const {
1448 return spec->GetAction().Perform(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 {
1481 const void* untyped_action,
const void* untyped_args)
const {
1494 g_gmock_mutex.AssertHeld();
1506 g_gmock_mutex.Unlock();
1507 for (UntypedOnCallSpecs::const_iterator it =
1508 specs_to_delete.begin();
1509 it != specs_to_delete.end(); ++it) {
1510 delete static_cast<const OnCallSpec<F>*>(*it);
1515 g_gmock_mutex.Lock();
1519 template <
typename Function>
1535 const char* file,
int line,
1538 Mock::RegisterUseByOnCallOrExpectCall(
MockObject(), file, line);
1541 return *on_call_spec;
1548 const string& source_text,
1551 Mock::RegisterUseByOnCallOrExpectCall(
MockObject(), file, line);
1559 if (implicit_sequence != NULL) {
1563 return *expectation;
1579 ::std::ostream* os)
const {
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();
1604 UniversalPrint(args, os);
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)
1752using internal::MockSpec;
1769template <
typename T>
1770inline const T&
Const(
const T& x) {
return x; }
1773inline Expectation::Expectation(internal::ExpectationBase& exp)
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)
Definition dsd/test/gmock/include/gmock/gmock-actions.h:280
bool IsDoDefault() const
Definition dsd/test/gmock/include/gmock/gmock-actions.h:304
Result Perform(const ArgumentTuple &args) const
Definition dsd/test/gmock/include/gmock/gmock-actions.h:312
Definition dsd/test/gmock/include/gmock/gmock-cardinalities.h:83
static T Get()
Definition dsd/test/gmock/include/gmock/gmock-actions.h:188
static bool Exists()
Definition dsd/test/gmock/include/gmock/gmock-actions.h:181
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:563
int size() const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:606
bool operator==(const ExpectationSet &rhs) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:593
ExpectationSet(internal::ExpectationBase &exp)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:577
ExpectationSet(const Expectation &e)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:584
ExpectationSet & operator+=(const Expectation &e)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:601
ExpectationSet()
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:572
Expectation::Set::value_type value_type
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:569
const_iterator end() const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:609
Expectation::Set::const_iterator const_iterator
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:566
const_iterator begin() const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:608
bool operator!=(const ExpectationSet &rhs) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:597
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:487
bool operator==(const Expectation &rhs) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:509
Expectation(internal::ExpectationBase &exp)
bool operator!=(const Expectation &rhs) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:513
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:660
Definition dsd/test/gmock/include/gmock/gmock-matchers.h:294
internal::Function< R() >::ArgumentMatcherTuple ArgumentMatcherTuple
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1250
friend class StrictMock
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:407
friend class NiceMock
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:401
friend class NaggyMock
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:404
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:619
Sequence()
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:622
void AddExpectation(const Expectation &expectation) const
void GetValueAndDelete() const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1373
static ActionResultHolder * PerformAction(const Action< F > &action, const typename Function< F >::ArgumentTuple &args)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1389
virtual void PrintAsActionResult(::std::ostream *) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1375
static ActionResultHolder * PerformDefaultAction(const FunctionMockerBase< F > *func_mocker, const typename Function< F >::ArgumentTuple &args, const string &call_description)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1379
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1321
static ActionResultHolder * PerformAction(const Action< F > &action, const typename Function< F >::ArgumentTuple &args)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1357
virtual void PrintAsActionResult(::std::ostream *os) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1336
T GetValueAndDelete() const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1329
static ActionResultHolder * PerformDefaultAction(const FunctionMockerBase< F > *func_mocker, const typename Function< F >::ArgumentTuple &args, const string &call_description)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1345
ActionResultHolder(T a_value)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1323
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:690
void UntypedTimes(const Cardinality &a_cardinality)
bool IsOverSaturated() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:800
void Retire() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:779
bool retired_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:863
ExpectationSet immediate_prerequisites_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:858
bool action_count_checked_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:869
void AssertSpecProperty(bool property, const string &failure_message) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:741
void DescribeCallCountTo(::std::ostream *os) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
const char * source_text() const
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:700
bool extra_matcher_specified_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:865
Mutex mutex_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:870
void SpecifyCardinality(const Cardinality &cardinality)
Clause
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:722
@ kNone
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:724
@ kRetiresOnSaturation
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:731
@ kWillRepeatedly
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:730
@ kAfter
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:728
@ kWith
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:725
@ kWillOnce
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:729
@ kTimes
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:726
@ kInSequence
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:727
const char * file() const
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:698
friend class TypedExpectation
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:839
virtual ~ExpectationBase()
Clause last_clause_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:868
virtual void MaybeDescribeExtraMatcherTo(::std::ostream *os)=0
void ExpectSpecProperty(bool property, const string &failure_message) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:746
void DescribeLocationTo(::std::ostream *os) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:705
virtual Expectation GetHandle()=0
int line() const
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:699
void set_cardinality(const Cardinality &a_cardinality)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:759
bool retires_on_saturation_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:867
friend class UntypedFunctionMockerBase
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:720
bool AllPrerequisitesAreSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
friend class ::testing::internal::ExpectationTester
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:836
friend class ::testing::Expectation
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:719
const string source_text_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:848
bool cardinality_specified() const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:756
ExpectationBase(const char *file, int line, const string &source_text)
UntypedActions untyped_actions_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:864
GTEST_DISALLOW_ASSIGN_(ExpectationBase)
std::vector< const void * > UntypedActions
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:734
void FindUnsatisfiedPrerequisites(ExpectationSet *result) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
int call_count() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:815
void CheckActionCountIfNotDone() const GTEST_LOCK_EXCLUDED_(mutex_)
int line_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:847
bool repeated_action_specified_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:866
Cardinality cardinality_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:851
bool cardinality_specified_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:850
bool IsSaturated() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:793
const Cardinality & cardinality() const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:702
bool IsSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:786
const char * file_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:846
int call_count_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:862
friend class ::testing::Sequence
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:835
void IncrementCallCount() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:822
void RetireAllPreRequisites() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool is_retired() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:772
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1401
MockSpec< F > & current_spec()
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1568
OnCallSpec< F > & AddNewOnCallSpec(const char *file, int line, const ArgumentMatcherTuple &m) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1534
FunctionMockerBase()
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1407
Function< F >::ArgumentTuple ArgumentTuple
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1404
virtual ~FunctionMockerBase() GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1412
TypedExpectation< F > & AddNewExpectation(const char *file, int line, const string &source_text, const ArgumentMatcherTuple &m) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1545
friend class TypedExpectation
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1571
Result InvokeWith(const ArgumentTuple &args) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1527
friend class TypedExpectation
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1571
ActionResultHolder< Result > ResultHolder
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1522
Function< F >::Result Result
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1403
Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1405
virtual UntypedActionResultHolderBase * UntypedPerformAction(const void *untyped_action, const void *untyped_args) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1480
virtual void ClearDefaultActionsLocked() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1492
Result PerformDefaultAction(const ArgumentTuple &args, const string &call_description) const
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1443
friend class MockSpec
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1520
const OnCallSpec< F > * FindOnCallSpec(const ArgumentTuple &args) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1423
friend class MockSpec
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1520
virtual UntypedActionResultHolderBase * UntypedPerformDefaultAction(const void *untyped_args, const string &call_description) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1468
Definition dsd/test/gmock/include/gmock/gmock-generated-function-mockers.h:58
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1246
MockSpec(internal::FunctionMockerBase< F > *function_mocker)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1254
internal::Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1250
internal::OnCallSpec< F > & InternalDefaultActionSetAt(const char *file, int line, const char *obj, const char *call)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1259
internal::Function< F >::ArgumentTuple ArgumentTuple
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1248
internal::TypedExpectation< F > & InternalExpectedAt(const char *file, int line, const char *obj, const char *call)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1268
Definition dsd/test/gtest/include/gtest/internal/gtest-port.h:1545
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:285
Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:288
Function< F >::ArgumentTuple ArgumentTuple
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:287
OnCallSpec & With(const Matcher< const ArgumentTuple & > &m)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:304
bool Matches(const ArgumentTuple &args) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:329
OnCallSpec & WillByDefault(const Action< F > &action)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:316
const Action< F > & GetAction() const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:334
OnCallSpec(const char *a_file, int a_line, const ArgumentMatcherTuple &matchers)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:292
Definition dsd/test/gtest/include/gtest/internal/gtest-port.h:1566
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:877
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:953
TypedExpectation & After(const ExpectationSet &s)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:964
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
TypedExpectation & InSequence(const Sequence &s)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:936
friend class FunctionMockerBase
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1072
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:983
const ArgumentMatcherTuple & matchers() const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1048
TypedExpectation & WillRepeatedly(const Action< F > &action)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1008
TypedExpectation & WillOnce(const Action< F > &action)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:994
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:979
TypedExpectation & With(const Matcher< const ArgumentTuple & > &m)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:907
virtual ~TypedExpectation()
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:896
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2, const Sequence &s3)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:949
Function< F >::Result Result
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:881
Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:880
TypedExpectation & RetiresOnSaturation()
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1033
Function< F >::ArgumentTuple ArgumentTuple
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:879
const Action< F > & repeated_action() const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1058
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4, const Sequence &s5)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:957
TypedExpectation & Times(const Cardinality &a_cardinality)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:925
virtual void MaybeDescribeExtraMatcherTo(::std::ostream *os)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1062
TypedExpectation & Times(int n)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:931
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:976
const Matcher< const ArgumentTuple & > & extra_matcher() const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1053
TypedExpectation & After(const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4, const ExpectationSet &s5)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:987
TypedExpectation & InSequence(const Sequence &s1, const Sequence &s2)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:946
static void Print(const T &value, ::std::ostream *os)
Definition dsd/test/gtest/include/gtest/gtest-printers.h:591
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1311
virtual ~UntypedActionResultHolderBase()
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:1313
virtual void PrintAsActionResult(::std::ostream *os) const =0
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:126
void RegisterOwner(const void *mock_obj) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
const UntypedActionResultHolderBase * UntypedInvokeWith(const void *untyped_args) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
void SetOwnerAndName(const void *mock_obj, const char *name) GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
std::vector< const void * > UntypedOnCallSpecs
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:219
std::vector< internal::linked_ptr< ExpectationBase > > UntypedExpectations
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:222
bool VerifyAndClearExpectationsLocked() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
virtual void ClearDefaultActionsLocked() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)=0
virtual void UntypedDescribeUninterestingCall(const void *untyped_args, ::std::ostream *os) const GTEST_LOCK_EXCLUDED_(g_gmock_mutex)=0
const void * mock_obj_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:231
const char * name_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:235
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)=0
const void * MockObject() const GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
Expectation GetHandleOf(ExpectationBase *exp)
virtual ~UntypedFunctionMockerBase()
UntypedExpectations untyped_expectations_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:241
virtual UntypedActionResultHolderBase * UntypedPerformDefaultAction(const void *untyped_args, const string &call_description) const =0
virtual UntypedActionResultHolderBase * UntypedPerformAction(const void *untyped_action, const void *untyped_args) const =0
virtual void UntypedPrintArgs(const void *untyped_args, ::std::ostream *os) const =0
const char * Name() const GTEST_LOCK_EXCLUDED_(g_gmock_mutex)
UntypedOnCallSpecs untyped_on_call_specs_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:238
UntypedFunctionMockerBase()
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:245
int line() const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:253
int line_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:276
Clause
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:257
@ kNone
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:260
@ kWillByDefault
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:262
@ kWith
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:261
void ExpectSpecProperty(bool property, const string &failure_message) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:271
const char * file() const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:252
void AssertSpecProperty(bool property, const string &failure_message) const
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:266
const char * file_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:275
Clause last_clause_
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:280
UntypedOnCallSpecBase(const char *a_file, int a_line)
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:248
Definition dsd/test/gtest/include/gtest/internal/gtest-linked_ptr.h:136
#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
Definition dsd/test/gtest/include/gtest/internal/gtest-port.h:1927
#define GTEST_LOCK_EXCLUDED_(locks)
Definition dsd/test/gtest/include/gtest/internal/gtest-port.h:1928
#define GTEST_API_
Definition dsd/test/gtest/include/gtest/internal/gtest-port.h:768
#define GTEST_DISALLOW_ASSIGN_(type)
Definition dsd/test/gtest/include/gtest/internal/gtest-port.h:721
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
Definition dsd/test/gtest/include/gtest/internal/gtest-port.h:726
#define GTEST_DECLARE_STATIC_MUTEX_(mutex)
Definition dsd/test/gtest/include/gtest/internal/gtest-port.h:1553
Definition dsd/test/gmock/include/gmock/gmock-actions.h:60
GTestMutexLock MutexLock
Definition dsd/test/gtest/include/gtest/internal/gtest-port.h:1563
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Definition dsd/test/gmock/include/gmock/gmock-matchers.h:775
LogSeverity
Definition dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:306
@ kInfo
Definition dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:307
void UniversalPrint(const T &value, ::std::ostream *os)
Definition dsd/test/gtest/include/gtest/gtest-printers.h:752
GTEST_API_::std::string FormatFileLocation(const char *file, int line)
void Assert(bool condition, const char *file, int line)
Definition dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:288
void ReportUninterestingCall(CallReaction reaction, const string &msg)
void Expect(bool condition, const char *file, int line, const string &msg)
Definition dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:294
GTEST_API_ void Log(LogSeverity severity, const string &message, int stack_frames_to_skip)
CallReaction
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:361
@ kWarn
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:363
@ kFail
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:364
@ kAllow
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:362
@ kDefault
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:365
GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity, const char *file, int line, const string &message)
GTEST_API_ ThreadLocal< Sequence * > g_gmock_implicit_sequence
Definition mbelib/test/gmock/include/gmock/gmock-spec-builders.h:674
void ExplainMatchFailureTupleTo(const MatcherTuple &matchers, const ValueTuple &values, ::std::ostream *os)
Definition dsd/test/gmock/include/gmock/gmock-matchers.h:790
Definition dsd/test/gmock/include/gmock/gmock-actions.h:49
const T * DefaultValue< T >::value_
Definition dsd/test/gmock/include/gmock/gmock-actions.h:244
GTEST_API_ Cardinality AtLeast(int n)
Matcher< T > A()
Definition dsd/test/gmock/include/gmock/gmock-matchers.h:3415
class GTEST_API_ testing::InSequence GTEST_ATTRIBUTE_UNUSED_
const T & Const(const T &x)
Definition dsd/test/gmock/include/gmock/gmock-spec-builders.h:1770
GTEST_API_ Cardinality Exactly(int n)
internal::DoDefaultAction DoDefault()
Definition dsd/test/gmock/include/gmock/gmock-actions.h:972
internal::MatcherAsPredicate< M > Matches(M matcher)
Definition dsd/test/gmock/include/gmock/gmock-matchers.h:3932
Definition dsd/test/gmock/include/gmock/internal/gmock-generated-internal-utils.h:154
static const bool value
Definition dsd/test/gtest/include/gtest/internal/gtest-port.h:1613