summaryrefslogtreecommitdiffstats
path: root/googletest/src
diff options
context:
space:
mode:
authorAyush Joshi <ayush854032@gmail.com>2022-01-01 13:58:21 (GMT)
committerAyush Joshi <ayush854032@gmail.com>2022-01-01 13:58:21 (GMT)
commit1b4cf359589d51bd244a779d082589536e2a6c9b (patch)
tree71fffcee460c7910169e5a6ffdcd039cb568bc5f /googletest/src
parent6b74da4757a549563d7c37c8fae3e704662a043b (diff)
downloadgoogletest-1b4cf359589d51bd244a779d082589536e2a6c9b.zip
googletest-1b4cf359589d51bd244a779d082589536e2a6c9b.tar.gz
googletest-1b4cf359589d51bd244a779d082589536e2a6c9b.tar.bz2
FIX #3719 -- Fix `clang` conversion warningsrefs/pull/3721/head
We should perform an explicit type conversion to `unsigned char` before passing the `const char` data to `IsValidXmlCharacter()` and `IsNormalizableWhitespace()` functions in order to avoid compile time conversion warnings Signed-off-by: Ayush Joshi <ayush854032@gmail.com>
Diffstat (limited to 'googletest/src')
-rw-r--r--googletest/src/gtest.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index d1ccd17..8df3cce 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -4079,8 +4079,9 @@ std::string XmlUnitTestResultPrinter::EscapeXml(
m << '"';
break;
default:
- if (IsValidXmlCharacter(ch)) {
- if (is_attribute && IsNormalizableWhitespace(ch))
+ if (IsValidXmlCharacter(static_cast<unsigned char>(ch))) {
+ if (is_attribute && IsNormalizableWhitespace(
+ static_cast<unsigned char>(ch)))
m << "&#x" << String::FormatByte(static_cast<unsigned char>(ch))
<< ";";
else
@@ -4101,7 +4102,7 @@ std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(
std::string output;
output.reserve(str.size());
for (std::string::const_iterator it = str.begin(); it != str.end(); ++it)
- if (IsValidXmlCharacter(*it))
+ if (IsValidXmlCharacter(static_cast<unsigned char>(*it)))
output.push_back(*it);
return output;