diff options
Diffstat (limited to 'googletest')
-rw-r--r-- | googletest/include/gtest/gtest-message.h | 1 | ||||
-rw-r--r-- | googletest/include/gtest/gtest-typed-test.h | 4 | ||||
-rw-r--r-- | googletest/include/gtest/internal/gtest-internal.h | 3 | ||||
-rw-r--r-- | googletest/include/gtest/internal/gtest-port.h | 25 | ||||
-rwxr-xr-x | googletest/test/gtest_skip_check_output_test.py | 12 | ||||
-rw-r--r-- | googletest/test/gtest_unittest.cc | 4 |
6 files changed, 17 insertions, 32 deletions
diff --git a/googletest/include/gtest/gtest-message.h b/googletest/include/gtest/gtest-message.h index 4a80e11..2189923 100644 --- a/googletest/include/gtest/gtest-message.h +++ b/googletest/include/gtest/gtest-message.h @@ -49,6 +49,7 @@ #include <limits> #include <memory> +#include <sstream> #include "gtest/internal/gtest-port.h" diff --git a/googletest/include/gtest/gtest-typed-test.h b/googletest/include/gtest/gtest-typed-test.h index 095ce05..6b7c9c8 100644 --- a/googletest/include/gtest/gtest-typed-test.h +++ b/googletest/include/gtest/gtest-typed-test.h @@ -201,7 +201,7 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); private: \ typedef CaseName<gtest_TypeParam_> TestFixture; \ typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ + void TestBody() override; \ }; \ static bool gtest_##CaseName##_##TestName##_registered_ \ GTEST_ATTRIBUTE_UNUSED_ = \ @@ -276,7 +276,7 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); private: \ typedef SuiteName<gtest_TypeParam_> TestFixture; \ typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ + void TestBody() override; \ }; \ static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).AddTestName( \ diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index ebfe3c9..9524223 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -855,8 +855,7 @@ class GTEST_API_ Random { // true if and only if T is type proto2::Message or a subclass of it. template <typename T> struct IsAProtocolMessage - : public bool_constant< - std::is_convertible<const T*, const ::proto2::Message*>::value> {}; + : public std::is_convertible<const T*, const ::proto2::Message*> {}; // When the compiler sees expression IsContainerTest<C>(0), if C is an // STL-style container class, the first overload of IsContainerTest diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index f6433c5..3ad7119 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -248,7 +248,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <memory> #include <type_traits> #ifndef _WIN32_WCE @@ -261,16 +260,14 @@ # include <TargetConditionals.h> #endif -#include <algorithm> // NOLINT -#include <iostream> // NOLINT -#include <sstream> // NOLINT -#include <string> // NOLINT +#include <iostream> // NOLINT +#include <memory> +#include <string> // NOLINT #include <tuple> -#include <utility> #include <vector> // NOLINT -#include "gtest/internal/gtest-port-arch.h" #include "gtest/internal/custom/gtest-port.h" +#include "gtest/internal/gtest-port-arch.h" #if !defined(GTEST_DEV_EMAIL_) # define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com" @@ -847,9 +844,6 @@ class Secret; // expression is false, compiler will issue an error containing this identifier. #define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg) -// Evaluates to the number of elements in 'array'. -#define GTEST_ARRAY_SIZE_(array) (sizeof(array) / sizeof(array[0])) - // A helper for suppressing warnings on constant condition. It just // returns 'condition'. GTEST_API_ bool IsTrue(bool condition); @@ -1590,7 +1584,7 @@ class ThreadLocal : public ThreadLocalBase { class DefaultValueHolderFactory : public ValueHolderFactory { public: DefaultValueHolderFactory() {} - virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); } + ValueHolder* MakeNewHolder() const override { return new ValueHolder(); } private: GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory); @@ -1599,7 +1593,7 @@ class ThreadLocal : public ThreadLocalBase { class InstanceValueHolderFactory : public ValueHolderFactory { public: explicit InstanceValueHolderFactory(const T& value) : value_(value) {} - virtual ValueHolder* MakeNewHolder() const { + ValueHolder* MakeNewHolder() const override { return new ValueHolder(value_); } @@ -1878,9 +1872,6 @@ class GTEST_API_ ThreadLocal { // we cannot detect it. GTEST_API_ size_t GetThreadCount(); -template <bool B> -using bool_constant = std::integral_constant<bool, B>; - #if GTEST_OS_WINDOWS # define GTEST_PATH_SEP_ "\\" # define GTEST_HAS_ALT_PATH_SEP_ 1 @@ -2004,10 +1995,6 @@ inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); } GTEST_DISABLE_MSC_DEPRECATED_PUSH_() -inline const char* StrNCpy(char* dest, const char* src, size_t n) { - return strncpy(dest, src, n); -} - // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and // StrError() aren't needed on Windows CE at this time and thus not // defined there. diff --git a/googletest/test/gtest_skip_check_output_test.py b/googletest/test/gtest_skip_check_output_test.py index d5708ee..14e63ab 100755 --- a/googletest/test/gtest_skip_check_output_test.py +++ b/googletest/test/gtest_skip_check_output_test.py @@ -33,9 +33,10 @@ This script invokes gtest_skip_in_environment_setup_test_ and verifies its output. """ -import gtest_test_utils import re +import gtest_test_utils + # Path to the gtest_skip_in_environment_setup_test binary EXE_PATH = gtest_test_utils.GetTestExecutablePath('gtest_skip_test') @@ -48,12 +49,9 @@ class SkipEntireEnvironmentTest(gtest_test_utils.TestCase): def testSkipEntireEnvironmentTest(self): self.assertIn('Skipped\nskipping single test\n', OUTPUT) skip_fixture = 'Skipped\nskipping all tests for this fixture\n' - self.assertTrue( - re.search( - skip_fixture + '.*' + skip_fixture, OUTPUT, flags=re.DOTALL - ) is not None, - repr(OUTPUT) - ) + self.assertIsNotNone( + re.search(skip_fixture + '.*' + skip_fixture, OUTPUT, flags=re.DOTALL), + repr(OUTPUT)) self.assertNotIn('FAILED', OUTPUT) diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index 8312bd1..d17a155 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -6170,7 +6170,7 @@ TEST_F(ParseFlagsTest, WideStrings) { #if GTEST_USE_OWN_FLAGFILE_FLAG_ class FlagfileTest : public ParseFlagsTest { public: - virtual void SetUp() { + void SetUp() override { ParseFlagsTest::SetUp(); testdata_path_.Set(internal::FilePath( @@ -6180,7 +6180,7 @@ class FlagfileTest : public ParseFlagsTest { EXPECT_TRUE(testdata_path_.CreateFolder()); } - virtual void TearDown() { + void TearDown() override { testing::internal::posix::RmDir(testdata_path_.c_str()); ParseFlagsTest::TearDown(); } |