diff --git a/deps/googletest/include/gtest/gtest.h b/deps/googletest/include/gtest/gtest.h index 7c003c5d60e3..28a7fa8fbc24 100644 --- a/deps/googletest/include/gtest/gtest.h +++ b/deps/googletest/include/gtest/gtest.h @@ -300,12 +300,12 @@ class GTEST_API_ [[nodiscard]] Test { // global context (before or after invocation of RUN_ALL_TESTS and from // SetUp/TearDown method of Environment objects registered with Google // Test) will be output as attributes of the element. - static void RecordProperty(const std::string& key, const std::string& value); + static void RecordProperty(std::string_view key, std::string_view value); // We do not define a custom serialization except for values that can be // converted to int64_t, but other values could be logged in this way. template ::value, bool> = true> - static void RecordProperty(const std::string& key, const T& value) { + static void RecordProperty(std::string_view key, const T& value) { RecordProperty(key, (Message() << value).GetString()); } @@ -376,7 +376,7 @@ class [[nodiscard]] TestProperty { // C'tor. TestProperty does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestProperty object. - TestProperty(const std::string& a_key, const std::string& a_value) + TestProperty(std::string_view a_key, std::string_view a_value) : key_(a_key), value_(a_value) {} // Gets the user supplied key. @@ -386,7 +386,7 @@ class [[nodiscard]] TestProperty { const char* value() const { return value_.c_str(); } // Sets a new value, overriding the one supplied in the constructor. - void SetValue(const std::string& new_value) { value_ = new_value; } + void SetValue(std::string_view new_value) { value_ = new_value; } private: // The key supplied by the user. @@ -1261,7 +1261,7 @@ class GTEST_API_ [[nodiscard]] UnitTest { // from SetUpTestSuite or TearDownTestSuite, or to the global property set // when invoked elsewhere. If the result already contains a property with // the same key, the value will be updated. - void RecordProperty(const std::string& key, const std::string& value); + void RecordProperty(std::string_view key, std::string_view value); // Gets the i-th test suite among all the test suites. i can range from 0 to // total_test_suite_count() - 1. If i is not in that range, returns NULL. diff --git a/deps/googletest/include/gtest/internal/gtest-port.h b/deps/googletest/include/gtest/internal/gtest-port.h index 3b2947b852e7..081b2facdaea 100644 --- a/deps/googletest/include/gtest/internal/gtest-port.h +++ b/deps/googletest/include/gtest/internal/gtest-port.h @@ -676,7 +676,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; #if defined(GTEST_OS_WINDOWS_MOBILE) || defined(GTEST_OS_WINDOWS_PHONE) || \ defined(GTEST_OS_WINDOWS_RT) || defined(GTEST_OS_WINDOWS_GAMES) || \ defined(GTEST_OS_ESP8266) || defined(GTEST_OS_XTENSA) || \ - defined(GTEST_OS_QURT) || !GTEST_HAS_FILE_SYSTEM + defined(GTEST_OS_QURT) || defined(__wasi__) || !GTEST_HAS_FILE_SYSTEM #define GTEST_HAS_STREAM_REDIRECTION 0 #else #define GTEST_HAS_STREAM_REDIRECTION 1 @@ -706,8 +706,9 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; // Created by default when Death tests are supported, but other platforms can // use the Premature exit file without Death test support (e.g. for detecting // crashes). -#if GTEST_HAS_DEATH_TEST || \ - (defined(GTEST_OS_EMSCRIPTEN) && GTEST_HAS_FILE_SYSTEM) +#if GTEST_HAS_DEATH_TEST || \ + ((defined(GTEST_OS_EMSCRIPTEN) || defined(GTEST_OS_IOS)) && \ + GTEST_HAS_FILE_SYSTEM) #define GTEST_INTERNAL_HAS_PREMATURE_EXIT_FILE 1 #endif diff --git a/deps/googletest/src/gtest.cc b/deps/googletest/src/gtest.cc index d66756e88f54..88b478e80836 100644 --- a/deps/googletest/src/gtest.cc +++ b/deps/googletest/src/gtest.cc @@ -2565,7 +2565,7 @@ void Test::SetUp() {} void Test::TearDown() {} // Allows user supplied key value pairs to be recorded for later output. -void Test::RecordProperty(const std::string& key, const std::string& value) { +void Test::RecordProperty(std::string_view key, std::string_view value) { UnitTest::GetInstance()->RecordProperty(key, value); } @@ -5528,8 +5528,7 @@ void UnitTest::AddTestPartResult(TestPartResult::Type result_type, // from SetUpTestSuite or TearDownTestSuite, or to the global property set // when invoked elsewhere. If the result already contains a property with // the same key, the value will be updated. -void UnitTest::RecordProperty(const std::string& key, - const std::string& value) { +void UnitTest::RecordProperty(std::string_view key, std::string_view value) { impl_->RecordProperty(TestProperty(key, value)); }