17 #include "run_tests.h" 23 static char *Fname =
"";
25 static char *
Dst = NULL;
34 Dst = (
char *)malloc(100);
57 Fname =
"../testdata/null_file";
59 strcpy(
Dst,
"./test-result/nullfile");
64 FO_ASSERT_EQUAL(
exists, 0);
65 FO_ASSERT_EQUAL(
Result, 1);
76 Fname =
"../testdata/test.ar";
78 strcpy(
Dst,
"./test-result/test.ar");
83 FO_ASSERT_EQUAL(
exists, 1);
84 FO_ASSERT_EQUAL(
Result, 0);
94 void testPruneCharFile()
96 Fname =
"../testdata/ext2file.fs";
100 FO_ASSERT_EQUAL(
exists, 0);
101 FO_ASSERT_EQUAL(
Result, 1);
static int Result
Result of calls.
int file_dir_exists(char *path_name)
test if a file or directory exists
void CopyFile(char *Source, char *Type, char *Name)
int PruneClean()
clean env and others
int PruneInit()
initialize
static char * Dst
Destination location.
char * NewDir
Test result directory.
int Prune(char *Fname, struct stat Stat)
Given a filename and its stat, prune it.
CU_TestInfo Prune_testcases[]
Prune() test cases.
void testPruneFileFileSzieIs0()
regular file, size is 0
int exists
Default not exists.
void testPruneRegFile()
regular file, size is great than 0