11static void remove_tree (
int at,
int bt,
int ct,
int dt);
28 msg (
"removing /0/0/0/0 through /%d/%d/%d/%d...",
29 at - 1, bt - 1, ct - 1, dt - 1);
31 for (a = 0; a < at; a++)
33 for (b = 0; b < bt; b++)
35 for (c = 0; c < ct; c++)
37 for (d = 0; d < dt; d++)
47 snprintf (
try,
sizeof (
try),
"/%d/%d/%d/%d", at - 1, 0, ct - 1, 0);
48 CHECK (
open (
try) == -1,
"open \"%s\" (must return -1)",
try);
#define PRINTF_FORMAT(FMT, FIRST)
static void do_remove(const char *format,...) PRINTF_FORMAT(1
void test_main(void)
tests/main.h
static void remove_tree(int at, int bt, int ct, int dt)
Creates directories /0/0/0 through /3/2/2 and files in the leaf directories, then removes them.
int vsnprintf(char *buffer, size_t buf_size, const char *format, va_list args)
Like vprintf(), except that output is stored into BUFFER, which must have space for BUF_SIZE characte...
int snprintf(char *buffer, size_t buf_size, const char *format,...)
Like printf(), except that output is stored into BUFFER, which must have space for BUF_SIZE character...
int open(const char *file)
bool remove(const char *file)
void msg(const char *format,...)
#define CHECK(SUCCESS,...)
Takes an expression to test for SUCCESS and a message, which may include printf-style arguments.
static void static void void make_tree(int at, int bt, int ct, int dt)
tests/filesys/extended/mk-tree.h
#define va_start(LIST, ARG)
__builtin_va_list va_list
GCC has <stdarg.h> functionality as built-ins, so all we need is to use it.