mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +00:00
Remove testonly
keyword
This commit is contained in:
parent
9be364d40a
commit
d721ff8938
31 changed files with 78 additions and 94 deletions
|
@ -26,7 +26,7 @@
|
|||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
testonly void OnUsr1(int sig) {
|
||||
void OnUsr1(int sig) {
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
│ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN │
|
||||
│ THE SOFTWARE. │
|
||||
└─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/pushpop.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/intrin/pushpop.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/math.h"
|
||||
#include "libc/mem/mem.h"
|
||||
|
@ -541,14 +541,14 @@ TEST(sprintf, test_snprintf) {
|
|||
EXPECT_STREQ("-1", buffer);
|
||||
}
|
||||
|
||||
testonly void vsnprintf_builder_1(char *buf, ...) {
|
||||
void vsnprintf_builder_1(char *buf, ...) {
|
||||
va_list args;
|
||||
va_start(args, buf);
|
||||
vsnprintf(buf, 100U, "%d", args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
testonly void vsnprintf_builder_3(char *buf, ...) {
|
||||
void vsnprintf_builder_3(char *buf, ...) {
|
||||
va_list args;
|
||||
va_start(args, buf);
|
||||
vsnprintf(buf, 100U, "%d %d %s", args);
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/mem/critbit0.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/mem/critbit0.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
|
@ -29,25 +29,25 @@ struct Bog {
|
|||
const char *p[];
|
||||
};
|
||||
|
||||
static testonly dontdiscard struct Bog *NewBog(unsigned n) {
|
||||
static dontdiscard struct Bog *NewBog(unsigned n) {
|
||||
struct Bog *res = malloc(sizeof(struct Bog) + sizeof(const char *) * n);
|
||||
res->i = 0;
|
||||
res->n = n;
|
||||
return res;
|
||||
}
|
||||
|
||||
static testonly void ClearBog(struct Bog *bog) {
|
||||
static void ClearBog(struct Bog *bog) {
|
||||
bog->i = 0;
|
||||
}
|
||||
|
||||
static testonly void FreeBog(struct Bog **bog) {
|
||||
static void FreeBog(struct Bog **bog) {
|
||||
free(*bog), *bog = NULL;
|
||||
}
|
||||
|
||||
static const char *const elems[] = {"a", "aa", "aaz", "abz",
|
||||
"bba", "bbc", "bbd", NULL};
|
||||
|
||||
testonly static void MakeTree(struct critbit0 *tree) {
|
||||
static void MakeTree(struct critbit0 *tree) {
|
||||
memset(tree, 0, sizeof(*tree));
|
||||
for (unsigned i = 0; elems[i]; ++i) {
|
||||
ASSERT_EQ(true, critbit0_insert(tree, elems[i]));
|
||||
|
@ -84,7 +84,7 @@ TEST(critbit0, testDelete) {
|
|||
critbit0_clear(&tree);
|
||||
}
|
||||
|
||||
static testonly intptr_t allprefixed_cb(const char *elem, void *arg) {
|
||||
static intptr_t allprefixed_cb(const char *elem, void *arg) {
|
||||
struct Bog *bog = arg;
|
||||
ASSERT_LT(bog->i, bog->n);
|
||||
bog->p[bog->i++] = elem;
|
||||
|
@ -110,7 +110,7 @@ TEST(critbit0, testAllPrefixed) {
|
|||
FreeBog(&a);
|
||||
}
|
||||
|
||||
static testonly intptr_t allprefixed_cb_halt(const char *elem, void *arg) {
|
||||
static intptr_t allprefixed_cb_halt(const char *elem, void *arg) {
|
||||
struct Bog *bog = arg;
|
||||
ASSERT_LT(bog->i, bog->n);
|
||||
bog->p[bog->i++] = elem;
|
||||
|
|
|
@ -489,14 +489,14 @@ TEST(wcsncmp, testTwosComplementBane) {
|
|||
│ test/libc/str/strcmp_test.c § benchmarks ─╬─│┼
|
||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||
|
||||
testonly dontinline int strcmp_pure(const char *a, const char *b) {
|
||||
dontinline int strcmp_pure(const char *a, const char *b) {
|
||||
for (; *a == *b; a++, b++) {
|
||||
if (!*a) break;
|
||||
}
|
||||
return (*a & 0xff) - (*b & 0xff);
|
||||
}
|
||||
|
||||
testonly dontinline int strcasecmp_pure(const char *a, const char *b) {
|
||||
dontinline int strcasecmp_pure(const char *a, const char *b) {
|
||||
for (; *a && *b; a++, b++) {
|
||||
if (!(*a == *b || tolower(*a & 0xff) == tolower(*b & 0xff))) {
|
||||
break;
|
||||
|
|
|
@ -28,7 +28,7 @@ textstartup static void strftime_test_init(void) {
|
|||
}
|
||||
const void *const strftime_test_ctor[] initarray = {strftime_test_init};
|
||||
|
||||
testonly char *FormatTime(const char *fmt, struct tm *tm) {
|
||||
char *FormatTime(const char *fmt, struct tm *tm) {
|
||||
static char buf[64];
|
||||
strftime(buf, sizeof(buf), fmt, tm);
|
||||
return &buf[0];
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "test/libc/xed/lib.h"
|
||||
#include "third_party/xed/x86.h"
|
||||
|
||||
testonly dontdiscard uint8_t *unbingx86op(const char16_t *codez) {
|
||||
dontdiscard uint8_t *unbingx86op(const char16_t *codez) {
|
||||
size_t len;
|
||||
len = strlen16(codez);
|
||||
return unbingbuf(xmalloc(ROUNDUP(len, 16)), len, codez, 0x90);
|
||||
|
@ -34,7 +34,7 @@ testonly dontdiscard uint8_t *unbingx86op(const char16_t *codez) {
|
|||
/**
|
||||
* Long mode instruction length decoder.
|
||||
*/
|
||||
testonly int ild(const char16_t *codez) {
|
||||
int ild(const char16_t *codez) {
|
||||
int error;
|
||||
struct XedDecodedInst xedd;
|
||||
error = xed_instruction_length_decode(
|
||||
|
@ -46,7 +46,7 @@ testonly int ild(const char16_t *codez) {
|
|||
/**
|
||||
* Real mode instruction length decoder.
|
||||
*/
|
||||
testonly int ildreal(const char16_t *codez) {
|
||||
int ildreal(const char16_t *codez) {
|
||||
int error;
|
||||
struct XedDecodedInst xedd;
|
||||
error = xed_instruction_length_decode(
|
||||
|
@ -58,7 +58,7 @@ testonly int ildreal(const char16_t *codez) {
|
|||
/**
|
||||
* Legacy mode instruction length decoder.
|
||||
*/
|
||||
testonly int ildlegacy(const char16_t *codez) {
|
||||
int ildlegacy(const char16_t *codez) {
|
||||
int error;
|
||||
struct XedDecodedInst xedd;
|
||||
error = xed_instruction_length_decode(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue