diff options
author | dmauro <dmauro@google.com> | 2021-11-09 21:35:30 (GMT) |
---|---|---|
committer | dinord <dino.radakovich@gmail.com> | 2021-11-10 22:21:00 (GMT) |
commit | 6c8a386513b70cb43df997b6406ae5c39f5c9b88 (patch) | |
tree | 117fb9161b9e674b7a2e19fe5d6e4111f6fd11cd /googletest/src | |
parent | 79efd968bf7edb60667314750e101bbf99a0494e (diff) | |
download | googletest-6c8a386513b70cb43df997b6406ae5c39f5c9b88.zip googletest-6c8a386513b70cb43df997b6406ae5c39f5c9b88.tar.gz googletest-6c8a386513b70cb43df997b6406ae5c39f5c9b88.tar.bz2 |
Googletest export
Explicitly used unsigned chars for testing for valid XML characters
PiperOrigin-RevId: 408692969
Diffstat (limited to 'googletest/src')
-rw-r--r-- | googletest/src/gtest.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 3eb9505..103c445 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -3934,12 +3934,13 @@ class XmlUnitTestResultPrinter : public EmptyTestEventListener { private: // Is c a whitespace character that is normalized to a space character // when it appears in an XML attribute value? - static bool IsNormalizableWhitespace(char c) { - return c == 0x9 || c == 0xA || c == 0xD; + static bool IsNormalizableWhitespace(unsigned char c) { + return c == '\t' || c == '\n' || c == '\r'; } // May c appear in a well-formed XML document? - static bool IsValidXmlCharacter(char c) { + // https://www.w3.org/TR/REC-xml/#charsets + static bool IsValidXmlCharacter(unsigned char c) { return IsNormalizableWhitespace(c) || c >= 0x20; } |