CS318 - Pintos
Pintos source browser for JHU CS318 course
dir-over-file.c
Go to the documentation of this file.
1 /** Tries to create a file with the same name as an existing
2  directory, which must return failure. */
3 
4 #include <syscall.h>
5 #include "tests/lib.h"
6 #include "tests/main.h"
7 
8 void
9 test_main (void)
10 {
11  CHECK (mkdir ("abc"), "mkdir \"abc\"");
12  CHECK (!create ("abc", 0), "create \"abc\" (must return false)");
13 }
lib.h
CHECK
#define CHECK(SUCCESS,...)
Takes an expression to test for SUCCESS and a message, which may include printf-style arguments.
Definition: lib.h:29
test_main
void test_main(void)
Tries to create a file with the same name as an existing directory, which must return failure.
Definition: dir-over-file.c:9
mkdir
bool mkdir(const char *dir)
Definition: syscall.c:163
main.h
create
bool create(const char *file, unsigned initial_size)
Definition: syscall.c:91