25 fail (
"write %zu bytes at offset %zu in \"%s\" returned %zu",
35 size_t ofs_a = 0, ofs_b = 0;
44 CHECK ((fd_a =
open (
"a")) > 1,
"open \"a\"");
45 CHECK ((fd_b =
open (
"b")) > 1,
"open \"b\"");
47 msg (
"write \"a\" and \"b\" alternately");
block_sector_t block_size(struct block *block)
Returns the number of sectors in BLOCK.
static char buf[BUF_SIZE]
static char buf_a[FILE_SIZE]
static char buf_b[FILE_SIZE]
void test_main(void)
tests/main.h
#define FILE_SIZE
Grows two files in parallel and checks that their contents are correct.
static void write_some_bytes(const char *file_name, int fd, const char *buf, size_t *ofs)
bool create(const char *file, unsigned initial_size)
int open(const char *file)
int write(int fd, const void *buffer, unsigned size)
void fail(const char *format,...)
void check_file(const char *file_name, const void *buf, size_t size)
void msg(const char *format,...)
#define CHECK(SUCCESS,...)
Takes an expression to test for SUCCESS and a message, which may include printf-style arguments.
unsigned long random_ulong(void)
Returns a pseudo-random unsigned long.
void random_bytes(void *buf_, size_t size)
Writes SIZE random bytes into BUF.
void random_init(unsigned seed)
Initializes or reinitializes the PRNG with the given SEED.
static const char file_name[]
tests/filesys/base/syn-read.h