#include <gmock-spec-builders.h>
Definition at line 695 of file gmock-spec-builders.h.
◆ UntypedActions
◆ Clause
Enumerator |
---|
kNone | |
kWith | |
kTimes | |
kInSequence | |
kAfter | |
kWillOnce | |
kWillRepeatedly | |
kRetiresOnSaturation | |
Definition at line 727 of file gmock-spec-builders.h.
◆ ExpectationBase()
testing::internal::ExpectationBase::ExpectationBase |
( |
const char * | file, |
|
|
int | line, |
|
|
const std::string & | source_text ) |
Definition at line 78 of file gmock-spec-builders.cc.
const std::string source_text_
bool action_count_checked_
bool extra_matcher_specified_
bool retires_on_saturation_
bool repeated_action_specified_
bool cardinality_specified_
GTEST_API_ Cardinality Exactly(int n)
◆ ~ExpectationBase()
testing::internal::ExpectationBase::~ExpectationBase |
( |
| ) |
|
|
virtual |
◆ AllPrerequisitesAreSatisfied()
bool testing::internal::ExpectationBase::AllPrerequisitesAreSatisfied |
( |
| ) |
const |
|
protected |
Definition at line 131 of file gmock-spec-builders.cc.
132 {
133 g_gmock_mutex.AssertHeld();
134 ::std::vector<const ExpectationBase*> expectations(1, this);
135 while (!expectations.empty()) {
137 expectations.pop_back();
138
140 exp->immediate_prerequisites_.begin();
141 it != exp->immediate_prerequisites_.end(); ++it) {
143 if (!
next->IsSatisfied())
return false;
144 expectations.push_back(next);
145 }
146 }
147 return true;
148}
Expectation::Set::const_iterator const_iterator
ExpectationBase(const char *file, int line, const std::string &source_text)
uint32_t next(octet_iterator &it, octet_iterator end)
◆ AssertSpecProperty()
void testing::internal::ExpectationBase::AssertSpecProperty |
( |
bool | property, |
|
|
const std::string & | failure_message ) const |
|
inlineprotected |
Definition at line 746 of file gmock-spec-builders.h.
747 {
749 }
void Assert(bool condition, const char *file, int line)
◆ call_count()
int testing::internal::ExpectationBase::call_count |
( |
| ) |
const |
|
inlineprotected |
◆ cardinality()
const Cardinality & testing::internal::ExpectationBase::cardinality |
( |
| ) |
const |
|
inline |
◆ cardinality_specified()
bool testing::internal::ExpectationBase::cardinality_specified |
( |
| ) |
const |
|
inlineprotected |
◆ CheckActionCountIfNotDone()
void testing::internal::ExpectationBase::CheckActionCountIfNotDone |
( |
| ) |
const |
|
protected |
Definition at line 205 of file gmock-spec-builders.cc.
206 {
207 bool should_check = false;
208 {
212 should_check = true;
213 }
214 }
215
216 if (should_check) {
218
219
220 return;
221 }
222
223
227 bool too_many;
228
229 if (action_count > upper_bound ||
231 too_many = true;
232 } else if (0 < action_count && action_count < lower_bound &&
234 too_many = false;
235 } else {
236 return;
237 }
238
239 ::std::stringstream
ss;
241 ss <<
"Too " << (too_many ?
"many" :
"few")
242 <<
" actions specified in " <<
source_text() <<
"...\n"
243 << "Expected to be ";
245 ss <<
", but has " << (too_many ?
"" :
"only ")
246 << action_count << " WillOnce()"
247 << (action_count == 1 ? "" : "s");
249 ss <<
" and a WillRepeatedly()";
250 }
253 }
254}
void DescribeTo(::std::ostream *os) const
int ConservativeLowerBound() const
int ConservativeUpperBound() const
const char * source_text() const
void DescribeLocationTo(::std::ostream *os) const
UntypedActions untyped_actions_
const Cardinality & cardinality() const
static const Segment ss(Segment::ss)
◆ DescribeCallCountTo()
void testing::internal::ExpectationBase::DescribeCallCountTo |
( |
::std::ostream * | os | ) |
const |
Definition at line 182 of file gmock-spec-builders.cc.
183 {
184 g_gmock_mutex.AssertHeld();
185
186
187 *
os <<
" Expected: to be ";
189 *
os <<
"\n Actual: ";
191
192
193
197 << " and "
199}
static void DescribeActualCallCountTo(int actual_call_count, ::std::ostream *os)
bool IsOverSaturated() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
int call_count() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool IsSaturated() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool IsSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool is_retired() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
◆ DescribeLocationTo()
void testing::internal::ExpectationBase::DescribeLocationTo |
( |
::std::ostream * | os | ) |
const |
|
inline |
Definition at line 710 of file gmock-spec-builders.h.
710 {
712 }
const char * file() const
GTEST_API_::std::string FormatFileLocation(const char *file, int line)
◆ ExpectSpecProperty()
void testing::internal::ExpectationBase::ExpectSpecProperty |
( |
bool | property, |
|
|
const std::string & | failure_message ) const |
|
inlineprotected |
Definition at line 752 of file gmock-spec-builders.h.
753 {
755 }
void Expect(bool condition, const char *file, int line, const std::string &msg)
◆ file()
const char * testing::internal::ExpectationBase::file |
( |
| ) |
const |
|
inline |
◆ FindUnsatisfiedPrerequisites()
void testing::internal::ExpectationBase::FindUnsatisfiedPrerequisites |
( |
ExpectationSet * | result | ) |
const |
|
protected |
Definition at line 151 of file gmock-spec-builders.cc.
152 {
153 g_gmock_mutex.AssertHeld();
154 ::std::vector<const ExpectationBase*> expectations(1, this);
155 while (!expectations.empty()) {
157 expectations.pop_back();
158
160 exp->immediate_prerequisites_.begin();
161 it != exp->immediate_prerequisites_.end(); ++it) {
163
164 if (
next->IsSatisfied()) {
165
166
167 if (
next->call_count_ == 0) {
168 expectations.push_back(next);
169 }
170 } else {
171
172
173
174 *result += *it;
175 }
176 }
177 }
178}
◆ GetHandle()
virtual Expectation testing::internal::ExpectationBase::GetHandle |
( |
| ) |
|
|
protectedpure virtual |
◆ GTEST_DISALLOW_ASSIGN_()
testing::internal::ExpectationBase::GTEST_DISALLOW_ASSIGN_ |
( |
ExpectationBase | | ) |
|
|
protected |
◆ IncrementCallCount()
void testing::internal::ExpectationBase::IncrementCallCount |
( |
| ) |
|
|
inlineprotected |
◆ is_retired()
bool testing::internal::ExpectationBase::is_retired |
( |
| ) |
const |
|
inlineprotected |
◆ IsOverSaturated()
bool testing::internal::ExpectationBase::IsOverSaturated |
( |
| ) |
const |
|
inlineprotected |
Definition at line 807 of file gmock-spec-builders.h.
808 {
809 g_gmock_mutex.AssertHeld();
811 }
bool IsOverSaturatedByCallCount(int call_count) const
◆ IsSatisfied()
bool testing::internal::ExpectationBase::IsSatisfied |
( |
| ) |
const |
|
inlineprotected |
Definition at line 793 of file gmock-spec-builders.h.
794 {
795 g_gmock_mutex.AssertHeld();
797 }
bool IsSatisfiedByCallCount(int call_count) const
◆ IsSaturated()
bool testing::internal::ExpectationBase::IsSaturated |
( |
| ) |
const |
|
inlineprotected |
Definition at line 800 of file gmock-spec-builders.h.
801 {
802 g_gmock_mutex.AssertHeld();
804 }
bool IsSaturatedByCallCount(int call_count) const
◆ line()
int testing::internal::ExpectationBase::line |
( |
| ) |
const |
|
inline |
◆ MaybeDescribeExtraMatcherTo()
virtual void testing::internal::ExpectationBase::MaybeDescribeExtraMatcherTo |
( |
::std::ostream * | os | ) |
|
|
pure virtual |
◆ Retire()
void testing::internal::ExpectationBase::Retire |
( |
| ) |
|
|
inlineprotected |
◆ RetireAllPreRequisites()
void testing::internal::ExpectationBase::RetireAllPreRequisites |
( |
| ) |
|
|
protected |
Definition at line 104 of file gmock-spec-builders.cc.
105 {
107
108
109 return;
110 }
111
112 ::std::vector<ExpectationBase*> expectations(1, this);
113 while (!expectations.empty()) {
115 expectations.pop_back();
116
118 exp->immediate_prerequisites_.begin();
119 it != exp->immediate_prerequisites_.end(); ++it) {
121 if (!
next->is_retired()) {
123 expectations.push_back(next);
124 }
125 }
126 }
127}
◆ set_cardinality()
void testing::internal::ExpectationBase::set_cardinality |
( |
const Cardinality & | a_cardinality | ) |
|
|
inlineprotected |
◆ source_text()
const char * testing::internal::ExpectationBase::source_text |
( |
| ) |
const |
|
inline |
◆ SpecifyCardinality()
void testing::internal::ExpectationBase::SpecifyCardinality |
( |
const Cardinality & | cardinality | ) |
|
|
protected |
◆ UntypedTimes()
void testing::internal::ExpectationBase::UntypedTimes |
( |
const Cardinality & | a_cardinality | ) |
|
|
protected |
Definition at line 257 of file gmock-spec-builders.cc.
257 {
260 ".Times() cannot appear "
261 "more than once in an EXPECT_CALL().");
262 } else {
264 ".Times() cannot appear after "
265 ".InSequence(), .WillOnce(), .WillRepeatedly(), "
266 "or .RetiresOnSaturation().");
267 }
269
271}
void SpecifyCardinality(const Cardinality &cardinality)
void ExpectSpecProperty(bool property, const std::string &failure_message) const
◆ ::testing::Expectation
◆ ::testing::internal::ExpectationTester
◆ ::testing::Sequence
◆ TypedExpectation
◆ UntypedFunctionMockerBase
◆ action_count_checked_
bool testing::internal::ExpectationBase::action_count_checked_ |
|
mutableprotected |
◆ call_count_
int testing::internal::ExpectationBase::call_count_ |
|
protected |
◆ cardinality_
Cardinality testing::internal::ExpectationBase::cardinality_ |
|
protected |
◆ cardinality_specified_
bool testing::internal::ExpectationBase::cardinality_specified_ |
|
protected |
◆ extra_matcher_specified_
bool testing::internal::ExpectationBase::extra_matcher_specified_ |
|
protected |
◆ file_
const char* testing::internal::ExpectationBase::file_ |
|
protected |
◆ immediate_prerequisites_
ExpectationSet testing::internal::ExpectationBase::immediate_prerequisites_ |
|
protected |
◆ last_clause_
Clause testing::internal::ExpectationBase::last_clause_ |
|
protected |
◆ line_
int testing::internal::ExpectationBase::line_ |
|
protected |
◆ mutex_
Mutex testing::internal::ExpectationBase::mutex_ |
|
mutableprotected |
◆ repeated_action_specified_
bool testing::internal::ExpectationBase::repeated_action_specified_ |
|
protected |
◆ retired_
bool testing::internal::ExpectationBase::retired_ |
|
protected |
◆ retires_on_saturation_
bool testing::internal::ExpectationBase::retires_on_saturation_ |
|
protected |
◆ source_text_
const std::string testing::internal::ExpectationBase::source_text_ |
|
protected |
◆ untyped_actions_
The documentation for this class was generated from the following files: