MCPcopy Create free account
hub / github.com/apache/arrow / IsInvalidUTF8

Function IsInvalidUTF8

cpp/src/arrow/util/utf8_util_test.cc:113–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113::testing::AssertionResult IsInvalidUTF8(const std::string& s) {
114 if (!ValidateUTF8(reinterpret_cast<const uint8_t*>(s.data()), s.size())) {
115 return ::testing::AssertionSuccess();
116 } else {
117 std::string h = HexEncode(reinterpret_cast<const uint8_t*>(s.data()),
118 static_cast<int32_t>(s.size()));
119 return ::testing::AssertionFailure() << "string '" << h << "' validated as UTF8";
120 }
121}
122
123::testing::AssertionResult IsValidASCII(const std::string& s) {
124 if (ValidateAscii(reinterpret_cast<const uint8_t*>(s.data()), s.size())) {

Callers 1

AssertInvalidUTF8Function · 0.85

Calls 4

HexEncodeFunction · 0.85
ValidateUTF8Function · 0.70
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected