diff options
author | trzeci <kontakt@trzeci.eu> | 2019-12-17 22:43:31 (GMT) |
---|---|---|
committer | trzeci <kontakt@trzeci.eu> | 2019-12-17 22:43:31 (GMT) |
commit | 9d8222ad667284cfad8be9cb27b25dab75f34ccb (patch) | |
tree | c39c9ed6cf1bc9eaea3b9189cef3eddf2f2b075a /googletest/include/gtest/internal/gtest-internal.h | |
parent | d166e09483845b9b6a658dccc3d3dbb293676b62 (diff) | |
download | googletest-9d8222ad667284cfad8be9cb27b25dab75f34ccb.zip googletest-9d8222ad667284cfad8be9cb27b25dab75f34ccb.tar.gz googletest-9d8222ad667284cfad8be9cb27b25dab75f34ccb.tar.bz2 |
Disable move constructor and assignment operator for test classes.
Disable move operations for TEST() and TEST_F() macros.
Previous implementation disabled only copy ctor and assing operator, but
this was violating rule of 5[1], which was captured by static code analysis tools
like clang-tidy `cppcoreguidelines-special-member-functions`.
[1]: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c21-if-you-define-or-delete-any-default-operation-define-or-delete-them-all
Diffstat (limited to 'googletest/include/gtest/internal/gtest-internal.h')
-rw-r--r-- | googletest/include/gtest/internal/gtest-internal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index eac831a..062611e 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -1395,6 +1395,8 @@ constexpr bool InstantiateTypedTestCase_P_IsDeprecated() { return true; } static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_; \ GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \ test_name)); \ + GTEST_DISALLOW_MOVE_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \ + test_name)); \ }; \ \ ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_suite_name, \ |