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 {
class FixedValueProducer : public ValueProducer {
public:
explicit FixedValueProducer(T value) : value_(value) {}
virtual T Produce() { return value_; }
T Produce() override { return value_; }
private:
const T value_;
......@@ -268,7 +268,7 @@ class DefaultValue {
public:
explicit FactoryValueProducer(FactoryFunction factory)
: factory_(factory) {}
virtual T Produce() { return factory_(); }
T Produce() override { return factory_(); }
private:
const FactoryFunction factory_;
......@@ -472,7 +472,7 @@ class PolymorphicAction {
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);
}
......@@ -518,7 +518,7 @@ class ActionAdaptor : public ActionInterface<F1> {
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);
}
......@@ -609,7 +609,7 @@ class ReturnAction {
: value_before_cast_(*value),
value_(ImplicitCast_<Result>(value_before_cast_)) {}
virtual Result Perform(const ArgumentTuple&) { return value_; }
Result Perform(const ArgumentTuple&) override { return value_; }
private:
GTEST_COMPILE_ASSERT_(!is_reference<Result>::value,
......@@ -633,7 +633,7 @@ class ReturnAction {
explicit Impl(const std::shared_ptr<R>& wrapper)
: performed_(false), wrapper_(wrapper) {}
virtual Result Perform(const ArgumentTuple&) {
Result Perform(const ArgumentTuple&) override {
GTEST_CHECK_(!performed_)
<< "A ByMove() action should only be performed once.";
performed_ = true;
......@@ -712,9 +712,7 @@ class ReturnRefAction {
explicit Impl(T& ref) : ref_(ref) {} // NOLINT
virtual Result Perform(const ArgumentTuple&) {
return ref_;
}
Result Perform(const ArgumentTuple&) override { return ref_; }
private:
T& ref_;
......@@ -761,9 +759,7 @@ class ReturnRefOfCopyAction {
explicit Impl(const T& value) : value_(value) {} // NOLINT
virtual Result Perform(const ArgumentTuple&) {
return value_;
}
Result Perform(const ArgumentTuple&) override { return value_; }
private:
T value_;
......@@ -973,7 +969,7 @@ class IgnoreResultAction {
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.
action_.Perform(args);
}
......@@ -1048,7 +1044,7 @@ class DoBothAction {
Impl(const Action<VoidResult>& action1, const Action<F>& action2)
: action1_(action1), action2_(action2) {}
virtual Result Perform(const ArgumentTuple& args) {
Result Perform(const ArgumentTuple& args) override {
action1_.Perform(args);
return action2_.Perform(args);
}
......
......@@ -181,7 +181,7 @@ class NiceMock : public MockClass {
#endif // GTEST_LANG_CXX11
~NiceMock() {
~NiceMock() { // NOLINT
::testing::Mock::UnregisterCallReaction(
internal::ImplicitCast_<MockClass*>(this));
}
......@@ -299,7 +299,7 @@ class NaggyMock : public MockClass {
#endif // GTEST_LANG_CXX11
~NaggyMock() {
~NaggyMock() { // NOLINT
::testing::Mock::UnregisterCallReaction(
internal::ImplicitCast_<MockClass*>(this));
}
......@@ -417,7 +417,7 @@ class StrictMock : public MockClass {
#endif // GTEST_LANG_CXX11
~StrictMock() {
~StrictMock() { // NOLINT
::testing::Mock::UnregisterCallReaction(
internal::ImplicitCast_<MockClass*>(this));
}
......
......@@ -135,7 +135,7 @@ $range j 1..i
]]
#endif // GTEST_LANG_CXX11
~$clazz() {
~$clazz() { // NOLINT
::testing::Mock::UnregisterCallReaction(
internal::ImplicitCast_<MockClass*>(this));
}
......
This diff is collapsed.
......@@ -903,7 +903,7 @@ class TypedExpectation : public ExpectationBase {
extra_matcher_(A<const ArgumentTuple&>()),
repeated_action_(DoDefault()) {}
virtual ~TypedExpectation() {
~TypedExpectation() override {
// Check the validity of the action count if it hasn't been done
// yet (for example, if the expectation was never used).
CheckActionCountIfNotDone();
......@@ -1069,7 +1069,7 @@ class TypedExpectation : public ExpectationBase {
// If this mock method has an extra matcher (i.e. .With(matcher)),
// describes it to the ostream.
virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) {
void MaybeDescribeExtraMatcherTo(::std::ostream* os) override {
if (extra_matcher_specified_) {
*os << " Expected args: ";
extra_matcher_.DescribeTo(os);
......@@ -1083,9 +1083,7 @@ class TypedExpectation : public ExpectationBase {
// Returns an Expectation object that references and co-owns this
// expectation.
virtual Expectation GetHandle() {
return owner_->GetHandleOf(this);
}
Expectation GetHandle() override { return owner_->GetHandleOf(this); }
// The following methods will be called only after the EXPECT_CALL()
// statement finishes and when the current thread holds
......@@ -1387,7 +1385,7 @@ class ActionResultHolder : public UntypedActionResultHolderBase {
}
// 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: ";
// T may be a reference type, so we don't use UniversalPrint().
UniversalPrinter<T>::Print(result_.Peek(), os);
......@@ -1431,7 +1429,7 @@ class ActionResultHolder<void> : public UntypedActionResultHolderBase {
public:
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
// of an empty ActionResultHolder*.
......@@ -1490,8 +1488,7 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
// The destructor verifies that all expectations on this mock
// function have been satisfied. If not, it will report Google Test
// non-fatal failures for the violations.
virtual ~FunctionMocker()
GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
~FunctionMocker() override GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
MutexLock l(&g_gmock_mutex);
VerifyAndClearExpectationsLocked();
Mock::UnregisterLocked(this);
......@@ -1547,9 +1544,9 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
// the error message to describe the call in the case the default
// action fails. The caller is responsible for deleting the result.
// L = *
virtual UntypedActionResultHolderBase* UntypedPerformDefaultAction(
UntypedActionResultHolderBase* UntypedPerformDefaultAction(
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);
return ResultHolder::PerformDefaultAction(this, std::move(*args),
call_description);
......@@ -1559,8 +1556,8 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
// the action's result. The caller is responsible for deleting the
// result.
// L = *
virtual UntypedActionResultHolderBase* UntypedPerformAction(
const void* untyped_action, void* untyped_args) const {
UntypedActionResultHolderBase* UntypedPerformAction(
const void* untyped_action, void* untyped_args) const override {
// Make a copy of the action before performing it, in case the
// action deletes the mock object (and thus deletes itself).
const Action<F> action = *static_cast<const Action<F>*>(untyped_action);
......@@ -1570,7 +1567,7 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
// Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked():
// clears the ON_CALL()s set on this mock function.
virtual void ClearDefaultActionsLocked()
void ClearDefaultActionsLocked() override
GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
g_gmock_mutex.AssertHeld();
......@@ -1674,10 +1671,9 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
// Writes a message that the call is uninteresting (i.e. neither
// explicitly expected nor explicitly unexpected) to the given
// ostream.
virtual void UntypedDescribeUninterestingCall(
const void* untyped_args,
::std::ostream* os) const
GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
void UntypedDescribeUninterestingCall(const void* untyped_args,
::std::ostream* os) const override
GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
const ArgumentTuple& args =
*static_cast<const ArgumentTuple*>(untyped_args);
*os << "Uninteresting mock function call - ";
......@@ -1702,11 +1698,10 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
// section. The reason is that we have no control on what the
// action does (it can invoke an arbitrary user function or even a
// mock function) and excessive locking could cause a dead lock.
virtual const ExpectationBase* UntypedFindMatchingExpectation(
const void* untyped_args,
const void** untyped_action, bool* is_excessive,
::std::ostream* what, ::std::ostream* why)
GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
const ExpectationBase* UntypedFindMatchingExpectation(
const void* untyped_args, const void** untyped_action, bool* is_excessive,
::std::ostream* what, ::std::ostream* why) override
GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
const ArgumentTuple& args =
*static_cast<const ArgumentTuple*>(untyped_args);
MutexLock l(&g_gmock_mutex);
......@@ -1728,8 +1723,8 @@ class FunctionMocker<R(Args...)> : public UntypedFunctionMockerBase {
}
// Prints the given function arguments to the ostream.
virtual void UntypedPrintArgs(const void* untyped_args,
::std::ostream* os) const {
void UntypedPrintArgs(const void* untyped_args,
::std::ostream* os) const override {
const ArgumentTuple& args =
*static_cast<const ArgumentTuple*>(untyped_args);
UniversalPrint(args, os);
......
......@@ -70,18 +70,18 @@ class BetweenCardinalityImpl : public CardinalityInterface {
// Conservative estimate on the lower/upper bound of the number of
// calls allowed.
virtual int ConservativeLowerBound() const { return min_; }
virtual int ConservativeUpperBound() const { return max_; }
int ConservativeLowerBound() const override { return min_; }
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_;
}
virtual bool IsSaturatedByCallCount(int call_count) const {
bool IsSaturatedByCallCount(int call_count) const override {
return call_count >= max_;
}
virtual void DescribeTo(::std::ostream* os) const;
void DescribeTo(::std::ostream* os) const override;
private:
const int min_;
......
......@@ -93,8 +93,8 @@ GTEST_API_ std::string ConvertIdentifierNameToWords(const char* id_name) {
// use Google Mock with a testing framework other than Google Test.
class GoogleTestFailureReporter : public FailureReporterInterface {
public:
virtual void ReportFailure(FailureType type, const char* file, int line,
const std::string& message) {
void ReportFailure(FailureType type, const char* file, int line,
const std::string& message) override {
AssertHelper(type == kFatal ?
TestPartResult::kFatalFailure :
TestPartResult::kNonFatalFailure,
......
......@@ -379,7 +379,7 @@ typedef int MyGlobalFunction(bool, int);
class MyActionImpl : public ActionInterface<MyGlobalFunction> {
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;
}
};
......@@ -443,7 +443,7 @@ TEST(ActionTest, IsCopyable) {
class IsNotZero : public ActionInterface<bool(int)> { // NOLINT
public:
virtual bool Perform(const std::tuple<int>& arg) {
bool Perform(const std::tuple<int>& arg) override {
return std::get<0>(arg) != 0;
}
};
......@@ -1087,7 +1087,7 @@ TEST(WithArgsTest, TenArgs) {
// Tests using WithArgs with an action that is not Invoke().
class SubtractAction : public ActionInterface<int(int, int)> {
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);
}
};
......@@ -1155,8 +1155,8 @@ TEST(WithArgsTest, InnerActionWithConversion) {
class SetErrnoAndReturnTest : public testing::Test {
protected:
virtual void SetUp() { errno = 0; }
virtual void TearDown() { errno = 0; }
void SetUp() override { errno = 0; }
void TearDown() override { errno = 0; }
};
TEST_F(SetErrnoAndReturnTest, Int) {
......
......@@ -396,17 +396,17 @@ TEST(ExactlyTest, HasCorrectBounds) {
class EvenCardinality : public CardinalityInterface {
public:
// 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);
}
// 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;
}
// 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";
}
};
......
......@@ -117,12 +117,11 @@ class GreaterThanMatcher : public MatcherInterface<int> {
public:
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_;
}
virtual bool MatchAndExplain(int lhs,
MatchResultListener* listener) const {
bool MatchAndExplain(int lhs, MatchResultListener* listener) const override {
const int diff = lhs - rhs_;
if (diff > 0) {
*listener << "which is " << diff << " more than " << rhs_;
......
......@@ -379,11 +379,9 @@ TEST(ExpectTest, FailsNonfatallyOnFalse) {
class LogIsVisibleTest : public ::testing::Test {
protected:
virtual void SetUp() {
original_verbose_ = GMOCK_FLAG(verbose);
}
void SetUp() override { 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_;
};
......@@ -442,11 +440,11 @@ TEST(LogTest, NoStackTraceWhenStackFramesToSkipIsNegative) {
}
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")
.GetString();
}
virtual void UponLeavingGTest() {}
void UponLeavingGTest() override {}
};
// Tests that in opt mode, a positive stack_frames_to_skip argument is
......
......@@ -162,12 +162,9 @@ class GreaterThanMatcher : public MatcherInterface<int> {
public:
explicit GreaterThanMatcher(int rhs) : rhs_(rhs) {}
virtual void DescribeTo(ostream* os) const {
*os << "is > " << rhs_;
}
void DescribeTo(ostream* os) const override { *os << "is > " << rhs_; }
virtual bool MatchAndExplain(int lhs,
MatchResultListener* listener) const {
bool MatchAndExplain(int lhs, MatchResultListener* listener) const override {
const int diff = lhs - rhs_;
if (diff > 0) {
*listener << "which is " << diff << " more than " << rhs_;
......@@ -257,14 +254,12 @@ TEST(MatchResultListenerTest, IsInterestedWorks) {
// change.
class EvenMatcherImpl : public MatcherInterface<int> {
public:
virtual bool MatchAndExplain(int x,
MatchResultListener* /* listener */) const {
bool MatchAndExplain(int x,
MatchResultListener* /* listener */) const override {
return x % 2 == 0;
}
virtual void DescribeTo(ostream* os) const {
*os << "is an even number";
}
void DescribeTo(ostream* os) const override { *os << "is an even number"; }
// We deliberately don't define DescribeNegationTo() and
// ExplainMatchResultTo() here, to make sure the definition of these
......@@ -280,7 +275,7 @@ TEST(MatcherInterfaceTest, CanBeImplementedUsingPublishedAPI) {
class NewEvenMatcherImpl : public MatcherInterface<int> {
public:
virtual bool MatchAndExplain(int x, MatchResultListener* listener) const {
bool MatchAndExplain(int x, MatchResultListener* listener) const override {
const bool match = x % 2 == 0;
// Verifies that we can stream to a listener directly.
*listener << "value % " << 2;
......@@ -292,9 +287,7 @@ class NewEvenMatcherImpl : public MatcherInterface<int> {
return match;
}
virtual void DescribeTo(ostream* os) const {
*os << "is an even number";
}
void DescribeTo(ostream* os) const override { *os << "is an even number"; }
};
TEST(MatcherInterfaceTest, CanBeImplementedUsingNewAPI) {
......
......@@ -1952,17 +1952,17 @@ TEST(DeletingMockEarlyTest, Failure2) {
class EvenNumberCardinality : public CardinalityInterface {
public:
// 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;
}
// 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;
}
// 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";
}
};
......@@ -2023,7 +2023,9 @@ class VerboseFlagPreservingFixture : public testing::Test {
VerboseFlagPreservingFixture()
: saved_verbose_flag_(GMOCK_FLAG(verbose)) {}
~VerboseFlagPreservingFixture() { GMOCK_FLAG(verbose) = saved_verbose_flag_; }
~VerboseFlagPreservingFixture() override {
GMOCK_FLAG(verbose) = saved_verbose_flag_;
}
private:
const std::string saved_verbose_flag_;
......
......@@ -183,16 +183,16 @@ class MatcherInterfaceAdapter : public MatcherInterface<const T&> {
public:
explicit MatcherInterfaceAdapter(const MatcherInterface<T>* 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);
}
virtual bool MatchAndExplain(const T& x,
MatchResultListener* listener) const {
bool MatchAndExplain(const T& x,
MatchResultListener* listener) const override {
return impl_->MatchAndExplain(x, listener);
}
......@@ -614,18 +614,19 @@ class ComparisonBase {
class Impl : public MatcherInterface<Lhs> {
public:
explicit Impl(const Rhs& rhs) : rhs_(rhs) {}
virtual bool MatchAndExplain(
Lhs lhs, MatchResultListener* /* listener */) const {
bool MatchAndExplain(Lhs lhs,
MatchResultListener* /* listener */) const override {
return Op()(lhs, rhs_);
}
virtual void DescribeTo(::std::ostream* os) const {
void DescribeTo(::std::ostream* os) const override {
*os << D::Desc() << " ";
UniversalPrint(rhs_, os);
}
virtual void DescribeNegationTo(::std::ostream* os) const {
void DescribeNegationTo(::std::ostream* os) const override {
*os << D::NegatedDesc() << " ";
UniversalPrint(rhs_, os);
}
private:
Rhs rhs_;
GTEST_DISALLOW_ASSIGN_(Impl);
......
......@@ -72,14 +72,15 @@ class GTEST_API_ ScopedFakeTestPartResultReporter
TestPartResultArray* result);
// The d'tor restores the previous test part result reporter.
virtual ~ScopedFakeTestPartResultReporter();
~ScopedFakeTestPartResultReporter() override;
// Appends the TestPartResult object to the TestPartResultArray
// received in the constructor.
//
// This method is from the TestPartResultReporterInterface
// interface.
virtual void ReportTestPartResult(const TestPartResult& result);
void ReportTestPartResult(const TestPartResult& result) override;
private:
void Init();
......
......@@ -165,8 +165,8 @@ class GTEST_API_ HasNewFatalFailureHelper
: public TestPartResultReporterInterface {
public:
HasNewFatalFailureHelper();
virtual ~HasNewFatalFailureHelper();
virtual void ReportTestPartResult(const TestPartResult& result);
~HasNewFatalFailureHelper() override;
void ReportTestPartResult(const TestPartResult& result) override;
bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
private:
bool has_new_fatal_failure_;
......
......@@ -1111,21 +1111,21 @@ class TestEventListener {
// above.
class EmptyTestEventListener : public TestEventListener {
public:
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
int /*iteration*/) {}
virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
virtual void OnTestStart(const TestInfo& /*test_info*/) {}
virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
int /*iteration*/) {}
virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
void OnTestProgramStart(const UnitTest& /*unit_test*/) override {}
void OnTestIterationStart(const UnitTest& /*unit_test*/,
int /*iteration*/) override {}
void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) override {}
void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {}
void OnTestCaseStart(const TestCase& /*test_case*/) override {}
void OnTestStart(const TestInfo& /*test_info*/) override {}
void OnTestPartResult(const TestPartResult& /*test_part_result*/) override {}
void OnTestEnd(const TestInfo& /*test_info*/) override {}
void OnTestCaseEnd(const TestCase& /*test_case*/) override {}
void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) override {}
void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {}
void OnTestIterationEnd(const UnitTest& /*unit_test*/,
int /*iteration*/) override {}
void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {}
};
// TestEventListeners lets users add listeners to track events in Google Test.
......
......@@ -154,9 +154,8 @@ class DeathTestFactory {
// A concrete DeathTestFactory implementation for normal use.
class DefaultDeathTestFactory : public DeathTestFactory {
public:
virtual bool Create(const char* statement,
Matcher<const std::string&> matcher, const char* file,
int line, DeathTest** test);
bool Create(const char* statement, Matcher<const std::string&> matcher,
const char* file, int line, DeathTest** test) override;
};
// Returns true if exit_status describes a process that was terminated
......
......@@ -469,7 +469,7 @@ class TestFactoryBase {
template <class TestClass>
class TestFactoryImpl : public TestFactoryBase {
public:
virtual Test* CreateTest() { return new TestClass; }
Test* CreateTest() override { return new TestClass; }
};
#if GTEST_OS_WINDOWS
......
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