summaryrefslogtreecommitdiffstats
path: root/src/tests/filesys/extended/grow-dir.inc
blob: bee0ba0dd45b1472d1c0ccabcf8129f374ceb606 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* -*- 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;
    }
}