This repository has been archived on 2021-05-26. You can view files and clone it, but cannot push or open issues or pull requests.
OS/pintos-env/pintos/tests/filesys/extended/grow-dir.inc

42 lines
769 B
PHP
Raw Permalink Normal View History

/* -*- c -*- */
#include <syscall.h>
#include <stdio.h>
#include "tests/filesys/seq-test.h"
#include "tests/lib.h"
#include "tests/main.h"
static char buf[512];
static size_t
return_block_size (void)
{
return sizeof buf;
}
void
test_main (void)
{
size_t i;
#ifdef DIRECTORY
CHECK (mkdir (DIRECTORY), "mkdir %s", DIRECTORY);
#define DIR_PREFIX DIRECTORY "/"
#else
#define DIR_PREFIX ""
#endif
for (i = 0; i < FILE_CNT; i++)
{
char file_name[128];
snprintf (file_name, sizeof file_name, "%sfile%zu", DIR_PREFIX, i);
msg ("creating and checking \"%s\"", file_name);
quiet = true;
seq_test (file_name,
buf, sizeof buf, sizeof buf,
return_block_size, NULL);
quiet = false;
}
}