Get address sanitizer mostly working

This commit is contained in:
Justine Tunney 2020-09-03 05:44:37 -07:00
parent 1f1f3cd477
commit 7327c345f9
149 changed files with 3777 additions and 3457 deletions

View file

@ -28,6 +28,7 @@
#include "libc/x/x.h"
uint64_t i;
char pathbuf[PATH_MAX];
const char *oldpath, *bindir, *homedir, *binsh, *sh;
TEST(commandv_00, todo) { /* TODO(jart): Improve this on Windows. */
@ -51,20 +52,10 @@ TEST(commandv_010, testSlashes_wontSearchPath_butChecksAccess) {
sh = defer(unlink, gc(xasprintf("%s/sh.com", homedir)));
EXPECT_NE(-1, touch(sh, 0755));
i = g_syscount;
EXPECT_STREQ(sh, commandv(sh));
EXPECT_STREQ(sh, commandv(sh, pathbuf));
if (!IsWindows()) EXPECT_EQ(i + 1 /* access() */, g_syscount);
}
TEST(commandv_010, testNoSlashes_searchesPath_withMemoization) {
if (IsTiny()) return;
i = g_syscount;
EXPECT_STREQ(binsh, commandv("sh.com"));
if (!IsWindows()) EXPECT_GT(g_syscount, i);
i = g_syscount;
EXPECT_STREQ(binsh, commandv("sh.com"));
if (!IsWindows()) EXPECT_EQ(g_syscount, i);
}
TEST(commandv_999, teardown) {
setenv("PATH", oldpath, true);
unlink(binsh);