Skip to content

Commit

Permalink
Googletest export
Browse files Browse the repository at this point in the history
Applied fixes for ClangTidy modernize-use-override and modernize-use-using.

PiperOrigin-RevId: 223800219
  • Loading branch information
Abseil Team authored and gennadiycivil committed Dec 3, 2018
1 parent a42cdf2 commit 2674336
Show file tree
Hide file tree
Showing 51 changed files with 507 additions and 555 deletions.
24 changes: 10 additions & 14 deletions googlemock/include/gmock/gmock-actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand All @@ -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_;
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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_;
Expand Down Expand Up @@ -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_;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions googlemock/include/gmock/gmock-generated-nice-strict.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class NiceMock : public MockClass {

#endif // GTEST_LANG_CXX11

~NiceMock() {
~NiceMock() { // NOLINT
::testing::Mock::UnregisterCallReaction(
internal::ImplicitCast_<MockClass*>(this));
}
Expand Down Expand Up @@ -299,7 +299,7 @@ class NaggyMock : public MockClass {

#endif // GTEST_LANG_CXX11

~NaggyMock() {
~NaggyMock() { // NOLINT
::testing::Mock::UnregisterCallReaction(
internal::ImplicitCast_<MockClass*>(this));
}
Expand Down Expand Up @@ -417,7 +417,7 @@ class StrictMock : public MockClass {

#endif // GTEST_LANG_CXX11

~StrictMock() {
~StrictMock() { // NOLINT
::testing::Mock::UnregisterCallReaction(
internal::ImplicitCast_<MockClass*>(this));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ $range j 1..i
]]
#endif // GTEST_LANG_CXX11

~$clazz() {
~$clazz() { // NOLINT
::testing::Mock::UnregisterCallReaction(
internal::ImplicitCast_<MockClass*>(this));
}
Expand Down
Loading

0 comments on commit 2674336

Please sign in to comment.