Remove testonly keyword

This commit is contained in:
Justine Tunney 2022-09-05 08:41:43 -07:00
parent 9be364d40a
commit d721ff8938
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
31 changed files with 78 additions and 94 deletions

View file

@ -20,16 +20,14 @@
#include "libc/str/str.h"
#include "libc/testlib/testlib.h"
testonly bool testlib_strequals(size_t cw, const void *s1, const void *s2) {
bool testlib_strequals(size_t cw, const void *s1, const void *s2) {
return testlib_strnequals(cw, s1, s2, SIZE_MAX);
}
testonly bool testlib_strnequals(size_t cw, const void *s1, const void *s2,
size_t n) {
bool testlib_strnequals(size_t cw, const void *s1, const void *s2, size_t n) {
if (s1 == s2) return true;
if (!s1 || !s2) return false;
return (cw == sizeof(wchar_t)
? wcsncmp(s1, s2, n)
: cw == sizeof(char16_t) ? strncmp16(s1, s2, n)
: strncmp(s1, s2, n)) == 0;
return (cw == sizeof(wchar_t) ? wcsncmp(s1, s2, n)
: cw == sizeof(char16_t) ? strncmp16(s1, s2, n)
: strncmp(s1, s2, n)) == 0;
}