Commit 26743363 authored by Abseil Team's avatar Abseil Team Committed by Gennadiy Civil
Browse files

Googletest export

Applied fixes for ClangTidy modernize-use-override and modernize-use-using.

PiperOrigin-RevId: 223800219
parent a42cdf2a
...@@ -257,7 +257,7 @@ class DefaultValue { ...@@ -257,7 +257,7 @@ class DefaultValue {
class FixedValueProducer : public ValueProducer { class FixedValueProducer : public ValueProducer {
public: public:
explicit FixedValueProducer(T value) : value_(value) {} explicit FixedValueProducer(T value) : value_(value) {}
virtual T Produce() { return value_; } T Produce() override { return value_; }
private: private:
const T value_; const T value_;
...@@ -268,7 +268,7 @@ class DefaultValue { ...@@ -268,7 +268,7 @@ class DefaultValue {
public: public:
explicit FactoryValueProducer(FactoryFunction factory) explicit FactoryValueProducer(FactoryFunction factory)
: factory_(factory) {} : factory_(factory) {}
virtual T Produce() { return factory_(); } T Produce() override { return factory_(); }
private: private:
const FactoryFunction factory_; const FactoryFunction factory_;
...@@ -472,7 +472,7 @@ class PolymorphicAction { ...@@ -472,7 +472,7 @@ class PolymorphicAction {
explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {} explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
virtual Result Perform(const ArgumentTuple& args) { Result Perform(const ArgumentTuple& args) override {
return impl_.template Perform<Result>(args); return impl_.template Perform<Result>(args);
} }
...@@ -518,7 +518,7 @@ class ActionAdaptor : public ActionInterface<F1> { ...@@ -518,7 +518,7 @@ class ActionAdaptor : public ActionInterface<F1> {
explicit ActionAdaptor(const Action<F2>& from) : impl_(from.impl_) {} explicit ActionAdaptor(const Action<F2>& from) : impl_(from.impl_) {}
virtual Result Perform(const ArgumentTuple& args) { Result Perform(const ArgumentTuple& args) override {
return impl_->Perform(args); return impl_->Perform(args);
} }
...@@ -609,7 +609,7 @@ class ReturnAction { ...@@ -609,7 +609,7 @@ class ReturnAction {
: value_before_cast_(*value), : value_before_cast_(*value),
value_(ImplicitCast_<Result>(value_before_cast_)) {} value_(ImplicitCast_<Result>(value_before_cast_)) {}
virtual Result Perform(const ArgumentTuple&) { return value_; } Result Perform(const ArgumentTuple&) override { return value_; }
private: private:
GTEST_COMPILE_ASSERT_(!is_reference<Result>::value, GTEST_COMPILE_ASSERT_(!is_reference<Result>::value,
...@@ -633,7 +633,7 @@ class ReturnAction { ...@@ -633,7 +633,7 @@ class ReturnAction {
explicit Impl(const std::shared_ptr<R>& wrapper) explicit Impl(const std::shared_ptr<R>& wrapper)
: performed_(false), wrapper_(wrapper) {} : performed_(false), wrapper_(wrapper) {}
virtual Result Perform(const ArgumentTuple&) { Result Perform(const ArgumentTuple&) override {
GTEST_CHECK_(!performed_) GTEST_CHECK_(!performed_)
<< "A ByMove() action should only be performed once."; << "A ByMove() action should only be performed once.";
performed_ = true; performed_ = true;
...@@ -712,9 +712,7 @@ class ReturnRefAction { ...@@ -712,9 +712,7 @@ class ReturnRefAction {
explicit Impl(T& ref) : ref_(ref) {} // NOLINT explicit Impl(T& ref) : ref_(ref) {} // NOLINT
virtual Result Perform(const ArgumentTuple&) { Result Perform(const ArgumentTuple&) override { return ref_; }
return ref_;
}
private: private:
T& ref_; T& ref_;
...@@ -761,9 +759,7 @@ class ReturnRefOfCopyAction { ...@@ -761,9 +759,7 @@ class ReturnRefOfCopyAction {
explicit Impl(const T& value) : value_(value) {} // NOLINT explicit Impl(const T& value) : value_(value) {} // NOLINT
virtual Result Perform(const ArgumentTuple&) { Result Perform(const ArgumentTuple&) override { return value_; }
return value_;
}
private: private:
T value_; T value_;
...@@ -973,7 +969,7 @@ class IgnoreResultAction { ...@@ -973,7 +969,7 @@ class IgnoreResultAction {
explicit Impl(const A& action) : action_(action) {} explicit Impl(const A& action) : action_(action) {}
virtual void Perform(const ArgumentTuple& args) { void Perform(const ArgumentTuple& args) override {
// Performs the action and ignores its result. // Performs the action and ignores its result.
action_.Perform(args); action_.Perform(args);
} }
...@@ -1048,7 +1044,7 @@ class DoBothAction { ...@@ -1048,7 +1044,7 @@ class DoBothAction {
Impl(const Action<VoidResult>& action1, const Action<F>& action2) Impl(const Action<VoidResult>& action1, const Action<F>& action2)
: action1_(action1), action2_(action2) {} : action1_(action1), action2_(action2) {}
virtual Result Perform(const ArgumentTuple& args) { Result Perform(const ArgumentTuple& args) override {
action1_.Perform(args); action1_.Perform(args);
return action2_.Perform(args); return action2_.Perform(args);
} }
......
...@@ -181,7 +181,7 @@ class NiceMock : public MockClass { ...@@ -181,7 +181,7 @@ class NiceMock : public MockClass {
#endif // GTEST_LANG_CXX11 #endif // GTEST_LANG_CXX11
~NiceMock() { ~NiceMock() { // NOLINT
::testing::Mock::UnregisterCallReaction( ::testing::Mock::UnregisterCallReaction(
internal::ImplicitCast_<MockClass*>(this)); internal::ImplicitCast_<MockClass*>(this));
} }
...@@ -299,7 +299,7 @@ class NaggyMock : public MockClass { ...@@ -299,7 +299,7 @@ class NaggyMock : public MockClass {
#endif // GTEST_LANG_CXX11 #endif // GTEST_LANG_CXX11
~NaggyMock() { ~NaggyMock() { // NOLINT
::testing::Mock::UnregisterCallReaction( ::testing::Mock::UnregisterCallReaction(
internal::ImplicitCast_<MockClass*>(this)); internal::ImplicitCast_<MockClass*>(this));
} }
...@@ -417,7 +417,7 @@ class StrictMock : public MockClass { ...@@ -417,7 +417,7 @@ class StrictMock : public MockClass {
#endif // GTEST_LANG_CXX11 #endif // GTEST_LANG_CXX11
~StrictMock() { ~StrictMock() { // NOLINT
::testing::Mock::UnregisterCallReaction( ::testing::Mock::UnregisterCallReaction(
internal::ImplicitCast_<MockClass*>(this)); internal::ImplicitCast_<MockClass*>(this));
} }
......
...@@ -135,7 +135,7 @@ $range j 1..i ...@@ -135,7 +135,7 @@ $range j 1..i
]] ]]
#endif // GTEST_LANG_CXX11 #endif // GTEST_LANG_CXX11
~$clazz() { ~$clazz() { // NOLINT
::testing::Mock::UnregisterCallReaction( ::testing::Mock::UnregisterCallReaction(
internal::ImplicitCast_<MockClass*>(this)); internal::ImplicitCast_<MockClass*>(this));
} }
......
...@@ -193,7 +193,7 @@ class MatcherCastImpl<T, Matcher<U> > { ...@@ -193,7 +193,7 @@ class MatcherCastImpl<T, Matcher<U> > {
: source_matcher_(source_matcher) {} : source_matcher_(source_matcher) {}
// We delegate the matching logic to the source matcher. // We delegate the matching logic to the source matcher.
virtual bool MatchAndExplain(T x, MatchResultListener* listener) const { bool MatchAndExplain(T x, MatchResultListener* listener) const override {
#if GTEST_LANG_CXX11 #if GTEST_LANG_CXX11
using FromType = typename std::remove_cv<typename std::remove_pointer< using FromType = typename std::remove_cv<typename std::remove_pointer<
typename std::remove_reference<T>::type>::type>::type; typename std::remove_reference<T>::type>::type>::type;
...@@ -213,11 +213,11 @@ class MatcherCastImpl<T, Matcher<U> > { ...@@ -213,11 +213,11 @@ class MatcherCastImpl<T, Matcher<U> > {
return source_matcher_.MatchAndExplain(static_cast<U>(x), listener); return source_matcher_.MatchAndExplain(static_cast<U>(x), listener);
} }
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
source_matcher_.DescribeTo(os); source_matcher_.DescribeTo(os);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
source_matcher_.DescribeNegationTo(os); source_matcher_.DescribeNegationTo(os);
} }
...@@ -494,12 +494,12 @@ OutIter TransformTupleValues(Func f, const Tuple& t, OutIter out) { ...@@ -494,12 +494,12 @@ OutIter TransformTupleValues(Func f, const Tuple& t, OutIter out) {
template <typename T> template <typename T>
class AnyMatcherImpl : public MatcherInterface<GTEST_REFERENCE_TO_CONST_(T)> { class AnyMatcherImpl : public MatcherInterface<GTEST_REFERENCE_TO_CONST_(T)> {
public: public:
virtual bool MatchAndExplain(GTEST_REFERENCE_TO_CONST_(T) /* x */, bool MatchAndExplain(GTEST_REFERENCE_TO_CONST_(T) /* x */,
MatchResultListener* /* listener */) const { MatchResultListener* /* listener */) const override {
return true; return true;
} }
virtual void DescribeTo(::std::ostream* os) const { *os << "is anything"; } void DescribeTo(::std::ostream* os) const override { *os << "is anything"; }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
// This is mostly for completeness' safe, as it's not very useful // This is mostly for completeness' safe, as it's not very useful
// to write Not(A<bool>()). However we cannot completely rule out // to write Not(A<bool>()). However we cannot completely rule out
// such a possibility, and it doesn't hurt to be prepared. // such a possibility, and it doesn't hurt to be prepared.
...@@ -604,18 +604,18 @@ class RefMatcher<T&> { ...@@ -604,18 +604,18 @@ class RefMatcher<T&> {
// MatchAndExplain() takes a Super& (as opposed to const Super&) // MatchAndExplain() takes a Super& (as opposed to const Super&)
// in order to match the interface MatcherInterface<Super&>. // in order to match the interface MatcherInterface<Super&>.
virtual bool MatchAndExplain( bool MatchAndExplain(Super& x,
Super& x, MatchResultListener* listener) const { MatchResultListener* listener) const override {
*listener << "which is located @" << static_cast<const void*>(&x); *listener << "which is located @" << static_cast<const void*>(&x);
return &x == &object_; return &x == &object_;
} }
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "references the variable "; *os << "references the variable ";
UniversalPrinter<Super&>::Print(object_, os); UniversalPrinter<Super&>::Print(object_, os);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "does not reference the variable "; *os << "does not reference the variable ";
UniversalPrinter<Super&>::Print(object_, os); UniversalPrinter<Super&>::Print(object_, os);
} }
...@@ -933,15 +933,14 @@ class PairMatchBase { ...@@ -933,15 +933,14 @@ class PairMatchBase {
template <typename Tuple> template <typename Tuple>
class Impl : public MatcherInterface<Tuple> { class Impl : public MatcherInterface<Tuple> {
public: public:
virtual bool MatchAndExplain( bool MatchAndExplain(Tuple args,
Tuple args, MatchResultListener* /* listener */) const override {
MatchResultListener* /* listener */) const {
return Op()(::std::get<0>(args), ::std::get<1>(args)); return Op()(::std::get<0>(args), ::std::get<1>(args));
} }
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "are " << GetDesc; *os << "are " << GetDesc;
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "aren't " << GetDesc; *os << "aren't " << GetDesc;
} }
}; };
...@@ -982,16 +981,16 @@ class NotMatcherImpl : public MatcherInterface<GTEST_REFERENCE_TO_CONST_(T)> { ...@@ -982,16 +981,16 @@ class NotMatcherImpl : public MatcherInterface<GTEST_REFERENCE_TO_CONST_(T)> {
explicit NotMatcherImpl(const Matcher<T>& matcher) explicit NotMatcherImpl(const Matcher<T>& matcher)
: matcher_(matcher) {} : matcher_(matcher) {}
virtual bool MatchAndExplain(GTEST_REFERENCE_TO_CONST_(T) x, bool MatchAndExplain(GTEST_REFERENCE_TO_CONST_(T) x,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
return !matcher_.MatchAndExplain(x, listener); return !matcher_.MatchAndExplain(x, listener);
} }
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
matcher_.DescribeNegationTo(os); matcher_.DescribeNegationTo(os);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
matcher_.DescribeTo(os); matcher_.DescribeTo(os);
} }
...@@ -1032,7 +1031,7 @@ class AllOfMatcherImpl ...@@ -1032,7 +1031,7 @@ class AllOfMatcherImpl
explicit AllOfMatcherImpl(std::vector<Matcher<T> > matchers) explicit AllOfMatcherImpl(std::vector<Matcher<T> > matchers)
: matchers_(std::move(matchers)) {} : matchers_(std::move(matchers)) {}
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "("; *os << "(";
for (size_t i = 0; i < matchers_.size(); ++i) { for (size_t i = 0; i < matchers_.size(); ++i) {
if (i != 0) *os << ") and ("; if (i != 0) *os << ") and (";
...@@ -1041,7 +1040,7 @@ class AllOfMatcherImpl ...@@ -1041,7 +1040,7 @@ class AllOfMatcherImpl
*os << ")"; *os << ")";
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "("; *os << "(";
for (size_t i = 0; i < matchers_.size(); ++i) { for (size_t i = 0; i < matchers_.size(); ++i) {
if (i != 0) *os << ") or ("; if (i != 0) *os << ") or (";
...@@ -1050,8 +1049,8 @@ class AllOfMatcherImpl ...@@ -1050,8 +1049,8 @@ class AllOfMatcherImpl
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(GTEST_REFERENCE_TO_CONST_(T) x, bool MatchAndExplain(GTEST_REFERENCE_TO_CONST_(T) x,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
// If either matcher1_ or matcher2_ doesn't match x, we only need // If either matcher1_ or matcher2_ doesn't match x, we only need
// to explain why one of them fails. // to explain why one of them fails.
std::string all_match_result; std::string all_match_result;
...@@ -1139,7 +1138,7 @@ class AnyOfMatcherImpl ...@@ -1139,7 +1138,7 @@ class AnyOfMatcherImpl
explicit AnyOfMatcherImpl(std::vector<Matcher<T> > matchers) explicit AnyOfMatcherImpl(std::vector<Matcher<T> > matchers)
: matchers_(std::move(matchers)) {} : matchers_(std::move(matchers)) {}
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "("; *os << "(";
for (size_t i = 0; i < matchers_.size(); ++i) { for (size_t i = 0; i < matchers_.size(); ++i) {
if (i != 0) *os << ") or ("; if (i != 0) *os << ") or (";
...@@ -1148,7 +1147,7 @@ class AnyOfMatcherImpl ...@@ -1148,7 +1147,7 @@ class AnyOfMatcherImpl
*os << ")"; *os << ")";
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "("; *os << "(";
for (size_t i = 0; i < matchers_.size(); ++i) { for (size_t i = 0; i < matchers_.size(); ++i) {
if (i != 0) *os << ") and ("; if (i != 0) *os << ") and (";
...@@ -1157,8 +1156,8 @@ class AnyOfMatcherImpl ...@@ -1157,8 +1156,8 @@ class AnyOfMatcherImpl
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(GTEST_REFERENCE_TO_CONST_(T) x, bool MatchAndExplain(GTEST_REFERENCE_TO_CONST_(T) x,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
std::string no_match_result; std::string no_match_result;
// If either matcher1_ or matcher2_ matches x, we just need to // If either matcher1_ or matcher2_ matches x, we just need to
...@@ -1363,8 +1362,8 @@ class FloatingEqMatcher { ...@@ -1363,8 +1362,8 @@ class FloatingEqMatcher {
nan_eq_nan_(nan_eq_nan), nan_eq_nan_(nan_eq_nan),
max_abs_error_(max_abs_error) {} max_abs_error_(max_abs_error) {}
virtual bool MatchAndExplain(T value, bool MatchAndExplain(T value,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
const FloatingPoint<FloatType> actual(value), expected(expected_); const FloatingPoint<FloatType> actual(value), expected(expected_);
// Compares NaNs first, if nan_eq_nan_ is true. // Compares NaNs first, if nan_eq_nan_ is true.
...@@ -1398,7 +1397,7 @@ class FloatingEqMatcher { ...@@ -1398,7 +1397,7 @@ class FloatingEqMatcher {
} }
} }
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
// os->precision() returns the previously set precision, which we // os->precision() returns the previously set precision, which we
// store to restore the ostream to its original configuration // store to restore the ostream to its original configuration
// after outputting. // after outputting.
...@@ -1419,7 +1418,7 @@ class FloatingEqMatcher { ...@@ -1419,7 +1418,7 @@ class FloatingEqMatcher {
os->precision(old_precision); os->precision(old_precision);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
// As before, get original precision. // As before, get original precision.
const ::std::streamsize old_precision = os->precision( const ::std::streamsize old_precision = os->precision(
::std::numeric_limits<FloatType>::digits10 + 2); ::std::numeric_limits<FloatType>::digits10 + 2);
...@@ -1525,8 +1524,8 @@ class FloatingEq2Matcher { ...@@ -1525,8 +1524,8 @@ class FloatingEq2Matcher {
max_abs_error_(max_abs_error), max_abs_error_(max_abs_error),
nan_eq_nan_(nan_eq_nan) {} nan_eq_nan_(nan_eq_nan) {}
virtual bool MatchAndExplain(Tuple args, bool MatchAndExplain(Tuple args,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
if (max_abs_error_ == -1) { if (max_abs_error_ == -1) {
FloatingEqMatcher<FloatType> fm(::std::get<0>(args), nan_eq_nan_); FloatingEqMatcher<FloatType> fm(::std::get<0>(args), nan_eq_nan_);
return static_cast<Matcher<FloatType>>(fm).MatchAndExplain( return static_cast<Matcher<FloatType>>(fm).MatchAndExplain(
...@@ -1538,10 +1537,10 @@ class FloatingEq2Matcher { ...@@ -1538,10 +1537,10 @@ class FloatingEq2Matcher {
::std::get<1>(args), listener); ::std::get<1>(args), listener);
} }
} }
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "are " << GetDesc; *os << "are " << GetDesc;
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "aren't " << GetDesc; *os << "aren't " << GetDesc;
} }
...@@ -1590,18 +1589,18 @@ class PointeeMatcher { ...@@ -1590,18 +1589,18 @@ class PointeeMatcher {
explicit Impl(const InnerMatcher& matcher) explicit Impl(const InnerMatcher& matcher)
: matcher_(MatcherCast<const Pointee&>(matcher)) {} : matcher_(MatcherCast<const Pointee&>(matcher)) {}
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "points to a value that "; *os << "points to a value that ";
matcher_.DescribeTo(os); matcher_.DescribeTo(os);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "does not point to a value that "; *os << "does not point to a value that ";
matcher_.DescribeTo(os); matcher_.DescribeTo(os);
} }
virtual bool MatchAndExplain(Pointer pointer, bool MatchAndExplain(Pointer pointer,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
if (GetRawPointer(pointer) == nullptr) return false; if (GetRawPointer(pointer) == nullptr) return false;
*listener << "which points to "; *listener << "which points to ";
...@@ -1901,17 +1900,17 @@ class ResultOfMatcher { ...@@ -1901,17 +1900,17 @@ class ResultOfMatcher {
Impl(const CallableStorageType& callable, const M& matcher) Impl(const CallableStorageType& callable, const M& matcher)
: callable_(callable), matcher_(MatcherCast<ResultType>(matcher)) {} : callable_(callable), matcher_(MatcherCast<ResultType>(matcher)) {}
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "is mapped by the given callable to a value that "; *os << "is mapped by the given callable to a value that ";
matcher_.DescribeTo(os); matcher_.DescribeTo(os);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "is mapped by the given callable to a value that "; *os << "is mapped by the given callable to a value that ";
matcher_.DescribeNegationTo(os); matcher_.DescribeNegationTo(os);
} }
virtual bool MatchAndExplain(T obj, MatchResultListener* listener) const { bool MatchAndExplain(T obj, MatchResultListener* listener) const override {
*listener << "which is mapped by the given callable to "; *listener << "which is mapped by the given callable to ";
// Cannot pass the return value directly to MatchPrintAndExplain, which // Cannot pass the return value directly to MatchPrintAndExplain, which
// takes a non-const reference as argument. // takes a non-const reference as argument.
...@@ -1962,17 +1961,17 @@ class SizeIsMatcher { ...@@ -1962,17 +1961,17 @@ class SizeIsMatcher {
explicit Impl(const SizeMatcher& size_matcher) explicit Impl(const SizeMatcher& size_matcher)
: size_matcher_(MatcherCast<SizeType>(size_matcher)) {} : size_matcher_(MatcherCast<SizeType>(size_matcher)) {}
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "size "; *os << "size ";
size_matcher_.DescribeTo(os); size_matcher_.DescribeTo(os);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "size "; *os << "size ";
size_matcher_.DescribeNegationTo(os); size_matcher_.DescribeNegationTo(os);
} }
virtual bool MatchAndExplain(Container container, bool MatchAndExplain(Container container,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
SizeType size = container.size(); SizeType size = container.size();
StringMatchResultListener size_listener; StringMatchResultListener size_listener;
const bool result = size_matcher_.MatchAndExplain(size, &size_listener); const bool result = size_matcher_.MatchAndExplain(size, &size_listener);
...@@ -2016,17 +2015,17 @@ class BeginEndDistanceIsMatcher { ...@@ -2016,17 +2015,17 @@ class BeginEndDistanceIsMatcher {
explicit Impl(const DistanceMatcher& distance_matcher) explicit Impl(const DistanceMatcher& distance_matcher)
: distance_matcher_(MatcherCast<DistanceType>(distance_matcher)) {} : distance_matcher_(MatcherCast<DistanceType>(distance_matcher)) {}
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "distance between begin() and end() "; *os << "distance between begin() and end() ";
distance_matcher_.DescribeTo(os); distance_matcher_.DescribeTo(os);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "distance between begin() and end() "; *os << "distance between begin() and end() ";
distance_matcher_.DescribeNegationTo(os); distance_matcher_.DescribeNegationTo(os);
} }
virtual bool MatchAndExplain(Container container, bool MatchAndExplain(Container container,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
#if GTEST_HAS_STD_BEGIN_AND_END_ #if GTEST_HAS_STD_BEGIN_AND_END_
using std::begin; using std::begin;
using std::end; using std::end;
...@@ -2182,18 +2181,18 @@ class WhenSortedByMatcher { ...@@ -2182,18 +2181,18 @@ class WhenSortedByMatcher {
Impl(const Comparator& comparator, const ContainerMatcher& matcher) Impl(const Comparator& comparator, const ContainerMatcher& matcher)
: comparator_(comparator), matcher_(matcher) {} : comparator_(comparator), matcher_(matcher) {}
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "(when sorted) "; *os << "(when sorted) ";
matcher_.DescribeTo(os); matcher_.DescribeTo(os);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "(when sorted) "; *os << "(when sorted) ";
matcher_.DescribeNegationTo(os); matcher_.DescribeNegationTo(os);
} }
virtual bool MatchAndExplain(LhsContainer lhs, bool MatchAndExplain(LhsContainer lhs,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs); LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
::std::vector<LhsValue> sorted_container(lhs_stl_container.begin(), ::std::vector<LhsValue> sorted_container(lhs_stl_container.begin(),
lhs_stl_container.end()); lhs_stl_container.end());
...@@ -2284,14 +2283,14 @@ class PointwiseMatcher { ...@@ -2284,14 +2283,14 @@ class PointwiseMatcher {
: mono_tuple_matcher_(SafeMatcherCast<InnerMatcherArg>(tuple_matcher)), : mono_tuple_matcher_(SafeMatcherCast<InnerMatcherArg>(tuple_matcher)),
rhs_(rhs) {} rhs_(rhs) {}
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "contains " << rhs_.size() *os << "contains " << rhs_.size()
<< " values, where each value and its corresponding value in "; << " values, where each value and its corresponding value in ";
UniversalPrinter<RhsStlContainer>::Print(rhs_, os); UniversalPrinter<RhsStlContainer>::Print(rhs_, os);
*os << " "; *os << " ";
mono_tuple_matcher_.DescribeTo(os); mono_tuple_matcher_.DescribeTo(os);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "doesn't contain exactly " << rhs_.size() *os << "doesn't contain exactly " << rhs_.size()
<< " values, or contains a value x at some index i" << " values, or contains a value x at some index i"
<< " where x and the i-th value of "; << " where x and the i-th value of ";
...@@ -2300,8 +2299,8 @@ class PointwiseMatcher { ...@@ -2300,8 +2299,8 @@ class PointwiseMatcher {
mono_tuple_matcher_.DescribeNegationTo(os); mono_tuple_matcher_.DescribeNegationTo(os);
} }
virtual bool MatchAndExplain(LhsContainer lhs, bool MatchAndExplain(LhsContainer lhs,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs); LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
const size_t actual_size = lhs_stl_container.size(); const size_t actual_size = lhs_stl_container.size();
if (actual_size != rhs_.size()) { if (actual_size != rhs_.size()) {
...@@ -2408,18 +2407,18 @@ class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> { ...@@ -2408,18 +2407,18 @@ class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {
: QuantifierMatcherImpl<Container>(inner_matcher) {} : QuantifierMatcherImpl<Container>(inner_matcher) {}
// Describes what this matcher does. // Describes what this matcher does.
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "contains at least one element that "; *os << "contains at least one element that ";
this->inner_matcher_.DescribeTo(os); this->inner_matcher_.DescribeTo(os);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "doesn't contain any element that "; *os << "doesn't contain any element that ";
this->inner_matcher_.DescribeTo(os); this->inner_matcher_.DescribeTo(os);
} }
virtual bool MatchAndExplain(Container container, bool MatchAndExplain(Container container,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
return this->MatchAndExplainImpl(false, container, listener); return this->MatchAndExplainImpl(false, container, listener);
} }
...@@ -2437,18 +2436,18 @@ class EachMatcherImpl : public QuantifierMatcherImpl<Container> { ...@@ -2437,18 +2436,18 @@ class EachMatcherImpl : public QuantifierMatcherImpl<Container> {
: QuantifierMatcherImpl<Container>(inner_matcher) {} : QuantifierMatcherImpl<Container>(inner_matcher) {}
// Describes what this matcher does. // Describes what this matcher does.
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "only contains elements that "; *os << "only contains elements that ";
this->inner_matcher_.DescribeTo(os); this->inner_matcher_.DescribeTo(os);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "contains some element that "; *os << "contains some element that ";
this->inner_matcher_.DescribeNegationTo(os); this->inner_matcher_.DescribeNegationTo(os);
} }
virtual bool MatchAndExplain(Container container, bool MatchAndExplain(Container container,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
return this->MatchAndExplainImpl(true, container, listener); return this->MatchAndExplainImpl(true, container, listener);
} }
...@@ -2551,8 +2550,8 @@ class KeyMatcherImpl : public MatcherInterface<PairType> { ...@@ -2551,8 +2550,8 @@ class KeyMatcherImpl : public MatcherInterface<PairType> {
} }
// Returns true iff 'key_value.first' (the key) matches the inner matcher. // Returns true iff 'key_value.first' (the key) matches the inner matcher.
virtual bool MatchAndExplain(PairType key_value, bool MatchAndExplain(PairType key_value,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
StringMatchResultListener inner_listener; StringMatchResultListener inner_listener;
const bool match = inner_matcher_.MatchAndExplain( const bool match = inner_matcher_.MatchAndExplain(
pair_getters::First(key_value, Rank0()), &inner_listener); pair_getters::First(key_value, Rank0()), &inner_listener);
...@@ -2564,13 +2563,13 @@ class KeyMatcherImpl : public MatcherInterface<PairType> { ...@@ -2564,13 +2563,13 @@ class KeyMatcherImpl : public MatcherInterface<PairType> {
} }
// Describes what this matcher does. // Describes what this matcher does.
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "has a key that "; *os << "has a key that ";
inner_matcher_.DescribeTo(os); inner_matcher_.DescribeTo(os);
} }
// Describes what the negation of this matcher does. // Describes what the negation of this matcher does.
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "doesn't have a key that "; *os << "doesn't have a key that ";
inner_matcher_.DescribeTo(os); inner_matcher_.DescribeTo(os);
} }
...@@ -2616,7 +2615,7 @@ class PairMatcherImpl : public MatcherInterface<PairType> { ...@@ -2616,7 +2615,7 @@ class PairMatcherImpl : public MatcherInterface<PairType> {
} }
// Describes what this matcher does. // Describes what this matcher does.
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "has a first field that "; *os << "has a first field that ";
first_matcher_.DescribeTo(os); first_matcher_.DescribeTo(os);
*os << ", and has a second field that "; *os << ", and has a second field that ";
...@@ -2624,7 +2623,7 @@ class PairMatcherImpl : public MatcherInterface<PairType> { ...@@ -2624,7 +2623,7 @@ class PairMatcherImpl : public MatcherInterface<PairType> {
} }
// Describes what the negation of this matcher does. // Describes what the negation of this matcher does.
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "has a first field that "; *os << "has a first field that ";
first_matcher_.DescribeNegationTo(os); first_matcher_.DescribeNegationTo(os);
*os << ", or has a second field that "; *os << ", or has a second field that ";
...@@ -2633,8 +2632,8 @@ class PairMatcherImpl : public MatcherInterface<PairType> { ...@@ -2633,8 +2632,8 @@ class PairMatcherImpl : public MatcherInterface<PairType> {
// Returns true iff 'a_pair.first' matches first_matcher and 'a_pair.second' // Returns true iff 'a_pair.first' matches first_matcher and 'a_pair.second'
// matches second_matcher. // matches second_matcher.
virtual bool MatchAndExplain(PairType a_pair, bool MatchAndExplain(PairType a_pair,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
if (!listener->IsInterested()) { if (!listener->IsInterested()) {
// If the listener is not interested, we don't need to construct the // If the listener is not interested, we don't need to construct the
// explanation. // explanation.
...@@ -2726,7 +2725,7 @@ class ElementsAreMatcherImpl : public MatcherInterface<Container> { ...@@ -2726,7 +2725,7 @@ class ElementsAreMatcherImpl : public MatcherInterface<Container> {
} }
// Describes what this matcher does. // Describes what this matcher does.
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
if (count() == 0) { if (count() == 0) {
*os << "is empty"; *os << "is empty";
} else if (count() == 1) { } else if (count() == 1) {
...@@ -2745,7 +2744,7 @@ class ElementsAreMatcherImpl : public MatcherInterface<Container> { ...@@ -2745,7 +2744,7 @@ class ElementsAreMatcherImpl : public MatcherInterface<Container> {
} }
// Describes what the negation of this matcher does. // Describes what the negation of this matcher does.
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
if (count() == 0) { if (count() == 0) {
*os << "isn't empty"; *os << "isn't empty";
return; return;
...@@ -2761,8 +2760,8 @@ class ElementsAreMatcherImpl : public MatcherInterface<Container> { ...@@ -2761,8 +2760,8 @@ class ElementsAreMatcherImpl : public MatcherInterface<Container> {
} }
} }
virtual bool MatchAndExplain(Container container, bool MatchAndExplain(Container container,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
// To work with stream-like "containers", we must only walk // To work with stream-like "containers", we must only walk
// through the elements in one pass. // through the elements in one pass.
...@@ -2982,17 +2981,17 @@ class UnorderedElementsAreMatcherImpl ...@@ -2982,17 +2981,17 @@ class UnorderedElementsAreMatcherImpl
} }
// Describes what this matcher does. // Describes what this matcher does.
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
return UnorderedElementsAreMatcherImplBase::DescribeToImpl(os); return UnorderedElementsAreMatcherImplBase::DescribeToImpl(os);
} }
// Describes what the negation of this matcher does. // Describes what the negation of this matcher does.
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
return UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(os); return UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(os);
} }
virtual bool MatchAndExplain(Container container, bool MatchAndExplain(Container container,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
StlContainerReference stl_container = View::ConstReference(container); StlContainerReference stl_container = View::ConstReference(container);
::std::vector<std::string> element_printouts; ::std::vector<std::string> element_printouts;
MatchMatrix matrix = MatchMatrix matrix =
...@@ -3205,14 +3204,14 @@ class BoundSecondMatcher { ...@@ -3205,14 +3204,14 @@ class BoundSecondMatcher {
: mono_tuple2_matcher_(SafeMatcherCast<const ArgTuple&>(tm)), : mono_tuple2_matcher_(SafeMatcherCast<const ArgTuple&>(tm)),
second_value_(second) {} second_value_(second) {}
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "and "; *os << "and ";
UniversalPrint(second_value_, os); UniversalPrint(second_value_, os);
*os << " "; *os << " ";
mono_tuple2_matcher_.DescribeTo(os); mono_tuple2_matcher_.DescribeTo(os);
} }
virtual bool MatchAndExplain(T x, MatchResultListener* listener) const { bool MatchAndExplain(T x, MatchResultListener* listener) const override {
return mono_tuple2_matcher_.MatchAndExplain(ArgTuple(x, second_value_), return mono_tuple2_matcher_.MatchAndExplain(ArgTuple(x, second_value_),
listener); listener);
} }
...@@ -3267,18 +3266,18 @@ class OptionalMatcher { ...@@ -3267,18 +3266,18 @@ class OptionalMatcher {
explicit Impl(const ValueMatcher& value_matcher) explicit Impl(const ValueMatcher& value_matcher)
: value_matcher_(MatcherCast<ValueType>(value_matcher)) {} : value_matcher_(MatcherCast<ValueType>(value_matcher)) {}
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "value "; *os << "value ";
value_matcher_.DescribeTo(os); value_matcher_.DescribeTo(os);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << "value "; *os << "value ";
value_matcher_.DescribeNegationTo(os); value_matcher_.DescribeNegationTo(os);
} }
virtual bool MatchAndExplain(Optional optional, bool MatchAndExplain(Optional optional,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
if (!optional) { if (!optional) {
*listener << "which is not engaged"; *listener << "which is not engaged";
return false; return false;
......
...@@ -903,7 +903,7 @@ class TypedExpectation : public ExpectationBase { ...@@ -903,7 +903,7 @@ class TypedExpectation : public ExpectationBase {
extra_matcher_(A<const ArgumentTuple&>()), extra_matcher_(A<const ArgumentTuple&>()),
repeated_action_(DoDefault()) {} repeated_action_(DoDefault()) {}
virtual ~TypedExpectation() { ~TypedExpectation() override {
// Check the validity of the action count if it hasn't been done // Check the validity of the action count if it hasn't been done
// yet (for example, if the expectation was never used). // yet (for example, if the expectation was never used).
CheckActionCountIfNotDone(); CheckActionCountIfNotDone();
...@@ -1069,7 +1069,7 @@ class TypedExpectation : public ExpectationBase { ...@@ -1069,7 +1069,7 @@ class TypedExpectation : public ExpectationBase {
// If this mock method has an extra matcher (i.e. .With(matcher)), // If this mock method has an extra matcher (i.e. .With(matcher)),
// describes it to the ostream. // describes it to the ostream.
virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) { void MaybeDescribeExtraMatcherTo(::std::ostream* os) override {
if (extra_matcher_specified_) { if (extra_matcher_specified_) {
*os << " Expected args: "; *os << " Expected args: ";
extra_matcher_.DescribeTo(os); extra_matcher_.DescribeTo(os);
...@@ -1083,9 +1083,7 @@ class TypedExpectation : public ExpectationBase { ...@@ -1083,9 +1083,7 @@ class TypedExpectation : public ExpectationBase {
// Returns an Expectation object that references and co-owns this // Returns an Expectation object that references and co-owns this
// expectation. // expectation.
virtual Expectation GetHandle() { Expectation GetHandle() override { return owner_->GetHandleOf(this); }
return owner_->GetHandleOf(this);
}
// The following methods will be called only after the EXPECT_CALL() // The following methods will be called only after the EXPECT_CALL()
// statement finishes and when the current thread holds // statement finishes and when the current thread holds
...@@ -1387,7 +1385,7 @@ class ActionResultHolder : public UntypedActionResultHolderBase { ...@@ -1387,7 +1385,7 @@ class ActionResultHolder : public UntypedActionResultHolderBase {
} }
// Prints the held value as an action's result to os. // Prints the held value as an action's result to os.
virtual void PrintAsActionResult(::std::ostream* os) const { void PrintAsActionResult(::std::ostream* os) const override {
*os << "\n Returns: "; *os << "\n Returns: ";
// T may be a reference type, so we don't use UniversalPrint(). // T may be a reference type, so we don't use UniversalPrint().
UniversalPrinter<T>::Print(result_.Peek(), os); UniversalPrinter<T>::Print(result_.Peek(), os);
...@@ -1431,7 +1429,7 @@ class ActionResultHolder<void> : public UntypedActionResultHolderBase { ...@@ -1431,7 +1429,7 @@ class ActionResultHolder<void> : public UntypedActionResultHolderBase {
public: public:
void Unwrap() { } void Unwrap() { }
virtual void PrintAsActionResult(::std::ostream* /* os */) const {} void PrintAsActionResult(::std::ostream* /* os */) const override {}
// Performs the given mock function's default action and returns ownership // Performs the given mock function's default action and returns ownership
// of an empty ActionResultHolder*. // of an empty ActionResultHolder*.
...@@ -1490,8 +1488,7 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase { ...@@ -1490,8 +1488,7 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
// The destructor verifies that all expectations on this mock // The destructor verifies that all expectations on this mock
// function have been satisfied. If not, it will report Google Test // function have been satisfied. If not, it will report Google Test
// non-fatal failures for the violations. // non-fatal failures for the violations.
virtual ~FunctionMocker() ~FunctionMocker() override GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
MutexLock l(&g_gmock_mutex); MutexLock l(&g_gmock_mutex);
VerifyAndClearExpectationsLocked(); VerifyAndClearExpectationsLocked();
Mock::UnregisterLocked(this); Mock::UnregisterLocked(this);
...@@ -1547,9 +1544,9 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase { ...@@ -1547,9 +1544,9 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
// the error message to describe the call in the case the default // the error message to describe the call in the case the default
// action fails. The caller is responsible for deleting the result. // action fails. The caller is responsible for deleting the result.
// L = * // L = *
virtual UntypedActionResultHolderBase* UntypedPerformDefaultAction( UntypedActionResultHolderBase* UntypedPerformDefaultAction(
void* untyped_args, // must point to an ArgumentTuple void* untyped_args, // must point to an ArgumentTuple
const std::string& call_description) const { const std::string& call_description) const override {
ArgumentTuple* args = static_cast<ArgumentTuple*>(untyped_args); ArgumentTuple* args = static_cast<ArgumentTuple*>(untyped_args);
return ResultHolder::PerformDefaultAction(this, std::move(*args), return ResultHolder::PerformDefaultAction(this, std::move(*args),
call_description); call_description);
...@@ -1559,8 +1556,8 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase { ...@@ -1559,8 +1556,8 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
// the action's result. The caller is responsible for deleting the // the action's result. The caller is responsible for deleting the
// result. // result.
// L = * // L = *
virtual UntypedActionResultHolderBase* UntypedPerformAction( UntypedActionResultHolderBase* UntypedPerformAction(
const void* untyped_action, void* untyped_args) const { const void* untyped_action, void* untyped_args) const override {
// Make a copy of the action before performing it, in case the // Make a copy of the action before performing it, in case the
// action deletes the mock object (and thus deletes itself). // action deletes the mock object (and thus deletes itself).
const Action<F> action = *static_cast<const Action<F>*>(untyped_action); const Action<F> action = *static_cast<const Action<F>*>(untyped_action);
...@@ -1570,7 +1567,7 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase { ...@@ -1570,7 +1567,7 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
// Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked(): // Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked():
// clears the ON_CALL()s set on this mock function. // clears the ON_CALL()s set on this mock function.
virtual void ClearDefaultActionsLocked() void ClearDefaultActionsLocked() override
GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
g_gmock_mutex.AssertHeld(); g_gmock_mutex.AssertHeld();
...@@ -1674,9 +1671,8 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase { ...@@ -1674,9 +1671,8 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
// Writes a message that the call is uninteresting (i.e. neither // Writes a message that the call is uninteresting (i.e. neither
// explicitly expected nor explicitly unexpected) to the given // explicitly expected nor explicitly unexpected) to the given
// ostream. // ostream.
virtual void UntypedDescribeUninterestingCall( void UntypedDescribeUninterestingCall(const void* untyped_args,
const void* untyped_args, ::std::ostream* os) const override
::std::ostream* os) const
GTEST_LOCK_EXCLUDED_(g_gmock_mutex) { GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
const ArgumentTuple& args = const ArgumentTuple& args =
*static_cast<const ArgumentTuple*>(untyped_args); *static_cast<const ArgumentTuple*>(untyped_args);
...@@ -1702,10 +1698,9 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase { ...@@ -1702,10 +1698,9 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
// section. The reason is that we have no control on what the // section. The reason is that we have no control on what the
// action does (it can invoke an arbitrary user function or even a // action does (it can invoke an arbitrary user function or even a
// mock function) and excessive locking could cause a dead lock. // mock function) and excessive locking could cause a dead lock.
virtual const ExpectationBase* UntypedFindMatchingExpectation( const ExpectationBase* UntypedFindMatchingExpectation(
const void* untyped_args, const void* untyped_args, const void** untyped_action, bool* is_excessive,
const void** untyped_action, bool* is_excessive, ::std::ostream* what, ::std::ostream* why) override
::std::ostream* what, ::std::ostream* why)
GTEST_LOCK_EXCLUDED_(g_gmock_mutex) { GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
const ArgumentTuple& args = const ArgumentTuple& args =
*static_cast<const ArgumentTuple*>(untyped_args); *static_cast<const ArgumentTuple*>(untyped_args);
...@@ -1728,8 +1723,8 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase { ...@@ -1728,8 +1723,8 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
} }
// Prints the given function arguments to the ostream. // Prints the given function arguments to the ostream.
virtual void UntypedPrintArgs(const void* untyped_args, void UntypedPrintArgs(const void* untyped_args,
::std::ostream* os) const { ::std::ostream* os) const override {
const ArgumentTuple& args = const ArgumentTuple& args =
*static_cast<const ArgumentTuple*>(untyped_args); *static_cast<const ArgumentTuple*>(untyped_args);
UniversalPrint(args, os); UniversalPrint(args, os);
......
...@@ -70,18 +70,18 @@ class BetweenCardinalityImpl : public CardinalityInterface { ...@@ -70,18 +70,18 @@ class BetweenCardinalityImpl : public CardinalityInterface {
// Conservative estimate on the lower/upper bound of the number of // Conservative estimate on the lower/upper bound of the number of
// calls allowed. // calls allowed.
virtual int ConservativeLowerBound() const { return min_; } int ConservativeLowerBound() const override { return min_; }
virtual int ConservativeUpperBound() const { return max_; } int ConservativeUpperBound() const override { return max_; }
virtual bool IsSatisfiedByCallCount(int call_count) const { bool IsSatisfiedByCallCount(int call_count) const override {
return min_ <= call_count && call_count <= max_; return min_ <= call_count && call_count <= max_;
} }
virtual bool IsSaturatedByCallCount(int call_count) const { bool IsSaturatedByCallCount(int call_count) const override {
return call_count >= max_; return call_count >= max_;
} }
virtual void DescribeTo(::std::ostream* os) const; void DescribeTo(::std::ostream* os) const override;
private: private:
const int min_; const int min_;
......
...@@ -93,8 +93,8 @@ GTEST_API_ std::string ConvertIdentifierNameToWords(const char* id_name) { ...@@ -93,8 +93,8 @@ GTEST_API_ std::string ConvertIdentifierNameToWords(const char* id_name) {
// use Google Mock with a testing framework other than Google Test. // use Google Mock with a testing framework other than Google Test.
class GoogleTestFailureReporter : public FailureReporterInterface { class GoogleTestFailureReporter : public FailureReporterInterface {
public: public:
virtual void ReportFailure(FailureType type, const char* file, int line, void ReportFailure(FailureType type, const char* file, int line,
const std::string& message) { const std::string& message) override {
AssertHelper(type == kFatal ? AssertHelper(type == kFatal ?
TestPartResult::kFatalFailure : TestPartResult::kFatalFailure :
TestPartResult::kNonFatalFailure, TestPartResult::kNonFatalFailure,
......
...@@ -379,7 +379,7 @@ typedef int MyGlobalFunction(bool, int); ...@@ -379,7 +379,7 @@ typedef int MyGlobalFunction(bool, int);
class MyActionImpl : public ActionInterface<MyGlobalFunction> { class MyActionImpl : public ActionInterface<MyGlobalFunction> {
public: public:
virtual int Perform(const std::tuple<bool, int>& args) { int Perform(const std::tuple<bool, int>& args) override {
return std::get<0>(args) ? std::get<1>(args) : 0; return std::get<0>(args) ? std::get<1>(args) : 0;
} }
}; };
...@@ -443,7 +443,7 @@ TEST(ActionTest, IsCopyable) { ...@@ -443,7 +443,7 @@ TEST(ActionTest, IsCopyable) {
class IsNotZero : public ActionInterface<bool(int)> { // NOLINT class IsNotZero : public ActionInterface<bool(int)> { // NOLINT
public: public:
virtual bool Perform(const std::tuple<int>& arg) { bool Perform(const std::tuple<int>& arg) override {
return std::get<0>(arg) != 0; return std::get<0>(arg) != 0;
} }
}; };
...@@ -1087,7 +1087,7 @@ TEST(WithArgsTest, TenArgs) { ...@@ -1087,7 +1087,7 @@ TEST(WithArgsTest, TenArgs) {
// Tests using WithArgs with an action that is not Invoke(). // Tests using WithArgs with an action that is not Invoke().
class SubtractAction : public ActionInterface<int(int, int)> { class SubtractAction : public ActionInterface<int(int, int)> {
public: public:
virtual int Perform(const std::tuple<int, int>& args) { int Perform(const std::tuple<int, int>& args) override {
return std::get<0>(args) - std::get<1>(args); return std::get<0>(args) - std::get<1>(args);
} }
}; };
...@@ -1155,8 +1155,8 @@ TEST(WithArgsTest, InnerActionWithConversion) { ...@@ -1155,8 +1155,8 @@ TEST(WithArgsTest, InnerActionWithConversion) {
class SetErrnoAndReturnTest : public testing::Test { class SetErrnoAndReturnTest : public testing::Test {
protected: protected:
virtual void SetUp() { errno = 0; } void SetUp() override { errno = 0; }
virtual void TearDown() { errno = 0; } void TearDown() override { errno = 0; }
}; };
TEST_F(SetErrnoAndReturnTest, Int) { TEST_F(SetErrnoAndReturnTest, Int) {
......
...@@ -396,17 +396,17 @@ TEST(ExactlyTest, HasCorrectBounds) { ...@@ -396,17 +396,17 @@ TEST(ExactlyTest, HasCorrectBounds) {
class EvenCardinality : public CardinalityInterface { class EvenCardinality : public CardinalityInterface {
public: public:
// Returns true iff call_count calls will satisfy this cardinality. // Returns true iff call_count calls will satisfy this cardinality.
virtual bool IsSatisfiedByCallCount(int call_count) const { bool IsSatisfiedByCallCount(int call_count) const override {
return (call_count % 2 == 0); return (call_count % 2 == 0);
} }
// Returns true iff call_count calls will saturate this cardinality. // Returns true iff call_count calls will saturate this cardinality.
virtual bool IsSaturatedByCallCount(int /* call_count */) const { bool IsSaturatedByCallCount(int /* call_count */) const override {
return false; return false;
} }
// Describes self to an ostream. // Describes self to an ostream.
virtual void DescribeTo(::std::ostream* ss) const { void DescribeTo(::std::ostream* ss) const override {
*ss << "called even number of times"; *ss << "called even number of times";
} }
}; };
......
...@@ -117,12 +117,11 @@ class GreaterThanMatcher : public MatcherInterface<int> { ...@@ -117,12 +117,11 @@ class GreaterThanMatcher : public MatcherInterface<int> {
public: public:
explicit GreaterThanMatcher(int rhs) : rhs_(rhs) {} explicit GreaterThanMatcher(int rhs) : rhs_(rhs) {}
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "is greater than " << rhs_; *os << "is greater than " << rhs_;
} }
virtual bool MatchAndExplain(int lhs, bool MatchAndExplain(int lhs, MatchResultListener* listener) const override {
MatchResultListener* listener) const {
const int diff = lhs - rhs_; const int diff = lhs - rhs_;
if (diff > 0) { if (diff > 0) {
*listener << "which is " << diff << " more than " << rhs_; *listener << "which is " << diff << " more than " << rhs_;
......
...@@ -379,11 +379,9 @@ TEST(ExpectTest, FailsNonfatallyOnFalse) { ...@@ -379,11 +379,9 @@ TEST(ExpectTest, FailsNonfatallyOnFalse) {
class LogIsVisibleTest : public ::testing::Test { class LogIsVisibleTest : public ::testing::Test {
protected: protected:
virtual void SetUp() { void SetUp() override { original_verbose_ = GMOCK_FLAG(verbose); }
original_verbose_ = GMOCK_FLAG(verbose);
}
virtual void TearDown() { GMOCK_FLAG(verbose) = original_verbose_; } void TearDown() override { GMOCK_FLAG(verbose) = original_verbose_; }
std::string original_verbose_; std::string original_verbose_;
}; };
...@@ -442,11 +440,11 @@ TEST(LogTest, NoStackTraceWhenStackFramesToSkipIsNegative) { ...@@ -442,11 +440,11 @@ TEST(LogTest, NoStackTraceWhenStackFramesToSkipIsNegative) {
} }
struct MockStackTraceGetter : testing::internal::OsStackTraceGetterInterface { struct MockStackTraceGetter : testing::internal::OsStackTraceGetterInterface {
virtual std::string CurrentStackTrace(int max_depth, int skip_count) { std::string CurrentStackTrace(int max_depth, int skip_count) override {
return (testing::Message() << max_depth << "::" << skip_count << "\n") return (testing::Message() << max_depth << "::" << skip_count << "\n")
.GetString(); .GetString();
} }
virtual void UponLeavingGTest() {} void UponLeavingGTest() override {}
}; };
// Tests that in opt mode, a positive stack_frames_to_skip argument is // Tests that in opt mode, a positive stack_frames_to_skip argument is
......
...@@ -162,12 +162,9 @@ class GreaterThanMatcher : public MatcherInterface<int> { ...@@ -162,12 +162,9 @@ class GreaterThanMatcher : public MatcherInterface<int> {
public: public:
explicit GreaterThanMatcher(int rhs) : rhs_(rhs) {} explicit GreaterThanMatcher(int rhs) : rhs_(rhs) {}
virtual void DescribeTo(ostream* os) const { void DescribeTo(ostream* os) const override { *os << "is > " << rhs_; }
*os << "is > " << rhs_;
}
virtual bool MatchAndExplain(int lhs, bool MatchAndExplain(int lhs, MatchResultListener* listener) const override {
MatchResultListener* listener) const {
const int diff = lhs - rhs_; const int diff = lhs - rhs_;
if (diff > 0) { if (diff > 0) {
*listener << "which is " << diff << " more than " << rhs_; *listener << "which is " << diff << " more than " << rhs_;
...@@ -257,14 +254,12 @@ TEST(MatchResultListenerTest, IsInterestedWorks) { ...@@ -257,14 +254,12 @@ TEST(MatchResultListenerTest, IsInterestedWorks) {
// change. // change.
class EvenMatcherImpl : public MatcherInterface<int> { class EvenMatcherImpl : public MatcherInterface<int> {
public: public:
virtual bool MatchAndExplain(int x, bool MatchAndExplain(int x,
MatchResultListener* /* listener */) const { MatchResultListener* /* listener */) const override {
return x % 2 == 0; return x % 2 == 0;
} }
virtual void DescribeTo(ostream* os) const { void DescribeTo(ostream* os) const override { *os << "is an even number"; }
*os << "is an even number";
}
// We deliberately don't define DescribeNegationTo() and // We deliberately don't define DescribeNegationTo() and
// ExplainMatchResultTo() here, to make sure the definition of these // ExplainMatchResultTo() here, to make sure the definition of these
...@@ -280,7 +275,7 @@ TEST(MatcherInterfaceTest, CanBeImplementedUsingPublishedAPI) { ...@@ -280,7 +275,7 @@ TEST(MatcherInterfaceTest, CanBeImplementedUsingPublishedAPI) {
class NewEvenMatcherImpl : public MatcherInterface<int> { class NewEvenMatcherImpl : public MatcherInterface<int> {
public: public:
virtual bool MatchAndExplain(int x, MatchResultListener* listener) const { bool MatchAndExplain(int x, MatchResultListener* listener) const override {
const bool match = x % 2 == 0; const bool match = x % 2 == 0;
// Verifies that we can stream to a listener directly. // Verifies that we can stream to a listener directly.
*listener << "value % " << 2; *listener << "value % " << 2;
...@@ -292,9 +287,7 @@ class NewEvenMatcherImpl : public MatcherInterface<int> { ...@@ -292,9 +287,7 @@ class NewEvenMatcherImpl : public MatcherInterface<int> {
return match; return match;
} }
virtual void DescribeTo(ostream* os) const { void DescribeTo(ostream* os) const override { *os << "is an even number"; }
*os << "is an even number";
}
}; };
TEST(MatcherInterfaceTest, CanBeImplementedUsingNewAPI) { TEST(MatcherInterfaceTest, CanBeImplementedUsingNewAPI) {
......
...@@ -1952,17 +1952,17 @@ TEST(DeletingMockEarlyTest, Failure2) { ...@@ -1952,17 +1952,17 @@ TEST(DeletingMockEarlyTest, Failure2) {
class EvenNumberCardinality : public CardinalityInterface { class EvenNumberCardinality : public CardinalityInterface {
public: public:
// Returns true iff call_count calls will satisfy this cardinality. // Returns true iff call_count calls will satisfy this cardinality.
virtual bool IsSatisfiedByCallCount(int call_count) const { bool IsSatisfiedByCallCount(int call_count) const override {
return call_count % 2 == 0; return call_count % 2 == 0;
} }
// Returns true iff call_count calls will saturate this cardinality. // Returns true iff call_count calls will saturate this cardinality.
virtual bool IsSaturatedByCallCount(int /* call_count */) const { bool IsSaturatedByCallCount(int /* call_count */) const override {
return false; return false;
} }
// Describes self to an ostream. // Describes self to an ostream.
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << "called even number of times"; *os << "called even number of times";
} }
}; };
...@@ -2023,7 +2023,9 @@ class VerboseFlagPreservingFixture : public testing::Test { ...@@ -2023,7 +2023,9 @@ class VerboseFlagPreservingFixture : public testing::Test {
VerboseFlagPreservingFixture() VerboseFlagPreservingFixture()
: saved_verbose_flag_(GMOCK_FLAG(verbose)) {} : saved_verbose_flag_(GMOCK_FLAG(verbose)) {}
~VerboseFlagPreservingFixture() { GMOCK_FLAG(verbose) = saved_verbose_flag_; } ~VerboseFlagPreservingFixture() override {
GMOCK_FLAG(verbose) = saved_verbose_flag_;
}
private: private:
const std::string saved_verbose_flag_; const std::string saved_verbose_flag_;
......
...@@ -183,16 +183,16 @@ class MatcherInterfaceAdapter : public MatcherInterface<const T&> { ...@@ -183,16 +183,16 @@ class MatcherInterfaceAdapter : public MatcherInterface<const T&> {
public: public:
explicit MatcherInterfaceAdapter(const MatcherInterface<T>* impl) explicit MatcherInterfaceAdapter(const MatcherInterface<T>* impl)
: impl_(impl) {} : impl_(impl) {}
virtual ~MatcherInterfaceAdapter() { delete impl_; } ~MatcherInterfaceAdapter() override { delete impl_; }
virtual void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); } void DescribeTo(::std::ostream* os) const override { impl_->DescribeTo(os); }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
impl_->DescribeNegationTo(os); impl_->DescribeNegationTo(os);
} }
virtual bool MatchAndExplain(const T& x, bool MatchAndExplain(const T& x,
MatchResultListener* listener) const { MatchResultListener* listener) const override {
return impl_->MatchAndExplain(x, listener); return impl_->MatchAndExplain(x, listener);
} }
...@@ -614,18 +614,19 @@ class ComparisonBase { ...@@ -614,18 +614,19 @@ class ComparisonBase {
class Impl : public MatcherInterface<Lhs> { class Impl : public MatcherInterface<Lhs> {
public: public:
explicit Impl(const Rhs& rhs) : rhs_(rhs) {} explicit Impl(const Rhs& rhs) : rhs_(rhs) {}
virtual bool MatchAndExplain( bool MatchAndExplain(Lhs lhs,
Lhs lhs, MatchResultListener* /* listener */) const { MatchResultListener* /* listener */) const override {
return Op()(lhs, rhs_); return Op()(lhs, rhs_);
} }
virtual void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const override {
*os << D::Desc() << " "; *os << D::Desc() << " ";
UniversalPrint(rhs_, os); UniversalPrint(rhs_, os);
} }
virtual void DescribeNegationTo(::std::ostream* os) const { void DescribeNegationTo(::std::ostream* os) const override {
*os << D::NegatedDesc() << " "; *os << D::NegatedDesc() << " ";
UniversalPrint(rhs_, os); UniversalPrint(rhs_, os);
} }
private: private:
Rhs rhs_; Rhs rhs_;
GTEST_DISALLOW_ASSIGN_(Impl); GTEST_DISALLOW_ASSIGN_(Impl);
......
...@@ -72,14 +72,15 @@ class GTEST_API_ ScopedFakeTestPartResultReporter ...@@ -72,14 +72,15 @@ class GTEST_API_ ScopedFakeTestPartResultReporter
TestPartResultArray* result); TestPartResultArray* result);
// The d'tor restores the previous test part result reporter. // The d'tor restores the previous test part result reporter.
virtual ~ScopedFakeTestPartResultReporter(); ~ScopedFakeTestPartResultReporter() override;
// Appends the TestPartResult object to the TestPartResultArray // Appends the TestPartResult object to the TestPartResultArray
// received in the constructor. // received in the constructor.
// //
// This method is from the TestPartResultReporterInterface // This method is from the TestPartResultReporterInterface
// interface. // interface.
virtual void ReportTestPartResult(const TestPartResult& result); void ReportTestPartResult(const TestPartResult& result) override;
private: private:
void Init(); void Init();
......
...@@ -165,8 +165,8 @@ class GTEST_API_ HasNewFatalFailureHelper ...@@ -165,8 +165,8 @@ class GTEST_API_ HasNewFatalFailureHelper
: public TestPartResultReporterInterface { : public TestPartResultReporterInterface {
public: public:
HasNewFatalFailureHelper(); HasNewFatalFailureHelper();
virtual ~HasNewFatalFailureHelper(); ~HasNewFatalFailureHelper() override;
virtual void ReportTestPartResult(const TestPartResult& result); void ReportTestPartResult(const TestPartResult& result) override;
bool has_new_fatal_failure() const { return has_new_fatal_failure_; } bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
private: private:
bool has_new_fatal_failure_; bool has_new_fatal_failure_;
......
...@@ -1111,21 +1111,21 @@ class TestEventListener { ...@@ -1111,21 +1111,21 @@ class TestEventListener {
// above. // above.
class EmptyTestEventListener : public TestEventListener { class EmptyTestEventListener : public TestEventListener {
public: public:
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} void OnTestProgramStart(const UnitTest& /*unit_test*/) override {}
virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, void OnTestIterationStart(const UnitTest& /*unit_test*/,
int /*iteration*/) {} int /*iteration*/) override {}
virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) override {}
virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {}
virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} void OnTestCaseStart(const TestCase& /*test_case*/) override {}
virtual void OnTestStart(const TestInfo& /*test_info*/) {} void OnTestStart(const TestInfo& /*test_info*/) override {}
virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} void OnTestPartResult(const TestPartResult& /*test_part_result*/) override {}
virtual void OnTestEnd(const TestInfo& /*test_info*/) {} void OnTestEnd(const TestInfo& /*test_info*/) override {}
virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} void OnTestCaseEnd(const TestCase& /*test_case*/) override {}
virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) override {}
virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {}
virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, void OnTestIterationEnd(const UnitTest& /*unit_test*/,
int /*iteration*/) {} int /*iteration*/) override {}
virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {} void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {}
}; };
// TestEventListeners lets users add listeners to track events in Google Test. // TestEventListeners lets users add listeners to track events in Google Test.
......
...@@ -154,9 +154,8 @@ class DeathTestFactory { ...@@ -154,9 +154,8 @@ class DeathTestFactory {
// A concrete DeathTestFactory implementation for normal use. // A concrete DeathTestFactory implementation for normal use.
class DefaultDeathTestFactory : public DeathTestFactory { class DefaultDeathTestFactory : public DeathTestFactory {
public: public:
virtual bool Create(const char* statement, bool Create(const char* statement, Matcher<const std::string&> matcher,
Matcher<const std::string&> matcher, const char* file, const char* file, int line, DeathTest** test) override;
int line, DeathTest** test);
}; };
// Returns true if exit_status describes a process that was terminated // Returns true if exit_status describes a process that was terminated
......
...@@ -469,7 +469,7 @@ class TestFactoryBase { ...@@ -469,7 +469,7 @@ class TestFactoryBase {
template <class TestClass> template <class TestClass>
class TestFactoryImpl : public TestFactoryBase { class TestFactoryImpl : public TestFactoryBase {
public: public:
virtual Test* CreateTest() { return new TestClass; } Test* CreateTest() override { return new TestClass; }
}; };
#if GTEST_OS_WINDOWS #if GTEST_OS_WINDOWS
......
...@@ -44,13 +44,13 @@ ...@@ -44,13 +44,13 @@
// GOOGLETEST_CM0001 DO NOT DELETE // GOOGLETEST_CM0001 DO NOT DELETE
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ #include <assert.h>
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
#include <cassert>
#include <memory> #include <memory>
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
#include "gtest/internal/gtest-param-util.h" #include "gtest/internal/gtest-param-util.h"
#include "gtest/internal/gtest-port.h" #include "gtest/internal/gtest-port.h"
...@@ -71,12 +71,12 @@ class CartesianProductGenerator2 ...@@ -71,12 +71,12 @@ class CartesianProductGenerator2
CartesianProductGenerator2(const ParamGenerator<T1>& g1, CartesianProductGenerator2(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2) const ParamGenerator<T2>& g2)
: g1_(g1), g2_(g2) {} : g1_(g1), g2_(g2) {}
virtual ~CartesianProductGenerator2() {} ~CartesianProductGenerator2() override {}
virtual ParamIteratorInterface<ParamType>* Begin() const { ParamIteratorInterface<ParamType>* Begin() const override {
return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin()); return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
} }
virtual ParamIteratorInterface<ParamType>* End() const { ParamIteratorInterface<ParamType>* End() const override {
return new Iterator(this, g1_, g1_.end(), g2_, g2_.end()); return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
} }
...@@ -93,14 +93,14 @@ class CartesianProductGenerator2 ...@@ -93,14 +93,14 @@ class CartesianProductGenerator2
begin2_(g2.begin()), end2_(g2.end()), current2_(current2) { begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ~Iterator() {} ~Iterator() override {}
virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
return base_; return base_;
} }
// Advance should not be called on beyond-of-range iterators // Advance should not be called on beyond-of-range iterators
// so no component iterators must be beyond end of range, either. // so no component iterators must be beyond end of range, either.
virtual void Advance() { void Advance() override {
assert(!AtEnd()); assert(!AtEnd());
++current2_; ++current2_;
if (current2_ == end2_) { if (current2_ == end2_) {
...@@ -109,11 +109,11 @@ class CartesianProductGenerator2 ...@@ -109,11 +109,11 @@ class CartesianProductGenerator2
} }
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ParamIteratorInterface<ParamType>* Clone() const { ParamIteratorInterface<ParamType>* Clone() const override {
return new Iterator(*this); return new Iterator(*this);
} }
virtual const ParamType* Current() const { return current_value_.get(); } const ParamType* Current() const override { return current_value_.get(); }
virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { bool Equals(const ParamIteratorInterface<ParamType>& other) const override {
// Having the same base generator guarantees that the other // Having the same base generator guarantees that the other
// iterator is of the same type and we can downcast. // iterator is of the same type and we can downcast.
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
...@@ -186,13 +186,13 @@ class CartesianProductGenerator3 ...@@ -186,13 +186,13 @@ class CartesianProductGenerator3
CartesianProductGenerator3(const ParamGenerator<T1>& g1, CartesianProductGenerator3(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3) const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
: g1_(g1), g2_(g2), g3_(g3) {} : g1_(g1), g2_(g2), g3_(g3) {}
virtual ~CartesianProductGenerator3() {} ~CartesianProductGenerator3() override {}
virtual ParamIteratorInterface<ParamType>* Begin() const { ParamIteratorInterface<ParamType>* Begin() const override {
return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
g3_.begin()); g3_.begin());
} }
virtual ParamIteratorInterface<ParamType>* End() const { ParamIteratorInterface<ParamType>* End() const override {
return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end()); return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
} }
...@@ -212,14 +212,14 @@ class CartesianProductGenerator3 ...@@ -212,14 +212,14 @@ class CartesianProductGenerator3
begin3_(g3.begin()), end3_(g3.end()), current3_(current3) { begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ~Iterator() {} ~Iterator() override {}
virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
return base_; return base_;
} }
// Advance should not be called on beyond-of-range iterators // Advance should not be called on beyond-of-range iterators
// so no component iterators must be beyond end of range, either. // so no component iterators must be beyond end of range, either.
virtual void Advance() { void Advance() override {
assert(!AtEnd()); assert(!AtEnd());
++current3_; ++current3_;
if (current3_ == end3_) { if (current3_ == end3_) {
...@@ -232,11 +232,11 @@ class CartesianProductGenerator3 ...@@ -232,11 +232,11 @@ class CartesianProductGenerator3
} }
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ParamIteratorInterface<ParamType>* Clone() const { ParamIteratorInterface<ParamType>* Clone() const override {
return new Iterator(*this); return new Iterator(*this);
} }
virtual const ParamType* Current() const { return current_value_.get(); } const ParamType* Current() const override { return current_value_.get(); }
virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { bool Equals(const ParamIteratorInterface<ParamType>& other) const override {
// Having the same base generator guarantees that the other // Having the same base generator guarantees that the other
// iterator is of the same type and we can downcast. // iterator is of the same type and we can downcast.
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
...@@ -319,13 +319,13 @@ class CartesianProductGenerator4 ...@@ -319,13 +319,13 @@ class CartesianProductGenerator4
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3, const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
const ParamGenerator<T4>& g4) const ParamGenerator<T4>& g4)
: g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
virtual ~CartesianProductGenerator4() {} ~CartesianProductGenerator4() override {}
virtual ParamIteratorInterface<ParamType>* Begin() const { ParamIteratorInterface<ParamType>* Begin() const override {
return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
g3_.begin(), g4_, g4_.begin()); g3_.begin(), g4_, g4_.begin());
} }
virtual ParamIteratorInterface<ParamType>* End() const { ParamIteratorInterface<ParamType>* End() const override {
return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
g4_, g4_.end()); g4_, g4_.end());
} }
...@@ -349,14 +349,14 @@ class CartesianProductGenerator4 ...@@ -349,14 +349,14 @@ class CartesianProductGenerator4
begin4_(g4.begin()), end4_(g4.end()), current4_(current4) { begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ~Iterator() {} ~Iterator() override {}
virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
return base_; return base_;
} }
// Advance should not be called on beyond-of-range iterators // Advance should not be called on beyond-of-range iterators
// so no component iterators must be beyond end of range, either. // so no component iterators must be beyond end of range, either.
virtual void Advance() { void Advance() override {
assert(!AtEnd()); assert(!AtEnd());
++current4_; ++current4_;
if (current4_ == end4_) { if (current4_ == end4_) {
...@@ -373,11 +373,11 @@ class CartesianProductGenerator4 ...@@ -373,11 +373,11 @@ class CartesianProductGenerator4
} }
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ParamIteratorInterface<ParamType>* Clone() const { ParamIteratorInterface<ParamType>* Clone() const override {
return new Iterator(*this); return new Iterator(*this);
} }
virtual const ParamType* Current() const { return current_value_.get(); } const ParamType* Current() const override { return current_value_.get(); }
virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { bool Equals(const ParamIteratorInterface<ParamType>& other) const override {
// Having the same base generator guarantees that the other // Having the same base generator guarantees that the other
// iterator is of the same type and we can downcast. // iterator is of the same type and we can downcast.
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
...@@ -470,13 +470,13 @@ class CartesianProductGenerator5 ...@@ -470,13 +470,13 @@ class CartesianProductGenerator5
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3, const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5) const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
virtual ~CartesianProductGenerator5() {} ~CartesianProductGenerator5() override {}
virtual ParamIteratorInterface<ParamType>* Begin() const { ParamIteratorInterface<ParamType>* Begin() const override {
return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin()); g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
} }
virtual ParamIteratorInterface<ParamType>* End() const { ParamIteratorInterface<ParamType>* End() const override {
return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
g4_, g4_.end(), g5_, g5_.end()); g4_, g4_.end(), g5_, g5_.end());
} }
...@@ -503,14 +503,14 @@ class CartesianProductGenerator5 ...@@ -503,14 +503,14 @@ class CartesianProductGenerator5
begin5_(g5.begin()), end5_(g5.end()), current5_(current5) { begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ~Iterator() {} ~Iterator() override {}
virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
return base_; return base_;
} }
// Advance should not be called on beyond-of-range iterators // Advance should not be called on beyond-of-range iterators
// so no component iterators must be beyond end of range, either. // so no component iterators must be beyond end of range, either.
virtual void Advance() { void Advance() override {
assert(!AtEnd()); assert(!AtEnd());
++current5_; ++current5_;
if (current5_ == end5_) { if (current5_ == end5_) {
...@@ -531,11 +531,11 @@ class CartesianProductGenerator5 ...@@ -531,11 +531,11 @@ class CartesianProductGenerator5
} }
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ParamIteratorInterface<ParamType>* Clone() const { ParamIteratorInterface<ParamType>* Clone() const override {
return new Iterator(*this); return new Iterator(*this);
} }
virtual const ParamType* Current() const { return current_value_.get(); } const ParamType* Current() const override { return current_value_.get(); }
virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { bool Equals(const ParamIteratorInterface<ParamType>& other) const override {
// Having the same base generator guarantees that the other // Having the same base generator guarantees that the other
// iterator is of the same type and we can downcast. // iterator is of the same type and we can downcast.
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
...@@ -639,13 +639,13 @@ class CartesianProductGenerator6 ...@@ -639,13 +639,13 @@ class CartesianProductGenerator6
const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5, const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
const ParamGenerator<T6>& g6) const ParamGenerator<T6>& g6)
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
virtual ~CartesianProductGenerator6() {} ~CartesianProductGenerator6() override {}
virtual ParamIteratorInterface<ParamType>* Begin() const { ParamIteratorInterface<ParamType>* Begin() const override {
return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin()); g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
} }
virtual ParamIteratorInterface<ParamType>* End() const { ParamIteratorInterface<ParamType>* End() const override {
return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end()); g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
} }
...@@ -675,14 +675,14 @@ class CartesianProductGenerator6 ...@@ -675,14 +675,14 @@ class CartesianProductGenerator6
begin6_(g6.begin()), end6_(g6.end()), current6_(current6) { begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ~Iterator() {} ~Iterator() override {}
virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
return base_; return base_;
} }
// Advance should not be called on beyond-of-range iterators // Advance should not be called on beyond-of-range iterators
// so no component iterators must be beyond end of range, either. // so no component iterators must be beyond end of range, either.
virtual void Advance() { void Advance() override {
assert(!AtEnd()); assert(!AtEnd());
++current6_; ++current6_;
if (current6_ == end6_) { if (current6_ == end6_) {
...@@ -707,11 +707,11 @@ class CartesianProductGenerator6 ...@@ -707,11 +707,11 @@ class CartesianProductGenerator6
} }
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ParamIteratorInterface<ParamType>* Clone() const { ParamIteratorInterface<ParamType>* Clone() const override {
return new Iterator(*this); return new Iterator(*this);
} }
virtual const ParamType* Current() const { return current_value_.get(); } const ParamType* Current() const override { return current_value_.get(); }
virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { bool Equals(const ParamIteratorInterface<ParamType>& other) const override {
// Having the same base generator guarantees that the other // Having the same base generator guarantees that the other
// iterator is of the same type and we can downcast. // iterator is of the same type and we can downcast.
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
...@@ -825,14 +825,14 @@ class CartesianProductGenerator7 ...@@ -825,14 +825,14 @@ class CartesianProductGenerator7
const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5, const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7) const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
virtual ~CartesianProductGenerator7() {} ~CartesianProductGenerator7() override {}
virtual ParamIteratorInterface<ParamType>* Begin() const { ParamIteratorInterface<ParamType>* Begin() const override {
return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
g7_.begin()); g7_.begin());
} }
virtual ParamIteratorInterface<ParamType>* End() const { ParamIteratorInterface<ParamType>* End() const override {
return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end()); g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
} }
...@@ -865,14 +865,14 @@ class CartesianProductGenerator7 ...@@ -865,14 +865,14 @@ class CartesianProductGenerator7
begin7_(g7.begin()), end7_(g7.end()), current7_(current7) { begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ~Iterator() {} ~Iterator() override {}
virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
return base_; return base_;
} }
// Advance should not be called on beyond-of-range iterators // Advance should not be called on beyond-of-range iterators
// so no component iterators must be beyond end of range, either. // so no component iterators must be beyond end of range, either.
virtual void Advance() { void Advance() override {
assert(!AtEnd()); assert(!AtEnd());
++current7_; ++current7_;
if (current7_ == end7_) { if (current7_ == end7_) {
...@@ -901,11 +901,11 @@ class CartesianProductGenerator7 ...@@ -901,11 +901,11 @@ class CartesianProductGenerator7
} }
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ParamIteratorInterface<ParamType>* Clone() const { ParamIteratorInterface<ParamType>* Clone() const override {
return new Iterator(*this); return new Iterator(*this);
} }
virtual const ParamType* Current() const { return current_value_.get(); } const ParamType* Current() const override { return current_value_.get(); }
virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { bool Equals(const ParamIteratorInterface<ParamType>& other) const override {
// Having the same base generator guarantees that the other // Having the same base generator guarantees that the other
// iterator is of the same type and we can downcast. // iterator is of the same type and we can downcast.
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
...@@ -1030,14 +1030,14 @@ class CartesianProductGenerator8 ...@@ -1030,14 +1030,14 @@ class CartesianProductGenerator8
const ParamGenerator<T8>& g8) const ParamGenerator<T8>& g8)
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
g8_(g8) {} g8_(g8) {}
virtual ~CartesianProductGenerator8() {} ~CartesianProductGenerator8() override {}
virtual ParamIteratorInterface<ParamType>* Begin() const { ParamIteratorInterface<ParamType>* Begin() const override {
return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
g7_.begin(), g8_, g8_.begin()); g7_.begin(), g8_, g8_.begin());
} }
virtual ParamIteratorInterface<ParamType>* End() const { ParamIteratorInterface<ParamType>* End() const override {
return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
g8_.end()); g8_.end());
...@@ -1074,14 +1074,14 @@ class CartesianProductGenerator8 ...@@ -1074,14 +1074,14 @@ class CartesianProductGenerator8
begin8_(g8.begin()), end8_(g8.end()), current8_(current8) { begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ~Iterator() {} ~Iterator() override {}
virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
return base_; return base_;
} }
// Advance should not be called on beyond-of-range iterators // Advance should not be called on beyond-of-range iterators
// so no component iterators must be beyond end of range, either. // so no component iterators must be beyond end of range, either.
virtual void Advance() { void Advance() override {
assert(!AtEnd()); assert(!AtEnd());
++current8_; ++current8_;
if (current8_ == end8_) { if (current8_ == end8_) {
...@@ -1114,11 +1114,11 @@ class CartesianProductGenerator8 ...@@ -1114,11 +1114,11 @@ class CartesianProductGenerator8
} }
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ParamIteratorInterface<ParamType>* Clone() const { ParamIteratorInterface<ParamType>* Clone() const override {
return new Iterator(*this); return new Iterator(*this);
} }
virtual const ParamType* Current() const { return current_value_.get(); } const ParamType* Current() const override { return current_value_.get(); }
virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { bool Equals(const ParamIteratorInterface<ParamType>& other) const override {
// Having the same base generator guarantees that the other // Having the same base generator guarantees that the other
// iterator is of the same type and we can downcast. // iterator is of the same type and we can downcast.
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
...@@ -1252,14 +1252,14 @@ class CartesianProductGenerator9 ...@@ -1252,14 +1252,14 @@ class CartesianProductGenerator9
const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9) const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
g9_(g9) {} g9_(g9) {}
virtual ~CartesianProductGenerator9() {} ~CartesianProductGenerator9() override {}
virtual ParamIteratorInterface<ParamType>* Begin() const { ParamIteratorInterface<ParamType>* Begin() const override {
return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin()); g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
} }
virtual ParamIteratorInterface<ParamType>* End() const { ParamIteratorInterface<ParamType>* End() const override {
return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
g8_.end(), g9_, g9_.end()); g8_.end(), g9_, g9_.end());
...@@ -1299,14 +1299,14 @@ class CartesianProductGenerator9 ...@@ -1299,14 +1299,14 @@ class CartesianProductGenerator9
begin9_(g9.begin()), end9_(g9.end()), current9_(current9) { begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ~Iterator() {} ~Iterator() override {}
virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
return base_; return base_;
} }
// Advance should not be called on beyond-of-range iterators // Advance should not be called on beyond-of-range iterators
// so no component iterators must be beyond end of range, either. // so no component iterators must be beyond end of range, either.
virtual void Advance() { void Advance() override {
assert(!AtEnd()); assert(!AtEnd());
++current9_; ++current9_;
if (current9_ == end9_) { if (current9_ == end9_) {
...@@ -1343,11 +1343,11 @@ class CartesianProductGenerator9 ...@@ -1343,11 +1343,11 @@ class CartesianProductGenerator9
} }
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ParamIteratorInterface<ParamType>* Clone() const { ParamIteratorInterface<ParamType>* Clone() const override {
return new Iterator(*this); return new Iterator(*this);
} }
virtual const ParamType* Current() const { return current_value_.get(); } const ParamType* Current() const override { return current_value_.get(); }
virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { bool Equals(const ParamIteratorInterface<ParamType>& other) const override {
// Having the same base generator guarantees that the other // Having the same base generator guarantees that the other
// iterator is of the same type and we can downcast. // iterator is of the same type and we can downcast.
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
...@@ -1492,14 +1492,14 @@ class CartesianProductGenerator10 ...@@ -1492,14 +1492,14 @@ class CartesianProductGenerator10
const ParamGenerator<T10>& g10) const ParamGenerator<T10>& g10)
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
g9_(g9), g10_(g10) {} g9_(g9), g10_(g10) {}
virtual ~CartesianProductGenerator10() {} ~CartesianProductGenerator10() override {}
virtual ParamIteratorInterface<ParamType>* Begin() const { ParamIteratorInterface<ParamType>* Begin() const override {
return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin()); g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
} }
virtual ParamIteratorInterface<ParamType>* End() const { ParamIteratorInterface<ParamType>* End() const override {
return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
g8_.end(), g9_, g9_.end(), g10_, g10_.end()); g8_.end(), g9_, g9_.end(), g10_, g10_.end());
...@@ -1542,14 +1542,14 @@ class CartesianProductGenerator10 ...@@ -1542,14 +1542,14 @@ class CartesianProductGenerator10
begin10_(g10.begin()), end10_(g10.end()), current10_(current10) { begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ~Iterator() {} ~Iterator() override {}
virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
return base_; return base_;
} }
// Advance should not be called on beyond-of-range iterators // Advance should not be called on beyond-of-range iterators
// so no component iterators must be beyond end of range, either. // so no component iterators must be beyond end of range, either.
virtual void Advance() { void Advance() override {
assert(!AtEnd()); assert(!AtEnd());
++current10_; ++current10_;
if (current10_ == end10_) { if (current10_ == end10_) {
...@@ -1590,11 +1590,11 @@ class CartesianProductGenerator10 ...@@ -1590,11 +1590,11 @@ class CartesianProductGenerator10
} }
ComputeCurrentValue(); ComputeCurrentValue();
} }
virtual ParamIteratorInterface<ParamType>* Clone() const { ParamIteratorInterface<ParamType>* Clone() const override {
return new Iterator(*this); return new Iterator(*this);
} }
virtual const ParamType* Current() const { return current_value_.get(); } const ParamType* Current() const override { return current_value_.get(); }
virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { bool Equals(const ParamIteratorInterface<ParamType>& other) const override {
// Having the same base generator guarantees that the other // Having the same base generator guarantees that the other
// iterator is of the same type and we can downcast. // iterator is of the same type and we can downcast.
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment