summaryrefslogtreecommitdiffstats
path: root/googletest
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2022-09-28 21:14:25 (GMT)
committerCopybara-Service <copybara-worker@google.com>2022-09-28 21:14:58 (GMT)
commitc43b916a9623e052860f59e52f71de1974ed8823 (patch)
treeefd56c620b3fd60a0d9f8acc9d8e387e93a88894 /googletest
parent4924e0610a89dcd58077a691a2e3702b0d6e58ed (diff)
downloadgoogletest-c43b916a9623e052860f59e52f71de1974ed8823.zip
googletest-c43b916a9623e052860f59e52f71de1974ed8823.tar.gz
googletest-c43b916a9623e052860f59e52f71de1974ed8823.tar.bz2
Uses a simpler mechanism to disable the copying of GoogleTest test suites.
PiperOrigin-RevId: 477549427 Change-Id: I6421ca09f0f1296cebdc3e54565049f1542dfa8a
Diffstat (limited to 'googletest')
-rw-r--r--googletest/include/gtest/gtest-param-test.h2
-rw-r--r--googletest/include/gtest/gtest.h17
2 files changed, 6 insertions, 13 deletions
diff --git a/googletest/include/gtest/gtest-param-test.h b/googletest/include/gtest/gtest-param-test.h
index 19238ae..2dbac48 100644
--- a/googletest/include/gtest/gtest-param-test.h
+++ b/googletest/include/gtest/gtest-param-test.h
@@ -409,7 +409,7 @@ internal::CartesianProductHolder<Generator...> Combine(const Generator&... g) {
#define TEST_P(test_suite_name, test_name) \
class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
- : public ::testing::internal::UserTestSuite<test_suite_name> { \
+ : public test_suite_name, private ::testing::internal::NonCopyable { \
public: \
GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \
void TestBody() override; \
diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h
index 6ff2774..4f037ad 100644
--- a/googletest/include/gtest/gtest.h
+++ b/googletest/include/gtest/gtest.h
@@ -190,19 +190,12 @@ void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
const std::string& message);
std::set<std::string>* GetIgnoredParameterizedTestSuites();
-// Mix-in class for user tests.
-// This allows us to add/delete members to/from test suites without having to
-// modify the test macros themselves.
-// This makes the code easier to read and maintain, as well making it easier
-// for users to suppress any warnings originating from these members, as the
-// members are now declared in an external header instead of in user code.
-template <class TestClass>
-class UserTestSuite : public TestClass {
+class NonCopyable {
public:
- UserTestSuite() = default;
- UserTestSuite(const UserTestSuite &) = delete;
- UserTestSuite &operator=(const UserTestSuite &) = delete;
- virtual ~UserTestSuite() = default;
+ NonCopyable() = default;
+ NonCopyable(const NonCopyable &) = delete;
+ NonCopyable &operator=(const NonCopyable &) = delete;
+ ~NonCopyable() = default;
};
} // namespace internal