summaryrefslogtreecommitdiffstats
path: root/googletest/src
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@google.com>2023-04-21 17:40:36 (GMT)
committerCopybara-Service <copybara-worker@google.com>2023-04-21 17:41:25 (GMT)
commit783d00fd19865fcbc3065e3fb3e17144761fcf5a (patch)
treebb27246918f3fcdea0cb619a37ac43ccb1abeac0 /googletest/src
parentbaf182e006bcb82ef5e0b407e350a1d4c444b76a (diff)
downloadgoogletest-783d00fd19865fcbc3065e3fb3e17144761fcf5a.zip
googletest-783d00fd19865fcbc3065e3fb3e17144761fcf5a.tar.gz
googletest-783d00fd19865fcbc3065e3fb3e17144761fcf5a.tar.bz2
Use '=default' to define trivial constructor/destructorsrefs/pull/4221/head
https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html PiperOrigin-RevId: 526079054 Change-Id: Ia4db21e3e5f58b90de05d52fd94b291ed06d785d
Diffstat (limited to 'googletest/src')
-rw-r--r--googletest/src/gtest-internal-inl.h8
-rw-r--r--googletest/src/gtest.cc8
2 files changed, 8 insertions, 8 deletions
diff --git a/googletest/src/gtest-internal-inl.h b/googletest/src/gtest-internal-inl.h
index 16841b5..0084971 100644
--- a/googletest/src/gtest-internal-inl.h
+++ b/googletest/src/gtest-internal-inl.h
@@ -407,8 +407,8 @@ GTEST_API_ FilePath GetCurrentExecutableName();
// The role interface for getting the OS stack trace as a string.
class OsStackTraceGetterInterface {
public:
- OsStackTraceGetterInterface() {}
- virtual ~OsStackTraceGetterInterface() {}
+ OsStackTraceGetterInterface() = default;
+ virtual ~OsStackTraceGetterInterface() = default;
// Returns the current OS stack trace as an std::string. Parameters:
//
@@ -436,7 +436,7 @@ class OsStackTraceGetterInterface {
// A working implementation of the OsStackTraceGetterInterface interface.
class OsStackTraceGetter : public OsStackTraceGetterInterface {
public:
- OsStackTraceGetter() {}
+ OsStackTraceGetter() = default;
std::string CurrentStackTrace(int max_depth, int skip_count) override;
void UponLeavingGTest() override;
@@ -1064,7 +1064,7 @@ class StreamingListener : public EmptyTestEventListener {
// Abstract base class for writing strings to a socket.
class AbstractSocketWriter {
public:
- virtual ~AbstractSocketWriter() {}
+ virtual ~AbstractSocketWriter() = default;
// Sends a string to the socket.
virtual void Send(const std::string& message) = 0;
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 01c0220..9fdca40 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -2241,7 +2241,7 @@ TestResult::TestResult()
: death_test_count_(0), start_timestamp_(0), elapsed_time_(0) {}
// D'tor.
-TestResult::~TestResult() {}
+TestResult::~TestResult() = default;
// Returns the i-th test part result among all the results. i can
// range from 0 to total_part_count() - 1. If i is not in that range,
@@ -2450,7 +2450,7 @@ Test::Test() : gtest_flag_saver_(new GTEST_FLAG_SAVER_) {}
// The d'tor restores the states of all flags. The actual work is
// done by the d'tor of the gtest_flag_saver_ field, and thus not
// visible here.
-Test::~Test() {}
+Test::~Test() = default;
// Sets up the test fixture.
//
@@ -3362,7 +3362,7 @@ static void PrintFullTestCommentIfPresent(const TestInfo& test_info) {
// Class PrettyUnitTestResultPrinter is copyable.
class PrettyUnitTestResultPrinter : public TestEventListener {
public:
- PrettyUnitTestResultPrinter() {}
+ PrettyUnitTestResultPrinter() = default;
static void PrintTestName(const char* test_suite, const char* test) {
printf("%s.%s", test_suite, test);
}
@@ -3670,7 +3670,7 @@ void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
// Class BriefUnitTestResultPrinter is copyable.
class BriefUnitTestResultPrinter : public TestEventListener {
public:
- BriefUnitTestResultPrinter() {}
+ BriefUnitTestResultPrinter() = default;
static void PrintTestName(const char* test_suite, const char* test) {
printf("%s.%s", test_suite, test);
}