11 static char *Label =
"called by main";
12 static char *Basename =
"";
21 MagicCookie = magic_open(MAGIC_PRESERVE_ATIME|MAGIC_MIME);
24 fprintf(stderr,
"FATAL: Failed to initialize magic cookie\n");
49 Filename =
"../testdata/testthree.zip";
50 Basename =
"testthree.zip";
52 ParentInfo PITest = {0, 1287725739, 1287725739, 0, 0};
56 FO_ASSERT_EQUAL(
exists, 1);
57 FO_ASSERT_EQUAL(
Result, 1);
71 ParentInfo PITest = {0, 1287725739, 1287725739, 0, 0};
75 FO_ASSERT_EQUAL(
exists, 1);
76 FO_ASSERT_EQUAL(
Result, 1);
91 MkDirs(
"./test-result/testdata");
92 char *cmdline =
"/bin/cp -r ../testdata/* ./test-result/testdata/";
93 returnval = system(cmdline);
96 ParentInfo PITest = {0, 1287725739, 1287725739, 0, 0};
98 Label =
"Called by dir/wait";
101 FO_ASSERT_EQUAL(
exists, 1);
102 FO_ASSERT_EQUAL(
Result, 1);
115 Basename =
"test.rpm";
117 ParentInfo PITest = {0, 1287725739, 1287725739, 0, 0};
121 FO_ASSERT_EQUAL(
exists, 1);
122 FO_ASSERT_EQUAL(
Result, 1);
137 ParentInfo PITest = {0, 1287725739, 1287725739, 0, 0};
141 FO_ASSERT_EQUAL(
exists, 0);
142 FO_ASSERT_EQUAL(
Result, 0);
magic_t MagicCookie
for Magic
static int Result
Result of calls.
void testTraverseNormal4Package()
normal test for one package
void testTraverseNullParams()
abnormal test for null parameters
CU_TestInfo Traverse_testcases[]
Traverse() test cases.
void testTraverseNormal4Rpm()
normal test for rpm
int TraverseClean()
clean env and others
int TraverseInit()
initialize
void testTraverseNormal4Dir()
normal test for one directory
void testTraverseNormal4Package2()
normal test for one package another case
int Traverse(char *Filename, char *Basename, char *Label, char *NewDir, int Recurse, ParentInfo *PI)
Find all files, traverse all directories. This is a depth-first search, in inode order!
int MkDirs(char *Fname)
Same as command-line "mkdir -p".
int file_dir_exists(char *path_name)
test if a file or directory exists
int exists
Default not exists.
int Recurse
Level of unpack recursion. Default to infinite.
char * NewDir
Test result directory.