gmock-cardinalities.h (googletest-release-1.11.0) | : | gmock-cardinalities.h (googletest-release-1.12.0) | ||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
// Google Mock - a framework for writing C++ mock classes. | // Google Mock - a framework for writing C++ mock classes. | |||
// | // | |||
// This file implements some commonly used cardinalities. More | // This file implements some commonly used cardinalities. More | |||
// cardinalities can be defined by the user implementing the | // cardinalities can be defined by the user implementing the | |||
// CardinalityInterface interface if necessary. | // CardinalityInterface interface if necessary. | |||
// GOOGLETEST_CM0002 DO NOT DELETE | // IWYU pragma: private, include "gmock/gmock.h" | |||
// IWYU pragma: friend gmock/.* | ||||
#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_ | #ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_ | |||
#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_ | #define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_ | |||
#include <limits.h> | #include <limits.h> | |||
#include <memory> | #include <memory> | |||
#include <ostream> // NOLINT | #include <ostream> // NOLINT | |||
#include "gmock/internal/gmock-port.h" | #include "gmock/internal/gmock-port.h" | |||
#include "gtest/gtest.h" | #include "gtest/gtest.h" | |||
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ | GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ | |||
/* class A needs to have dll-interface to be used by clients of class B */) | /* class A needs to have dll-interface to be used by clients of class B */) | |||
namespace testing { | namespace testing { | |||
// To implement a cardinality Foo, define: | // To implement a cardinality Foo, define: | |||
// 1. a class FooCardinality that implements the | // 1. a class FooCardinality that implements the | |||
skipping to change at line 118 | skipping to change at line 121 | |||
// Returns true if and only if call_count calls will saturate this | // Returns true if and only if call_count calls will saturate this | |||
// cardinality. | // cardinality. | |||
bool IsSaturatedByCallCount(int call_count) const { | bool IsSaturatedByCallCount(int call_count) const { | |||
return impl_->IsSaturatedByCallCount(call_count); | return impl_->IsSaturatedByCallCount(call_count); | |||
} | } | |||
// Returns true if and only if call_count calls will over-saturate this | // Returns true if and only if call_count calls will over-saturate this | |||
// cardinality, i.e. exceed the maximum number of allowed calls. | // cardinality, i.e. exceed the maximum number of allowed calls. | |||
bool IsOverSaturatedByCallCount(int call_count) const { | bool IsOverSaturatedByCallCount(int call_count) const { | |||
return impl_->IsSaturatedByCallCount(call_count) && | return impl_->IsSaturatedByCallCount(call_count) && | |||
!impl_->IsSatisfiedByCallCount(call_count); | !impl_->IsSatisfiedByCallCount(call_count); | |||
} | } | |||
// Describes self to an ostream | // Describes self to an ostream | |||
void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); } | void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); } | |||
// Describes the given actual call count to an ostream. | // Describes the given actual call count to an ostream. | |||
static void DescribeActualCallCountTo(int actual_call_count, | static void DescribeActualCallCountTo(int actual_call_count, | |||
::std::ostream* os); | ::std::ostream* os); | |||
private: | private: | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 5 lines changed or added |