Get address sanitizer mostly working
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user