summaryrefslogtreecommitdiffstats
path: root/googletest/include
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@google.com>2023-02-21 18:24:42 (GMT)
committerCopybara-Service <copybara-worker@google.com>2023-02-21 18:25:39 (GMT)
commit750d67d809700ae8fca6d610f7b41b71aa161808 (patch)
tree829ffd1c82c56ee3d89d56d746b73769ee443068 /googletest/include
parent7a7231c442484be389fdf01594310349ca0e42a8 (diff)
downloadgoogletest-750d67d809700ae8fca6d610f7b41b71aa161808.zip
googletest-750d67d809700ae8fca6d610f7b41b71aa161808.tar.gz
googletest-750d67d809700ae8fca6d610f7b41b71aa161808.tar.bz2
Remove int64_t cast in RecordProperty
Historically, calls to RecordProperty with values that are convertible to int64_t have been casted to int64_t. The result was that types like float or double would be truncated when printed (e.g., 4.75 -> 4). This change removes the cast so that the types are printed in a more appropriate manner. PiperOrigin-RevId: 511238685 Change-Id: I80de5db14462da2a3e1f476086025ae514383a17
Diffstat (limited to 'googletest/include')
-rw-r--r--googletest/include/gtest/gtest.h2
1 files changed, 1 insertions, 1 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: