Update arg_def_case_fuzz.cc

This commit is contained in:
Gabriel Rasskin 2020-07-23 14:27:15 -07:00 committed by GitHub
parent a2866288eb
commit 7b232a3ee4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,12 +28,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
tensorflow::StringPiece sp(char_data, size);
tensorflow::str_util::ArgDefCase(sp);
for (const auto &c : sp) {
std::string ns = tensorflow::str_util::ArgDefCase(sp);
for (const auto &c : ns) {
const bool is_letter = 'a' <= c && c <= 'z';
const bool is_digit = '0' <= c && c <= '9';
if (!is_letter && !is_digit) {
printf("Got '%c'\n", c);
assert(c == '_');
}
}