Updated gMock to 1.7.0
This change updates gMock to the new release, 1.7.0. This is necessary for Android, as Android Master has updated their gTest to 1.7.0, and we must always use the matching version of gMock. This should not break any existing tests, as 1.7.0 is backwards-compatible with 1.6.0 code in nearly all cases. There are a few bugfixes around being too generous with type coercion in EXPECT_THAT() and ASSERT_THAT() that could break code that was accepted by the compiler before but was never technically safe. For a full list of changes, including all the awesome new matchers you can now use in your tests, see CHANGES, which is included from gMock unchanged. For a full list of modifications made to allow this to work on Android Master, see the updated README.android. No changes to the GYP files were necessary as part of this upgrade. Change-Id: Ib1445044e78c9fe0cf16031d544577d65ebbf6df
This commit is contained in:
@@ -75,7 +75,7 @@ class BetweenCardinalityImpl : public CardinalityInterface {
|
||||
virtual int ConservativeUpperBound() const { return max_; }
|
||||
|
||||
virtual bool IsSatisfiedByCallCount(int call_count) const {
|
||||
return min_ <= call_count && call_count <= max_ ;
|
||||
return min_ <= call_count && call_count <= max_;
|
||||
}
|
||||
|
||||
virtual bool IsSaturatedByCallCount(int call_count) const {
|
||||
@@ -83,6 +83,7 @@ class BetweenCardinalityImpl : public CardinalityInterface {
|
||||
}
|
||||
|
||||
virtual void DescribeTo(::std::ostream* os) const;
|
||||
|
||||
private:
|
||||
const int min_;
|
||||
const int max_;
|
||||
@@ -136,20 +137,20 @@ void Cardinality::DescribeActualCallCountTo(int actual_call_count,
|
||||
}
|
||||
|
||||
// Creates a cardinality that allows at least n calls.
|
||||
Cardinality AtLeast(int n) { return Between(n, INT_MAX); }
|
||||
GTEST_API_ Cardinality AtLeast(int n) { return Between(n, INT_MAX); }
|
||||
|
||||
// Creates a cardinality that allows at most n calls.
|
||||
Cardinality AtMost(int n) { return Between(0, n); }
|
||||
GTEST_API_ Cardinality AtMost(int n) { return Between(0, n); }
|
||||
|
||||
// Creates a cardinality that allows any number of calls.
|
||||
Cardinality AnyNumber() { return AtLeast(0); }
|
||||
GTEST_API_ Cardinality AnyNumber() { return AtLeast(0); }
|
||||
|
||||
// Creates a cardinality that allows between min and max calls.
|
||||
Cardinality Between(int min, int max) {
|
||||
GTEST_API_ Cardinality Between(int min, int max) {
|
||||
return Cardinality(new BetweenCardinalityImpl(min, max));
|
||||
}
|
||||
|
||||
// Creates a cardinality that allows exactly n calls.
|
||||
Cardinality Exactly(int n) { return Between(n, n); }
|
||||
GTEST_API_ Cardinality Exactly(int n) { return Between(n, n); }
|
||||
|
||||
} // namespace testing
|
||||
|
||||
Reference in New Issue
Block a user