PKUOS - Pintos
Pintos source browser for PKU Operating System course
Functions | Variables
grow-file-size.c File Reference
#include <syscall.h>
#include "tests/filesys/seq-test.h"
#include "tests/lib.h"
#include "tests/main.h"
Include dependency graph for grow-file-size.c:

Go to the source code of this file.

Functions

static size_t return_block_size (void)
 
static void check_file_size (int fd, long ofs)
 
void test_main (void)
 tests/main.h More...
 

Variables

static char buf [2134]
 Grows a file from 0 bytes to 2,134 bytes, 37 bytes at a time, and checks that the file's size is reported correctly at each step. More...
 

Function Documentation

◆ check_file_size()

static void check_file_size ( int  fd,
long  ofs 
)
static

Definition at line 19 of file grow-file-size.c.

References fail(), and filesize().

Referenced by test_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ return_block_size()

static size_t return_block_size ( void  )
static

Definition at line 13 of file grow-file-size.c.

Referenced by test_main().

Here is the caller graph for this function:

◆ test_main()

void test_main ( void  )

tests/main.h

tests/main.h

tests/main.h

This must fail, because that directory is non-empty.

tests/main.h

This must fail.

tests/main.h

Then delete most of them, for two reasons. First, "tar" limits file names to 100 characters (which could be extended to 256 without much trouble). Second, a full disk has no room for the tar archive.

Definition at line 28 of file grow-file-size.c.

References buf, check_file_size(), return_block_size(), and seq_test().

Here is the call graph for this function:

Variable Documentation

◆ buf

char buf[2134]
static

Grows a file from 0 bytes to 2,134 bytes, 37 bytes at a time, and checks that the file's size is reported correctly at each step.

Definition at line 10 of file grow-file-size.c.

Referenced by test_main().