Skip to content

Commit

Permalink
Self-test lwan_char_isspace() too, using memchr()
Browse files Browse the repository at this point in the history
  • Loading branch information
lpereira committed May 10, 2024
1 parent 292d7ac commit 5342311
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib/lwan-tables.c
Expand Up @@ -336,7 +336,6 @@ LWAN_SELF_TEST(compare_with_ctype)
assert(!!isdigit((char)i) == !!lwan_char_isdigit((char)i));
assert(!!isalpha((char)i) == !!lwan_char_isalpha((char)i));
assert(!!isalnum((char)i) == !!lwan_char_isalnum((char)i));

/* isspace() and lwan_char_isspace() differs on purpose */
assert(!!memchr(" \t\n\r", i, 4) == !!lwan_char_isspace((char)i));
}
}

0 comments on commit 5342311

Please sign in to comment.