Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions deps/googletest/include/gtest/gtest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <testsuites> 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 <typename T, std::enable_if_t<std::is_convertible<T, int64_t>::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());
}

Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions deps/googletest/include/gtest/internal/gtest-port.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions deps/googletest/src/gtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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));
}

Expand Down
Loading