diff options
author | Baruch <bmburstein@gmail.com> | 2022-08-25 07:55:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-25 07:55:49 (GMT) |
commit | dd969ed5fed68a518027ea1655579fa8768f3aae (patch) | |
tree | 57545d600884b7ca7c7e3edebfc07cfea175ccd6 /googletest | |
parent | 3280a930bf3f2fdb77da9a6cdf5866ef22708ff1 (diff) | |
parent | 25cc5777a17820a6339204a3552aa1dd5e428669 (diff) | |
download | googletest-dd969ed5fed68a518027ea1655579fa8768f3aae.zip googletest-dd969ed5fed68a518027ea1655579fa8768f3aae.tar.gz googletest-dd969ed5fed68a518027ea1655579fa8768f3aae.tar.bz2 |
Merge branch 'google:main' into custom_type_combine
Diffstat (limited to 'googletest')
-rw-r--r-- | googletest/README.md | 4 | ||||
-rw-r--r-- | googletest/include/gtest/gtest-matchers.h | 2 | ||||
-rw-r--r-- | googletest/src/gtest-death-test.cc | 4 | ||||
-rw-r--r-- | googletest/src/gtest.cc | 2 | ||||
-rw-r--r-- | googletest/test/gtest_unittest.cc | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/googletest/README.md b/googletest/README.md index 8760d13..75b3d52 100644 --- a/googletest/README.md +++ b/googletest/README.md @@ -9,7 +9,7 @@ depends on which build system you use, and is usually straightforward. ### Build with CMake GoogleTest comes with a CMake build script -([CMakeLists.txt](https://github.com/google/googletest/blob/master/CMakeLists.txt)) +([CMakeLists.txt](https://github.com/google/googletest/blob/main/CMakeLists.txt)) that can be used on a wide range of platforms ("C" stands for cross-platform.). If you don't have CMake installed already, you can download it for free from <http://www.cmake.org/>. @@ -140,7 +140,7 @@ command line. Generally, these macros are named like `GTEST_XYZ` and you define them to either 1 or 0 to enable or disable a certain feature. We list the most frequently used macros below. For a complete list, see file -[include/gtest/internal/gtest-port.h](https://github.com/google/googletest/blob/master/googletest/include/gtest/internal/gtest-port.h). +[include/gtest/internal/gtest-port.h](https://github.com/google/googletest/blob/main/googletest/include/gtest/internal/gtest-port.h). ### Multi-threaded Tests diff --git a/googletest/include/gtest/gtest-matchers.h b/googletest/include/gtest/gtest-matchers.h index bffa00c..4a60b0d 100644 --- a/googletest/include/gtest/gtest-matchers.h +++ b/googletest/include/gtest/gtest-matchers.h @@ -842,7 +842,7 @@ class MatchesRegexMatcher { template <class MatcheeStringType> bool MatchAndExplain(const MatcheeStringType& s, MatchResultListener* /* listener */) const { - const std::string& s2(s); + const std::string s2(s); return full_match_ ? RE::FullMatch(s2, *regex_) : RE::PartialMatch(s2, *regex_); } diff --git a/googletest/src/gtest-death-test.cc b/googletest/src/gtest-death-test.cc index e6abc62..b6968a9 100644 --- a/googletest/src/gtest-death-test.cc +++ b/googletest/src/gtest-death-test.cc @@ -249,7 +249,7 @@ static std::string DeathTestThreadWarning(size_t thread_count) { msg << "detected " << thread_count << " threads."; } msg << " See " - "https://github.com/google/googletest/blob/master/docs/" + "https://github.com/google/googletest/blob/main/docs/" "advanced.md#death-tests-and-threads" << " for more explanation and suggested solutions, especially if" << " this is the last message you see before your test times out."; @@ -284,7 +284,7 @@ enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW }; // message is propagated back to the parent process. Otherwise, the // message is simply printed to stderr. In either case, the program // then exits with status 1. -static void DeathTestAbort(const std::string& message) { +[[noreturn]] static void DeathTestAbort(const std::string& message) { // On a POSIX system, this function may be called from a threadsafe-style // death test child process, which operates on a very small stack. Use // the heap for any additional non-minuscule memory requirements. diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index bcfb41a..513a887 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -6039,7 +6039,7 @@ bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) { // each TestSuite and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see -// https://github.com/google/googletest/blob/master/googletest/docs/advanced.md +// https://github.com/google/googletest/blob/main/docs/advanced.md // . Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) { const int32_t total_shards = shard_tests == HONOR_SHARDING_PROTOCOL diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index b579e81..329ca54 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -3454,10 +3454,10 @@ TEST_F(NoFatalFailureTest, MessageIsStreamable) { TestPartResultArray gtest_failures; { ScopedFakeTestPartResultReporter gtest_reporter(>est_failures); - EXPECT_NO_FATAL_FAILURE(FAIL() << "foo") << "my message"; + EXPECT_NO_FATAL_FAILURE([] { FAIL() << "foo"; }()) << "my message"; } ASSERT_EQ(2, gtest_failures.size()); - EXPECT_EQ(TestPartResult::kNonFatalFailure, + EXPECT_EQ(TestPartResult::kFatalFailure, gtest_failures.GetTestPartResult(0).type()); EXPECT_EQ(TestPartResult::kNonFatalFailure, gtest_failures.GetTestPartResult(1).type()); |