| 132 | } |
| 133 | |
| 134 | ::testing::AssertionResult IsInvalidASCII(const std::string& s) { |
| 135 | if (!ValidateAscii(reinterpret_cast<const uint8_t*>(s.data()), s.size())) { |
| 136 | return ::testing::AssertionSuccess(); |
| 137 | } else { |
| 138 | std::string h = HexEncode(reinterpret_cast<const uint8_t*>(s.data()), |
| 139 | static_cast<int32_t>(s.size())); |
| 140 | return ::testing::AssertionFailure() << "string '" << h << "' validated as ASCII"; |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | template <typename ValidationFunc> |
| 145 | void ValidateWithPrefixes(ValidationFunc&& validate, const std::string& s) { |
no test coverage detected