aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/userprog/create-exists.c
blob: d395008138b3700aab17eb3efdbf769e3c3e72b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Verifies that trying to create a file under a name that
   already exists will fail. */

#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"

void
test_main (void) 
{
  CHECK (create ("quux.dat", 0), "create quux.dat");
  CHECK (create ("warble.dat", 0), "create warble.dat");
  CHECK (!create ("quux.dat", 0), "try to re-create quux.dat");
  CHECK (create ("baffle.dat", 0), "create baffle.dat");
  CHECK (!create ("warble.dat", 0), "try to re-create quux.dat");
}