diff options
Diffstat (limited to 'googletest')
-rw-r--r-- | googletest/include/gtest/gtest-printers.h | 5 | ||||
-rw-r--r-- | googletest/include/gtest/gtest.h | 2 | ||||
-rw-r--r-- | googletest/include/gtest/internal/gtest-death-test-internal.h | 2 | ||||
-rw-r--r-- | googletest/include/gtest/internal/gtest-internal.h | 2 | ||||
-rw-r--r-- | googletest/include/gtest/internal/gtest-port.h | 5 | ||||
-rw-r--r-- | googletest/src/gtest.cc | 7 | ||||
-rw-r--r-- | googletest/test/googletest-json-outfiles-test.py | 10 | ||||
-rw-r--r-- | googletest/test/gtest_xml_outfile2_test_.cc | 4 | ||||
-rwxr-xr-x | googletest/test/gtest_xml_outfiles_test.py | 10 |
9 files changed, 28 insertions, 19 deletions
diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index 7d7e77c..739d545 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -306,9 +306,10 @@ template <typename T> void PrintWithFallback(const T& value, ::std::ostream* os) { using Printer = typename FindFirstPrinter< T, void, ContainerPrinter, FunctionPointerPrinter, PointerPrinter, + ProtobufPrinter, internal_stream_operator_without_lexical_name_lookup::StreamPrinter, - ProtobufPrinter, ConvertibleToIntegerPrinter, - ConvertibleToStringViewPrinter, RawBytesPrinter, FallbackPrinter>::type; + ConvertibleToIntegerPrinter, ConvertibleToStringViewPrinter, + RawBytesPrinter, FallbackPrinter>::type; Printer::PrintValue(value, os); } diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h index 35c0802..6fdf552 100644 --- a/googletest/include/gtest/gtest.h +++ b/googletest/include/gtest/gtest.h @@ -302,7 +302,7 @@ class GTEST_API_ Test { 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) { - RecordProperty(key, (Message() << static_cast<int64_t>(value)).GetString()); + RecordProperty(key, (Message() << value).GetString()); } protected: diff --git a/googletest/include/gtest/internal/gtest-death-test-internal.h b/googletest/include/gtest/internal/gtest-death-test-internal.h index 4687dae..21f3d29 100644 --- a/googletest/include/gtest/internal/gtest-death-test-internal.h +++ b/googletest/include/gtest/internal/gtest-death-test-internal.h @@ -238,7 +238,7 @@ inline Matcher<const ::std::string&> MakeDeathTestMatcher( } \ break; \ case ::testing::internal::DeathTest::EXECUTE_TEST: { \ - ::testing::internal::DeathTest::ReturnSentinel gtest_sentinel( \ + const ::testing::internal::DeathTest::ReturnSentinel gtest_sentinel( \ gtest_dt); \ GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \ gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \ diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index e1eb2b5..7339504 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -900,8 +900,10 @@ class HasDebugStringAndShortDebugString { HasDebugStringType::value && HasShortDebugStringType::value; }; +#ifdef GTEST_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL template <typename T> constexpr bool HasDebugStringAndShortDebugString<T>::value; +#endif // 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 ae7fb35..5cea3e0 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -2447,4 +2447,9 @@ using Variant = ::std::variant<T...>; #endif // __has_include #endif // GTEST_HAS_ABSL +#if defined(GTEST_INTERNAL_CPLUSPLUS_LANG) && \ + GTEST_INTERNAL_CPLUSPLUS_LANG < 201703L +#define GTEST_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL 1 +#endif + #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index a60a042..fb578d5 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -5409,6 +5409,8 @@ int UnitTest::Run() { in_death_test_child_process ? nullptr : internal::posix::GetEnv("TEST_PREMATURE_EXIT_FILE")); +#else + const bool in_death_test_child_process = false; #endif // GTEST_HAS_DEATH_TEST // Captures the value of GTEST_FLAG(catch_exceptions). This value will be @@ -5456,6 +5458,8 @@ int UnitTest::Run() { } #endif } +#else + (void)in_death_test_child_process; // Needed inside the #if block above #endif // GTEST_OS_WINDOWS return internal::HandleExceptionsInMethodIfSupported( @@ -6663,8 +6667,7 @@ void ParseGoogleTestFlagsOnly(int* argc, char** argv) { if (*argc > 0) { // absl::ParseCommandLine() requires *argc > 0. auto positional_args = absl::flags_internal::ParseCommandLineImpl( - *argc, argv, absl::flags_internal::ArgvListAction::kRemoveParsedArgs, - absl::flags_internal::UsageFlagsAction::kHandleUsage, + *argc, argv, absl::flags_internal::UsageFlagsAction::kHandleUsage, absl::flags_internal::OnUndefinedFlag::kReportUndefined); // Any command-line positional arguments not part of any command-line flag // (or arguments to a flag) are copied back out to argv, with the program diff --git a/googletest/test/googletest-json-outfiles-test.py b/googletest/test/googletest-json-outfiles-test.py index 83a56de..ff15722 100644 --- a/googletest/test/googletest-json-outfiles-test.py +++ b/googletest/test/googletest-json-outfiles-test.py @@ -88,7 +88,7 @@ EXPECTED_2 = { 'time': '*', 'timestamp': '*', 'testsuite': [{ - 'name': 'TestInt64Properties', + 'name': 'TestInt64ConvertibleProperties', 'file': 'gtest_xml_outfile2_test_.cc', 'line': 41, 'status': 'RUN', @@ -97,11 +97,11 @@ EXPECTED_2 = { 'time': '*', 'classname': 'PropertyTwo', 'SetUpProp': '2', - 'TestFloatProperty': '3', - 'TestDoubleProperty': '4', + 'TestFloatProperty': '3.25', + 'TestDoubleProperty': '4.75', 'TestSizetProperty': '5', - 'TestBoolProperty': '1', - 'TestCharProperty': '65', + 'TestBoolProperty': 'true', + 'TestCharProperty': 'A', 'TestInt16Property': '6', 'TestInt32Property': '7', 'TestInt64Property': '8', diff --git a/googletest/test/gtest_xml_outfile2_test_.cc b/googletest/test/gtest_xml_outfile2_test_.cc index 5ee216d..ed58dc8 100644 --- a/googletest/test/gtest_xml_outfile2_test_.cc +++ b/googletest/test/gtest_xml_outfile2_test_.cc @@ -38,9 +38,7 @@ class PropertyTwo : public testing::Test { void TearDown() override { RecordProperty("TearDownProp", 2); } }; -TEST_F(PropertyTwo, TestInt64Properties) { - // Floats and doubles are written as int64_t, so we test that the values - // written are truncated to int64_t. +TEST_F(PropertyTwo, TestInt64ConvertibleProperties) { float float_prop = 3.25; RecordProperty("TestFloatProperty", float_prop); diff --git a/googletest/test/gtest_xml_outfiles_test.py b/googletest/test/gtest_xml_outfiles_test.py index 7ee0f3c..50291b0 100755 --- a/googletest/test/gtest_xml_outfiles_test.py +++ b/googletest/test/gtest_xml_outfiles_test.py @@ -57,14 +57,14 @@ EXPECTED_XML_1 = """<?xml version="1.0" encoding="UTF-8"?> EXPECTED_XML_2 = """<?xml version="1.0" encoding="UTF-8"?> <testsuites tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*" name="AllTests"> <testsuite name="PropertyTwo" tests="1" failures="0" skipped="0" disabled="0" errors="0" time="*" timestamp="*"> - <testcase name="TestInt64Properties" file="gtest_xml_outfile2_test_.cc" line="41" status="run" result="completed" time="*" timestamp="*" classname="PropertyTwo"> + <testcase name="TestInt64ConvertibleProperties" file="gtest_xml_outfile2_test_.cc" line="41" status="run" result="completed" time="*" timestamp="*" classname="PropertyTwo"> <properties> <property name="SetUpProp" value="2"/> - <property name="TestFloatProperty" value="3"/> - <property name="TestDoubleProperty" value="4"/> + <property name="TestFloatProperty" value="3.25"/> + <property name="TestDoubleProperty" value="4.75"/> <property name="TestSizetProperty" value="5"/> - <property name="TestBoolProperty" value="1"/> - <property name="TestCharProperty" value="65"/> + <property name="TestBoolProperty" value="true"/> + <property name="TestCharProperty" value="A"/> <property name="TestInt16Property" value="6"/> <property name="TestInt32Property" value="7"/> <property name="TestInt64Property" value="8"/> |