39 #ifndef GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
40 #define GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
45 #include "gmock/internal/gmock-port.h"
46 #include "gtest/gtest.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_;
143 GTEST_API_ Cardinality Between(
int min,
int max);
149 inline Cardinality MakeCardinality(
const CardinalityInterface* c) {
150 return Cardinality(c);
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251) namespace testing
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-cardinalities.h:48
#define GTEST_API_
Definition: cmake-build-debug/googletest-src/googletest/include/gtest/internal/gtest-port.h:775
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
Definition: cmake-build-debug/googletest-src/googletest/include/gtest/internal/gtest-port.h:324
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-actions.h:154