Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libc/cmake/modules/LLVMLibCTestRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ endfunction()

function(_get_hermetic_test_compile_options output_var)
_get_common_test_compile_options(compile_options "" "")
list(APPEND compile_options "-DLIBC_TEST=HERMETIC")

# null check tests are death tests, remove from hermetic tests for now.
if(LIBC_ADD_NULL_CHECKS)
Expand Down Expand Up @@ -232,6 +233,7 @@ function(create_libc_unittest fq_target_name)

_get_common_test_compile_options(compile_options "${LIBC_UNITTEST_C_TEST}"
"${LIBC_UNITTEST_FLAGS}")
list(APPEND compile_options "-DLIBC_TEST=UNIT")
# TODO: Ideally we would have a separate function for link options.
set(link_options
${compile_options}
Expand Down
9 changes: 9 additions & 0 deletions libc/test/UnitTest/Test.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,13 @@
libc_errno = 0; \
} while (0)

// Some macro utility to append file names with LIBC_TEST macro's value to be
// used in stdio tests.
#undef STR
#undef EVAL_THEN_STR
#define STR(X) #X
#define EVAL_THEN_STR(X) STR(X)

#define APPEND_LIBC_TEST(X) X "." EVAL_THEN_STR(LIBC_TEST)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be combined with libc_make_test_file_path in future


#endif // LLVM_LIBC_TEST_UNITTEST_TEST_H
20 changes: 13 additions & 7 deletions libc/test/src/__support/File/platform_file_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ LIBC_INLINE File *openfile(const char *file_name, const char *mode) {
}

TEST(LlvmLibcPlatformFileTest, CreateWriteCloseAndReadBack) {
constexpr char FILENAME[] = "testdata/create_write_close_and_readback.test";
constexpr char FILENAME[] =
APPEND_LIBC_TEST("testdata/create_write_close_and_readback.test");
File *file = openfile(FILENAME, "w");
ASSERT_FALSE(file == nullptr);
ASSERT_EQ(file->write(TEXT, TEXT_SIZE).value, TEXT_SIZE);
Expand All @@ -42,7 +43,8 @@ TEST(LlvmLibcPlatformFileTest, CreateWriteCloseAndReadBack) {
}

TEST(LlvmLibcPlatformFileTest, CreateWriteSeekAndReadBack) {
constexpr char FILENAME[] = "testdata/create_write_seek_and_readback.test";
constexpr char FILENAME[] =
APPEND_LIBC_TEST("testdata/create_write_seek_and_readback.test");
File *file = openfile(FILENAME, "w+");
ASSERT_FALSE(file == nullptr);
ASSERT_EQ(file->write(TEXT, TEXT_SIZE).value, TEXT_SIZE);
Expand All @@ -62,7 +64,8 @@ TEST(LlvmLibcPlatformFileTest, CreateWriteSeekAndReadBack) {
}

TEST(LlvmLibcPlatformFileTest, CreateAppendCloseAndReadBack) {
constexpr char FILENAME[] = "testdata/create_append_close_and_readback.test";
constexpr char FILENAME[] =
APPEND_LIBC_TEST("testdata/create_append_close_and_readback.test");
File *file = openfile(FILENAME, "w");
ASSERT_FALSE(file == nullptr);
ASSERT_EQ(file->write(TEXT, TEXT_SIZE).value, TEXT_SIZE);
Expand Down Expand Up @@ -91,7 +94,8 @@ TEST(LlvmLibcPlatformFileTest, CreateAppendCloseAndReadBack) {
}

TEST(LlvmLibcPlatformFileTest, CreateAppendSeekAndReadBack) {
constexpr char FILENAME[] = "testdata/create_append_seek_and_readback.test";
constexpr char FILENAME[] =
APPEND_LIBC_TEST("testdata/create_append_seek_and_readback.test");
File *file = openfile(FILENAME, "w");
ASSERT_FALSE(file == nullptr);
ASSERT_EQ(file->write(TEXT, TEXT_SIZE).value, TEXT_SIZE);
Expand Down Expand Up @@ -124,7 +128,7 @@ TEST(LlvmLibcPlatformFileTest, LargeFile) {
for (size_t i = 0; i < DATA_SIZE; ++i)
write_data[i] = BYTE;

constexpr char FILENAME[] = "testdata/large_file.test";
constexpr char FILENAME[] = APPEND_LIBC_TEST("testdata/large_file.test");
File *file = openfile(FILENAME, "w");
ASSERT_FALSE(file == nullptr);

Expand All @@ -151,7 +155,8 @@ TEST(LlvmLibcPlatformFileTest, LargeFile) {
}

TEST(LlvmLibcPlatformFileTest, ReadSeekCurAndRead) {
constexpr char FILENAME[] = "testdata/read_seek_cur_and_read.test";
constexpr char FILENAME[] =
APPEND_LIBC_TEST("testdata/read_seek_cur_and_read.test");
File *file = openfile(FILENAME, "w");
ASSERT_FALSE(file == nullptr);
constexpr char CONTENT[] = "1234567890987654321";
Expand All @@ -178,7 +183,8 @@ TEST(LlvmLibcPlatformFileTest, ReadSeekCurAndRead) {
}

TEST(LlvmLibcPlatformFileTest, IncorrectOperation) {
constexpr char FILENAME[] = "testdata/incorrect_operation.test";
constexpr char FILENAME[] =
APPEND_LIBC_TEST("testdata/incorrect_operation.test");
char data[1] = {123};

File *file = openfile(FILENAME, "w");
Expand Down
9 changes: 6 additions & 3 deletions libc/test/src/stdio/fdopen_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ using LlvmLibcStdioFdopenTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;

TEST_F(LlvmLibcStdioFdopenTest, WriteAppendRead) {
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
constexpr const char *TEST_FILE_NAME = "testdata/write_read_append.test";
constexpr const char *TEST_FILE_NAME =
APPEND_LIBC_TEST("testdata/write_read_append.test");
auto TEST_FILE = libc_make_test_file_path(TEST_FILE_NAME);
int fd = LIBC_NAMESPACE::open(TEST_FILE, O_CREAT | O_TRUNC | O_RDWR, S_IRWXU);
auto *fp = LIBC_NAMESPACE::fdopen(fd, "w");
Expand Down Expand Up @@ -54,7 +55,8 @@ TEST_F(LlvmLibcStdioFdopenTest, WriteAppendRead) {
}

TEST_F(LlvmLibcStdioFdopenTest, InvalidFd) {
constexpr const char *TEST_FILE_NAME = "testdata/invalid_fd.test";
constexpr const char *TEST_FILE_NAME =
APPEND_LIBC_TEST("testdata/invalid_fd.test");
auto TEST_FILE = libc_make_test_file_path(TEST_FILE_NAME);
int fd = LIBC_NAMESPACE::open(TEST_FILE, O_CREAT | O_TRUNC);
LIBC_NAMESPACE::close(fd);
Expand All @@ -65,7 +67,8 @@ TEST_F(LlvmLibcStdioFdopenTest, InvalidFd) {
}

TEST_F(LlvmLibcStdioFdopenTest, InvalidMode) {
constexpr const char *TEST_FILE_NAME = "testdata/invalid_mode.test";
constexpr const char *TEST_FILE_NAME =
APPEND_LIBC_TEST("testdata/invalid_mode.test");
auto TEST_FILE = libc_make_test_file_path(TEST_FILE_NAME);
int fd = LIBC_NAMESPACE::open(TEST_FILE, O_CREAT | O_RDONLY, S_IRWXU);
ASSERT_ERRNO_SUCCESS();
Expand Down
5 changes: 3 additions & 2 deletions libc/test/src/stdio/fgetc_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ class LlvmLibcGetcTest : public LIBC_NAMESPACE::testing::ErrnoCheckingTest {
};

TEST_F(LlvmLibcGetcTest, WriteAndReadCharactersWithFgetc) {
test_with_func(&LIBC_NAMESPACE::fgetc, "testdata/fgetc.test");
test_with_func(&LIBC_NAMESPACE::fgetc,
APPEND_LIBC_TEST("testdata/fgetc.test"));
}

TEST_F(LlvmLibcGetcTest, WriteAndReadCharactersWithGetc) {
test_with_func(&LIBC_NAMESPACE::getc, "testdata/getc.test");
test_with_func(&LIBC_NAMESPACE::getc, APPEND_LIBC_TEST("testdata/getc.test"));
}
5 changes: 3 additions & 2 deletions libc/test/src/stdio/fgetc_unlocked_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ class LlvmLibcGetcTest : public LIBC_NAMESPACE::testing::ErrnoCheckingTest {

TEST_F(LlvmLibcGetcTest, WriteAndReadCharactersWithFgetcUnlocked) {
test_with_func(&LIBC_NAMESPACE::fgetc_unlocked,
"testdata/fgetc_unlocked.test");
APPEND_LIBC_TEST("testdata/fgetc_unlocked.test"));
}

TEST_F(LlvmLibcGetcTest, WriteAndReadCharactersWithGetcUnlocked) {
test_with_func(&LIBC_NAMESPACE::getc_unlocked, "testdata/getc_unlocked.test");
test_with_func(&LIBC_NAMESPACE::getc_unlocked,
APPEND_LIBC_TEST("testdata/getc_unlocked.test"));
}
2 changes: 1 addition & 1 deletion libc/test/src/stdio/fgets_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ using LlvmLibcFgetsTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
using namespace LIBC_NAMESPACE::testing::ErrnoSetterMatcher;

TEST_F(LlvmLibcFgetsTest, WriteAndReadCharacters) {
constexpr char FILENAME[] = "testdata/fgets.test";
constexpr char FILENAME[] = APPEND_LIBC_TEST("testdata/fgets.test");
::FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w");
ASSERT_FALSE(file == nullptr);
constexpr char CONTENT[] = "123456789\n"
Expand Down
7 changes: 4 additions & 3 deletions libc/test/src/stdio/fileop_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::NE;
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::returns;

TEST_F(LlvmLibcFILETest, SimpleFileOperations) {
constexpr char FILENAME[] = "testdata/simple_operations.test";
constexpr char FILENAME[] =
APPEND_LIBC_TEST("testdata/simple_operations.test");
::FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w");
ASSERT_FALSE(file == nullptr);
ASSERT_GE(LIBC_NAMESPACE::fileno(file), 0);
Expand Down Expand Up @@ -127,7 +128,7 @@ TEST_F(LlvmLibcFILETest, SimpleFileOperations) {
}

TEST_F(LlvmLibcFILETest, FFlush) {
constexpr char FILENAME[] = "testdata/fflush.test";
constexpr char FILENAME[] = APPEND_LIBC_TEST("testdata/fflush.test");
::FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w+");
ASSERT_FALSE(file == nullptr);
constexpr char CONTENT[] = "1234567890987654321";
Expand All @@ -154,7 +155,7 @@ TEST_F(LlvmLibcFILETest, FOpenFWriteSizeGreaterThanOne) {
};
constexpr MyStruct WRITE_DATA[] = {{'a', 1}, {'b', 2}, {'c', 3}};
constexpr size_t WRITE_NMEMB = sizeof(WRITE_DATA) / sizeof(MyStruct);
constexpr char FILENAME[] = "testdata/fread_fwrite.test";
constexpr char FILENAME[] = APPEND_LIBC_TEST("testdata/fread_fwrite.test");

FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w");
ASSERT_FALSE(file == nullptr);
Expand Down
6 changes: 4 additions & 2 deletions libc/test/src/stdio/fopen_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
TEST(LlvmLibcFOpenTest, PrintToFile) {
int result;

FILE *file = LIBC_NAMESPACE::fopen("./testdata/test_data.txt", "w");
FILE *file =
LIBC_NAMESPACE::fopen(APPEND_LIBC_TEST("testdata/test.txt"), "w");
ASSERT_FALSE(file == nullptr);

static constexpr char STRING[] = "A simple string written to a file\n";
Expand All @@ -26,7 +27,8 @@ TEST(LlvmLibcFOpenTest, PrintToFile) {

ASSERT_EQ(0, LIBC_NAMESPACE::fclose(file));

FILE *new_file = LIBC_NAMESPACE::fopen("./testdata/test_data.txt", "r");
FILE *new_file =
LIBC_NAMESPACE::fopen(APPEND_LIBC_TEST("testdata/test.txt"), "r");
ASSERT_FALSE(new_file == nullptr);

static char data[64] = {0};
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/stdio/fprintf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using ::fread;
} // namespace printf_test

TEST(LlvmLibcFPrintfTest, WriteToFile) {
const char *FILENAME = "fprintf_output.test";
const char *FILENAME = APPEND_LIBC_TEST("fprintf_output.test");
auto FILE_PATH = libc_make_test_file_path(FILENAME);

::FILE *file = printf_test::fopen(FILE_PATH, "w");
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/stdio/fscanf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using ::fwrite;
} // namespace scanf_test

TEST(LlvmLibcFScanfTest, WriteToFile) {
const char *FILENAME = "fscanf_output.test";
const char *FILENAME = APPEND_LIBC_TEST("fscanf_output.test");
auto FILE_PATH = libc_make_test_file_path(FILENAME);
::FILE *file = scanf_test::fopen(FILE_PATH, "w");
ASSERT_FALSE(file == nullptr);
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/stdio/ftell_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class LlvmLibcFTellTest : public LIBC_NAMESPACE::testing::Test {
protected:
void test_with_bufmode(int bufmode) {
constexpr char FILENAME[] = "testdata/ftell.test";
constexpr char FILENAME[] = APPEND_LIBC_TEST("testdata/ftell.test");
// We will set a special buffer to the file so that we guarantee buffering.
constexpr size_t BUFFER_SIZE = 1024;
char buffer[BUFFER_SIZE];
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/stdio/putc_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "test/UnitTest/Test.h"

TEST(LlvmLibcPutcTest, WriteToFile) {
constexpr char FILENAME[] = "testdata/putc_output.test";
constexpr char FILENAME[] = APPEND_LIBC_TEST("testdata/putc_output.test");
::FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w");
ASSERT_FALSE(file == nullptr);

Expand Down
4 changes: 2 additions & 2 deletions libc/test/src/stdio/remove_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TEST_F(LlvmLibcRemoveTest, CreateAndRemoveFile) {
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;

constexpr const char *FILENAME = "remove.test.file";
constexpr const char *FILENAME = APPEND_LIBC_TEST("remove.test.file");
auto TEST_FILE = libc_make_test_file_path(FILENAME);
int fd = LIBC_NAMESPACE::open(TEST_FILE, O_WRONLY | O_CREAT, S_IRWXU);
ASSERT_ERRNO_SUCCESS();
Expand All @@ -42,7 +42,7 @@ TEST_F(LlvmLibcRemoveTest, CreateAndRemoveDir) {
// it was removed.
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
constexpr const char *FILENAME = "remove.test.dir";
constexpr const char *FILENAME = APPEND_LIBC_TEST("remove.test.dir");
auto TEST_DIR = libc_make_test_file_path(FILENAME);
ASSERT_THAT(LIBC_NAMESPACE::mkdirat(AT_FDCWD, TEST_DIR, S_IRWXU),
Succeeds(0));
Expand Down
6 changes: 3 additions & 3 deletions libc/test/src/stdio/rename_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ TEST_F(LlvmLibcRenameTest, CreateAndRenameFile) {
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;

constexpr const char *FILENAME0 = "rename.test.file0";
constexpr const char *FILENAME0 = APPEND_LIBC_TEST("rename.test.file0");
auto TEST_FILEPATH0 = libc_make_test_file_path(FILENAME0);

int fd = LIBC_NAMESPACE::open(TEST_FILEPATH0, O_WRONLY | O_CREAT, S_IRWXU);
Expand All @@ -33,7 +33,7 @@ TEST_F(LlvmLibcRenameTest, CreateAndRenameFile) {
ASSERT_THAT(LIBC_NAMESPACE::close(fd), Succeeds(0));
ASSERT_THAT(LIBC_NAMESPACE::access(TEST_FILEPATH0, F_OK), Succeeds(0));

constexpr const char *FILENAME1 = "rename.test.file1";
constexpr const char *FILENAME1 = APPEND_LIBC_TEST("rename.test.file1");
auto TEST_FILEPATH1 = libc_make_test_file_path(FILENAME1);
ASSERT_THAT(LIBC_NAMESPACE::rename(TEST_FILEPATH0, TEST_FILEPATH1),
Succeeds(0));
Expand All @@ -44,7 +44,7 @@ TEST_F(LlvmLibcRenameTest, CreateAndRenameFile) {
TEST_F(LlvmLibcRenameTest, RenameNonExistent) {
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;

constexpr const char *FILENAME1 = "rename.test.file1";
constexpr const char *FILENAME1 = APPEND_LIBC_TEST("rename.test.file1");
auto TEST_FILEPATH1 = libc_make_test_file_path(FILENAME1);

ASSERT_THAT(LIBC_NAMESPACE::rename("non-existent", TEST_FILEPATH1),
Expand Down
6 changes: 4 additions & 2 deletions libc/test/src/stdio/setbuf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
TEST(LlvmLibcSetbufTest, DefaultBufsize) {
// The idea in this test is to change the buffer after opening a file and
// ensure that read and write work as expected.
constexpr char FILENAME[] = "testdata/setbuf_test_default_bufsize.test";
constexpr char FILENAME[] =
APPEND_LIBC_TEST("testdata/setbuf_test_default_bufsize.test");
::FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w");
ASSERT_FALSE(file == nullptr);
char buffer[BUFSIZ];
Expand All @@ -41,7 +42,8 @@ TEST(LlvmLibcSetbufTest, DefaultBufsize) {
TEST(LlvmLibcSetbufTest, NullBuffer) {
// The idea in this test is that we set a null buffer and ensure that
// everything works correctly.
constexpr char FILENAME[] = "testdata/setbuf_test_null_buffer.test";
constexpr char FILENAME[] =
APPEND_LIBC_TEST("testdata/setbuf_test_null_buffer.test");
::FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w");
ASSERT_FALSE(file == nullptr);
LIBC_NAMESPACE::setbuf(file, nullptr);
Expand Down
7 changes: 4 additions & 3 deletions libc/test/src/stdio/setvbuf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TEST_F(LlvmLibcSetvbufTest, SetNBFBuffer) {
// then set a NBF buffer to the write handle. Since it is NBF, the data
// written using the write handle should be immediately readable by the read
// handle.
constexpr char FILENAME[] = "testdata/setvbuf_nbf.test";
constexpr char FILENAME[] = APPEND_LIBC_TEST("testdata/setvbuf_nbf.test");

::FILE *fw = LIBC_NAMESPACE::fopen(FILENAME, "w");
ASSERT_FALSE(fw == nullptr);
Expand Down Expand Up @@ -59,7 +59,7 @@ TEST_F(LlvmLibcSetvbufTest, SetLBFBuffer) {
// then set a LBF buffer to the write handle. Since it is LBF, the data
// written using the write handle should be available right after a '\n' is
// written.
constexpr char FILENAME[] = "testdata/setvbuf_lbf.test";
constexpr char FILENAME[] = APPEND_LIBC_TEST("testdata/setvbuf_lbf.test");

::FILE *fw = LIBC_NAMESPACE::fopen(FILENAME, "w");
ASSERT_FALSE(fw == nullptr);
Expand Down Expand Up @@ -96,7 +96,8 @@ TEST_F(LlvmLibcSetvbufTest, SetLBFBuffer) {
}

TEST(LlvmLibcSetbufTest, InvalidBufferMode) {
constexpr char FILENAME[] = "testdata/setvbuf_invalid_bufmode.test";
constexpr char FILENAME[] =
APPEND_LIBC_TEST("testdata/setvbuf_invalid_bufmode.test");
::FILE *f = LIBC_NAMESPACE::fopen(FILENAME, "w");
ASSERT_FALSE(f == nullptr);
char buf[BUFSIZ];
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/stdio/ungetc_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "test/UnitTest/Test.h"

TEST(LlvmLibcUngetcTest, UngetAndReadBack) {
constexpr char FILENAME[] = "testdata/ungetc_test.test";
constexpr char FILENAME[] = APPEND_LIBC_TEST("testdata/ungetc_test.test");
::FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w");
ASSERT_FALSE(file == nullptr);
constexpr char CONTENT[] = "abcdef";
Expand Down
3 changes: 2 additions & 1 deletion libc/test/src/stdio/unlocked_fileop_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
using LlvmLibcFILETest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;

TEST_F(LlvmLibcFILETest, UnlockedReadAndWrite) {
constexpr char fNAME[] = "testdata/unlocked_read_and_write.test";
constexpr char fNAME[] =
APPEND_LIBC_TEST("testdata/unlocked_read_and_write.test");
::FILE *f = LIBC_NAMESPACE::fopen(fNAME, "w");
ASSERT_FALSE(f == nullptr);
constexpr char CONTENT[] = "1234567890987654321";
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/stdio/vfprintf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int call_vfprintf(::FILE *__restrict stream, const char *__restrict format,
}

TEST(LlvmLibcVFPrintfTest, WriteToFile) {
const char *FILENAME = "vfprintf_output.test";
const char *FILENAME = APPEND_LIBC_TEST("vfprintf_output.test");
auto FILE_PATH = libc_make_test_file_path(FILENAME);

::FILE *file = printf_test::fopen(FILE_PATH, "w");
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/stdio/vfscanf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static int call_vfscanf(::FILE *stream, const char *__restrict format, ...) {
}

TEST(LlvmLibcVFScanfTest, WriteToFile) {
const char *FILENAME = "vfscanf_output.test";
const char *FILENAME = APPEND_LIBC_TEST("vfscanf_output.test");
auto FILE_PATH = libc_make_test_file_path(FILENAME);
::FILE *file = scanf_test::fopen(FILE_PATH, "w");
ASSERT_FALSE(file == nullptr);
Expand Down
Loading