diff options
-rw-r--r-- | googletest/include/gtest/gtest.h | 2 | ||||
-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 |
4 files changed, 12 insertions, 14 deletions
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/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"/> |