39 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
40 #define GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
64 class CardinalityInterface {
66 virtual ~CardinalityInterface() {}
70 virtual int ConservativeLowerBound()
const {
return 0; }
71 virtual int ConservativeUpperBound()
const {
return INT_MAX; }
75 virtual bool IsSatisfiedByCallCount(
int call_count)
const = 0;
79 virtual bool IsSaturatedByCallCount(
int call_count)
const = 0;
82 virtual void DescribeTo(::std::ostream* os)
const = 0;
96 explicit Cardinality(
const CardinalityInterface* impl) : impl_(impl) {}
100 int ConservativeLowerBound()
const {
return impl_->ConservativeLowerBound(); }
101 int ConservativeUpperBound()
const {
return impl_->ConservativeUpperBound(); }
105 bool IsSatisfiedByCallCount(
int call_count)
const {
106 return impl_->IsSatisfiedByCallCount(call_count);
111 bool IsSaturatedByCallCount(
int call_count)
const {
112 return impl_->IsSaturatedByCallCount(call_count);
117 bool IsOverSaturatedByCallCount(
int call_count)
const {
118 return impl_->IsSaturatedByCallCount(call_count) &&
119 !impl_->IsSatisfiedByCallCount(call_count);
123 void DescribeTo(::std::ostream* os)
const { impl_->DescribeTo(os); }
126 static void DescribeActualCallCountTo(
int actual_call_count,
130 std::shared_ptr<const CardinalityInterface> impl_;
149 inline Cardinality MakeCardinality(
const CardinalityInterface*
c) {
150 return Cardinality(c);
157 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
GTEST_API_ Cardinality AtLeast(int n)
GTEST_API_ Cardinality AtMost(int n)
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
expr expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c *expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr2 expr1 expr2 expr1 expr1 expr1 c
#define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
SimpleFad< ValueT > min(const SimpleFad< ValueT > &a, const SimpleFad< ValueT > &b)
GTEST_API_ Cardinality Between(int min, int max)
GTEST_API_ Cardinality Exactly(int n)
GTEST_API_ Cardinality AnyNumber()
SimpleFad< ValueT > max(const SimpleFad< ValueT > &a, const SimpleFad< ValueT > &b)