Googletest export

Explicitly used unsigned chars for testing for valid XML characters

PiperOrigin-RevId: 408692969
This commit is contained in:
dmauro 2021-11-09 16:35:30 -05:00 committed by dinord
parent 79efd968bf
commit 6c8a386513

View File

@ -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;
}