diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-26 13:57:00 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-11-02 11:31:01 +0000 |
commit | 1943b3c2a1dcee36c233724fc4ee7613d71b9cf6 (patch) | |
tree | 8c1b5f12357025c197da5427ae02cfdc2f3570d6 /chromium/third_party/googletest/src/googletest/include/gtest | |
parent | 21ba0c5d4bf8fba15dddd97cd693bad2358b77fd (diff) | |
download | qtwebengine-chromium-1943b3c2a1dcee36c233724fc4ee7613d71b9cf6.tar.gz |
BASELINE: Update Chromium to 94.0.4606.111
Change-Id: I924781584def20fc800bedf6ff41fdb96c438193
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/googletest/src/googletest/include/gtest')
20 files changed, 90 insertions, 110 deletions
diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-death-test.h b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-death-test.h index adfb192111f..33effe18956 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-death-test.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-death-test.h @@ -33,15 +33,12 @@ // This header file defines the public API for death tests. It is // #included by gtest.h so a user doesn't need to include this // directly. -// GOOGLETEST_CM0001 DO NOT DELETE #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ #define GOOGLETEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ #include "gtest/internal/gtest-death-test-internal.h" -namespace testing { - // This flag controls the style of death tests. Valid values are "threadsafe", // meaning that the death test child process will re-execute the test binary // from the start, running only a single death test, or "fast", @@ -49,6 +46,8 @@ namespace testing { // after forking. GTEST_DECLARE_string_(death_test_style); +namespace testing { + #if GTEST_HAS_DEATH_TEST namespace internal { @@ -97,9 +96,12 @@ GTEST_API_ bool InDeathTestChild(); // // ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!"); // +// The final parameter to each of these macros is a matcher applied to any data +// the sub-process wrote to stderr. For compatibility with existing tests, a +// bare string is interpreted as a regular expression matcher. +// // On the regular expressions used in death tests: // -// GOOGLETEST_CM0005 DO NOT DELETE // On POSIX-compliant systems (*nix), we use the <regex.h> library, // which uses the POSIX extended regex syntax. // @@ -162,27 +164,27 @@ GTEST_API_ bool InDeathTestChild(); // directory in PATH. // -// Asserts that a given statement causes the program to exit, with an -// integer exit status that satisfies predicate, and emitting error output -// that matches regex. -# define ASSERT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) +// Asserts that a given `statement` causes the program to exit, with an +// integer exit status that satisfies `predicate`, and emitting error output +// that matches `matcher`. +# define ASSERT_EXIT(statement, predicate, matcher) \ + GTEST_DEATH_TEST_(statement, predicate, matcher, GTEST_FATAL_FAILURE_) -// Like ASSERT_EXIT, but continues on to successive tests in the +// Like `ASSERT_EXIT`, but continues on to successive tests in the // test suite, if any: -# define EXPECT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) +# define EXPECT_EXIT(statement, predicate, matcher) \ + GTEST_DEATH_TEST_(statement, predicate, matcher, GTEST_NONFATAL_FAILURE_) -// Asserts that a given statement causes the program to exit, either by +// Asserts that a given `statement` causes the program to exit, either by // explicitly exiting with a nonzero exit code or being killed by a -// signal, and emitting error output that matches regex. -# define ASSERT_DEATH(statement, regex) \ - ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) +// signal, and emitting error output that matches `matcher`. +# define ASSERT_DEATH(statement, matcher) \ + ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, matcher) -// Like ASSERT_DEATH, but continues on to successive tests in the +// Like `ASSERT_DEATH`, but continues on to successive tests in the // test suite, if any: -# define EXPECT_DEATH(statement, regex) \ - EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) +# define EXPECT_DEATH(statement, matcher) \ + EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, matcher) // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: @@ -200,7 +202,6 @@ class GTEST_API_ ExitedWithCode { # if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA // Tests that an exit code describes an exit due to termination by a // given signal. -// GOOGLETEST_CM0006 DO NOT DELETE class GTEST_API_ KilledBySignal { public: explicit KilledBySignal(int signum); diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-matchers.h b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-matchers.h index 2bd3dcf614a..9fa34a05ba4 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-matchers.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-matchers.h @@ -106,7 +106,7 @@ inline MatchResultListener::~MatchResultListener() { // An instance of a subclass of this knows how to describe itself as a // matcher. -class MatcherDescriberInterface { +class GTEST_API_ MatcherDescriberInterface { public: virtual ~MatcherDescriberInterface() {} diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-message.h b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-message.h index becfd49fcba..bad516116b0 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-message.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-message.h @@ -42,8 +42,6 @@ // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user // program! -// GOOGLETEST_CM0001 DO NOT DELETE - #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ #define GOOGLETEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h index 804e702817b..5558117f928 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h @@ -29,8 +29,6 @@ // // Macros and functions for implementing parameterized tests // in Google C++ Testing and Mocking Framework (Google Test) -// -// GOOGLETEST_CM0001 DO NOT DELETE #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ #define GOOGLETEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-printers.h b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-printers.h index 46fe8950fe8..2e33df4028e 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-printers.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-printers.h @@ -95,8 +95,6 @@ // being defined as many user-defined container types don't have // value_type. -// GOOGLETEST_CM0001 DO NOT DELETE - #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ #define GOOGLETEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ @@ -113,11 +111,6 @@ #include "gtest/internal/gtest-internal.h" #include "gtest/internal/gtest-port.h" -#if GTEST_HAS_RTTI -#include <typeindex> -#include <typeinfo> -#endif // GTEST_HAS_RTTI - namespace testing { // Definitions in the internal* namespaces are subject to change without notice. @@ -365,7 +358,7 @@ GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char); GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char); GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t); GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t); -#ifdef __cpp_char8_t +#ifdef __cpp_lib_char8_t GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char8_t); GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char8_t); #endif @@ -506,18 +499,18 @@ inline void PrintTo(unsigned char* s, ::std::ostream* os) { } #ifdef __cpp_char8_t // Overloads for u8 strings. -void PrintTo(const char8_t* s, ::std::ostream* os); +GTEST_API_ void PrintTo(const char8_t* s, ::std::ostream* os); inline void PrintTo(char8_t* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char8_t*>(s), os); } #endif // Overloads for u16 strings. -void PrintTo(const char16_t* s, ::std::ostream* os); +GTEST_API_ void PrintTo(const char16_t* s, ::std::ostream* os); inline void PrintTo(char16_t* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char16_t*>(s), os); } // Overloads for u32 strings. -void PrintTo(const char32_t* s, ::std::ostream* os); +GTEST_API_ void PrintTo(const char32_t* s, ::std::ostream* os); inline void PrintTo(char32_t* s, ::std::ostream* os) { PrintTo(ImplicitCast_<const char32_t*>(s), os); } @@ -672,18 +665,6 @@ void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) { *os << ')'; } -#if GTEST_HAS_RTTI -inline void PrintTo(const ::std::type_info& value, ::std::ostream* os) { - internal::PrintTo<::std::type_info>(value, os); - *os << " (\"" << value.name() << "\")"; -} - -inline void PrintTo(const ::std::type_index& value, ::std::ostream* os) { - internal::PrintTo<::std::type_index>(value, os); - *os << " (\"" << value.name() << "\")"; -} -#endif // GTEST_HAS_RTTI - // Implements printing a non-reference type T by letting the compiler // pick the right overload of PrintTo() for T. template <typename T> diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-spi.h b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-spi.h index eacef44669e..bce8b22d9a7 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-spi.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-spi.h @@ -31,8 +31,6 @@ // Utilities for testing Google Test itself and code that uses Google Test // (e.g. frameworks built on top of Google Test). -// GOOGLETEST_CM0004 DO NOT DELETE - #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_SPI_H_ #define GOOGLETEST_INCLUDE_GTEST_GTEST_SPI_H_ diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-test-part.h b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-test-part.h index 203fdf98c69..db9f4b9351f 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-test-part.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-test-part.h @@ -26,8 +26,6 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// GOOGLETEST_CM0001 DO NOT DELETE #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ #define GOOGLETEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-typed-test.h b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-typed-test.h index 9fdc6be10dc..8e078b398a7 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/gtest-typed-test.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/gtest-typed-test.h @@ -27,8 +27,6 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// GOOGLETEST_CM0001 DO NOT DELETE - #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ #define GOOGLETEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/gtest.h b/chromium/third_party/googletest/src/googletest/include/gtest/gtest.h index 7a5d057c4a7..3d04b897891 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/gtest.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/gtest.h @@ -47,8 +47,6 @@ // registration from Barthelemy Dagenais' (barthelemy@prologique.com) // easyUnit framework. -// GOOGLETEST_CM0001 DO NOT DELETE - #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_H_ #define GOOGLETEST_INCLUDE_GTEST_GTEST_H_ @@ -73,17 +71,6 @@ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ /* class A needs to have dll-interface to be used by clients of class B */) -namespace testing { - -// Silence C4100 (unreferenced formal parameter) and 4805 -// unsafe mix of type 'const int' and type 'const bool' -#ifdef _MSC_VER -# pragma warning(push) -# pragma warning(disable:4805) -# pragma warning(disable:4100) -#endif - - // Declares the flags. // This flag temporary enables the disabled tests. @@ -138,6 +125,12 @@ GTEST_DECLARE_int32_(random_seed); // is 1. If the value is -1 the tests are repeating forever. GTEST_DECLARE_int32_(repeat); +// This flag controls whether Google Test Environments are recreated for each +// repeat of the tests. The default value is true. If set to false the global +// test Environment objects are only set up once, for the first iteration, and +// only torn down once, for the last. +GTEST_DECLARE_bool_(recreate_environments_when_repeating); + // This flag controls whether Google Test includes Google Test internal // stack frames in failure stack traces. GTEST_DECLARE_bool_(show_internal_stack_frames); @@ -163,6 +156,16 @@ GTEST_DECLARE_string_(stream_result_to); GTEST_DECLARE_string_(flagfile); #endif // GTEST_USE_OWN_FLAGFILE_FLAG_ +namespace testing { + +// Silence C4100 (unreferenced formal parameter) and 4805 +// unsafe mix of type 'const int' and type 'const bool' +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4805) +#pragma warning(disable : 4100) +#endif + // The upper limit for valid stack trace depths. const int kMaxStackTraceDepth = 100; @@ -2378,13 +2381,12 @@ constexpr bool StaticAssertTypeEq() noexcept { // EXPECT_EQ(a_.size(), 0); // EXPECT_EQ(b_.size(), 1); // } -// -// GOOGLETEST_CM0011 DO NOT DELETE -#if !GTEST_DONT_DEFINE_TEST -#define TEST_F(test_fixture, test_name)\ +#define GTEST_TEST_F(test_fixture, test_name)\ GTEST_TEST_(test_fixture, test_name, test_fixture, \ ::testing::internal::GetTypeId<test_fixture>()) -#endif // !GTEST_DONT_DEFINE_TEST +#if !GTEST_DONT_DEFINE_TEST_F +#define TEST_F(test_fixture, test_name) GTEST_TEST_F(test_fixture, test_name) +#endif // Returns a path to temporary directory. // Tries to determine an appropriate directory for the platform. diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/gtest_pred_impl.h b/chromium/third_party/googletest/src/googletest/include/gtest/gtest_pred_impl.h index 5029a9bb02a..67a96c9f80e 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/gtest_pred_impl.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/gtest_pred_impl.h @@ -27,11 +27,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// This file is AUTOMATICALLY GENERATED on 01/02/2019 by command +// This file is AUTOMATICALLY GENERATED on 07/21/2021 by command // 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND! // // Implements a family of generic predicate assertion macros. -// GOOGLETEST_CM0001 DO NOT DELETE #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ #define GOOGLETEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/gtest_prod.h b/chromium/third_party/googletest/src/googletest/include/gtest/gtest_prod.h index 38b9d85a51e..25766ee78d7 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/gtest_prod.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/gtest_prod.h @@ -29,7 +29,6 @@ // // Google C++ Testing and Mocking Framework definitions useful in production code. -// GOOGLETEST_CM0003 DO NOT DELETE #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_ #define GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_ diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/internal/custom/README.md b/chromium/third_party/googletest/src/googletest/include/gtest/internal/custom/README.md index ff391fb4e2b..0af3539abf1 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/internal/custom/README.md +++ b/chromium/third_party/googletest/src/googletest/include/gtest/internal/custom/README.md @@ -26,6 +26,8 @@ The following macros can be defined: * `GTEST_DEFINE_bool_(name, default_val, doc)` * `GTEST_DEFINE_int32_(name, default_val, doc)` * `GTEST_DEFINE_string_(name, default_val, doc)` +* `GTEST_FLAG_GET(flag_name)` +* `GTEST_FLAG_SET(flag_name, value)` ### Logging: diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-death-test-internal.h b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-death-test-internal.h index 490296dfad2..8e0023a9064 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-death-test-internal.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-death-test-internal.h @@ -31,7 +31,6 @@ // // This header file defines internal utilities needed for implementing // death tests. They are subject to change without notice. -// GOOGLETEST_CM0001 DO NOT DELETE #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ @@ -42,11 +41,11 @@ #include <stdio.h> #include <memory> +GTEST_DECLARE_string_(internal_run_death_test); + namespace testing { namespace internal { -GTEST_DECLARE_string_(internal_run_death_test); - // Names of the flags (needed for parsing Google Test flags). const char kDeathTestStyleFlag[] = "death_test_style"; const char kDeathTestUseFork[] = "death_test_use_fork"; @@ -236,8 +235,6 @@ inline Matcher<const ::std::string&> MakeDeathTestMatcher( gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \ break; \ } \ - default: \ - break; \ } \ } \ } else \ diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-filepath.h b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-filepath.h index 0c033abc34e..43f47dcc09e 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-filepath.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-filepath.h @@ -35,8 +35,6 @@ // This file is #included in gtest/internal/gtest-internal.h. // Do not include this header file separately! -// GOOGLETEST_CM0001 DO NOT DELETE - #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-internal.h b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-internal.h index f8cbdbd81d9..02e0198a859 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-internal.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-internal.h @@ -32,8 +32,6 @@ // This header file declares functions and macros used internally by // Google Test. They are subject to change without notice. -// GOOGLETEST_CM0001 DO NOT DELETE - #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util.h b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util.h index 3e49a6baac7..d2312c00344 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util.h @@ -30,8 +30,6 @@ // Type and function utilities for implementing parameterized tests. -// GOOGLETEST_CM0001 DO NOT DELETE - #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ @@ -478,7 +476,7 @@ class ParameterizedTestSuiteInfoBase { // // Report a the name of a test_suit as safe to ignore // as the side effect of construction of this type. -struct MarkAsIgnored { +struct GTEST_API_ MarkAsIgnored { explicit MarkAsIgnored(const char* test_suite); }; @@ -654,7 +652,7 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase { // Check for invalid characters for (std::string::size_type index = 0; index < name.size(); ++index) { - if (!isalnum(name[index]) && name[index] != '_') + if (!IsAlNum(name[index]) && name[index] != '_') return false; } diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-port-arch.h b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-port-arch.h index dd845915e3c..4dcdc89c859 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-port-arch.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-port-arch.h @@ -78,6 +78,8 @@ # define GTEST_OS_FREEBSD 1 #elif defined __Fuchsia__ # define GTEST_OS_FUCHSIA 1 +#elif defined(__GNU__) +# define GTEST_OS_GNU_HURD 1 #elif defined(__GLIBC__) && defined(__FreeBSD_kernel__) # define GTEST_OS_GNU_KFREEBSD 1 #elif defined __linux__ diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h index 0953a781c05..0b42dde877b 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h @@ -38,8 +38,6 @@ // files are expected to #include this. Therefore, it cannot #include // any other Google Test header. -// GOOGLETEST_CM0001 DO NOT DELETE - #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ @@ -116,6 +114,7 @@ // GTEST_OS_DRAGONFLY - DragonFlyBSD // GTEST_OS_FREEBSD - FreeBSD // GTEST_OS_FUCHSIA - Fuchsia +// GTEST_OS_GNU_HURD - GNU/Hurd // GTEST_OS_GNU_KFREEBSD - GNU/kFreeBSD // GTEST_OS_HAIKU - Haiku // GTEST_OS_HPUX - HP-UX @@ -167,7 +166,6 @@ // GTEST_HAS_TYPED_TEST - typed tests // GTEST_HAS_TYPED_TEST_P - type-parameterized tests // GTEST_IS_THREADSAFE - Google Test is thread-safe. -// GOOGLETEST_CM0007 DO NOT DELETE // GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with // GTEST_HAS_POSIX_RE (see above) which users can // define themselves. @@ -219,7 +217,6 @@ // Regular expressions: // RE - a simple regular expression class using the POSIX // Extended Regular Expression syntax on UNIX-like platforms -// GOOGLETEST_CM0008 DO NOT DELETE // or a reduced regular exception syntax on other // platforms, including Windows. // Logging: @@ -547,7 +544,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX || GTEST_OS_QNX || \ GTEST_OS_FREEBSD || GTEST_OS_NACL || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA || \ GTEST_OS_DRAGONFLY || GTEST_OS_GNU_KFREEBSD || GTEST_OS_OPENBSD || \ - GTEST_OS_HAIKU) + GTEST_OS_HAIKU || GTEST_OS_GNU_HURD) #endif // GTEST_HAS_PTHREAD #if GTEST_HAS_PTHREAD @@ -607,7 +604,8 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER) || GTEST_OS_WINDOWS_MINGW || \ GTEST_OS_AIX || GTEST_OS_HPUX || GTEST_OS_OPENBSD || GTEST_OS_QNX || \ GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA || \ - GTEST_OS_DRAGONFLY || GTEST_OS_GNU_KFREEBSD || GTEST_OS_HAIKU) + GTEST_OS_DRAGONFLY || GTEST_OS_GNU_KFREEBSD || GTEST_OS_HAIKU || \ + GTEST_OS_GNU_HURD) # define GTEST_HAS_DEATH_TEST 1 #endif @@ -627,7 +625,8 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; // Determines whether test results can be streamed to a socket. #if GTEST_OS_LINUX || GTEST_OS_GNU_KFREEBSD || GTEST_OS_DRAGONFLY || \ - GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_OPENBSD + GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_OPENBSD || \ + GTEST_OS_GNU_HURD # define GTEST_CAN_STREAM_RESULTS_ 1 #endif @@ -2213,22 +2212,40 @@ using TimeInMillis = int64_t; // Represents time in milliseconds. # define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver // Macros for declaring flags. -# define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name) -# define GTEST_DECLARE_int32_(name) \ - GTEST_API_ extern std::int32_t GTEST_FLAG(name) -# define GTEST_DECLARE_string_(name) \ - GTEST_API_ extern ::std::string GTEST_FLAG(name) +#define GTEST_DECLARE_bool_(name) \ + namespace testing { \ + GTEST_API_ extern bool GTEST_FLAG(name); \ + } static_assert(true, "no-op to require trailing semicolon") +#define GTEST_DECLARE_int32_(name) \ + namespace testing { \ + GTEST_API_ extern std::int32_t GTEST_FLAG(name); \ + } static_assert(true, "no-op to require trailing semicolon") +#define GTEST_DECLARE_string_(name) \ + namespace testing { \ + GTEST_API_ extern ::std::string GTEST_FLAG(name); \ + } static_assert(true, "no-op to require trailing semicolon") // Macros for defining flags. -# define GTEST_DEFINE_bool_(name, default_val, doc) \ - GTEST_API_ bool GTEST_FLAG(name) = (default_val) -# define GTEST_DEFINE_int32_(name, default_val, doc) \ - GTEST_API_ std::int32_t GTEST_FLAG(name) = (default_val) -# define GTEST_DEFINE_string_(name, default_val, doc) \ - GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val) +#define GTEST_DEFINE_bool_(name, default_val, doc) \ + namespace testing { \ + GTEST_API_ bool GTEST_FLAG(name) = (default_val); \ + } static_assert(true, "no-op to require trailing semicolon") +#define GTEST_DEFINE_int32_(name, default_val, doc) \ + namespace testing { \ + GTEST_API_ std::int32_t GTEST_FLAG(name) = (default_val); \ + } static_assert(true, "no-op to require trailing semicolon") +#define GTEST_DEFINE_string_(name, default_val, doc) \ + namespace testing { \ + GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val); \ + } static_assert(true, "no-op to require trailing semicolon") #endif // !defined(GTEST_DECLARE_bool_) +#if !defined(GTEST_FLAG_GET) +#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name) +#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value) +#endif // !defined(GTEST_FLAG_GET) + // Thread annotations #if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_) # define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks) diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-string.h b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-string.h index 10f774f9660..0f2bcbeceb2 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-string.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-string.h @@ -36,8 +36,6 @@ // This header file is #included by gtest-internal.h. // It should not be #included by other files. -// GOOGLETEST_CM0001 DO NOT DELETE - #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ diff --git a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h index b87a2e2cace..90910e99660 100644 --- a/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h +++ b/chromium/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h @@ -30,8 +30,6 @@ // Type utilities needed for implementing typed and type-parameterized // tests. -// GOOGLETEST_CM0001 DO NOT DELETE - #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ |