mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Remove testonly
keyword
This commit is contained in:
parent
9be364d40a
commit
d721ff8938
31 changed files with 78 additions and 94 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue