17 #include "run_tests.h" 22 static char *Label =
"called by main";
23 static char *Basename =
"";
32 MagicCookie = magic_open(MAGIC_PRESERVE_ATIME|MAGIC_MIME);
35 fprintf(stderr,
"FATAL: Failed to initialize magic cookie\n");
60 Filename =
"../testdata/testthree.zip";
61 Basename =
"testthree.zip";
63 ParentInfo PITest = {0, 1287725739, 1287725739, 0, 0};
67 FO_ASSERT_EQUAL(
exists, 1);
68 FO_ASSERT_EQUAL(
Result, 1);
82 ParentInfo PITest = {0, 1287725739, 1287725739, 0, 0};
86 FO_ASSERT_EQUAL(
exists, 1);
87 FO_ASSERT_EQUAL(
Result, 1);
102 MkDirs(
"./test-result/testdata");
103 char *cmdline =
"/bin/cp -r ../testdata/* ./test-result/testdata/";
104 returnval = system(cmdline);
107 ParentInfo PITest = {0, 1287725739, 1287725739, 0, 0};
109 Label =
"Called by dir/wait";
112 FO_ASSERT_EQUAL(
exists, 1);
113 FO_ASSERT_EQUAL(
Result, 1);
126 Basename =
"test.rpm";
128 ParentInfo PITest = {0, 1287725739, 1287725739, 0, 0};
132 FO_ASSERT_EQUAL(
exists, 1);
133 FO_ASSERT_EQUAL(
Result, 1);
148 ParentInfo PITest = {0, 1287725739, 1287725739, 0, 0};
152 FO_ASSERT_EQUAL(
exists, 0);
153 FO_ASSERT_EQUAL(
Result, 0);
static int Result
Result of calls.
void testTraverseNormal4Rpm()
normal test for rpm
int file_dir_exists(char *path_name)
test if a file or directory exists
int TraverseInit()
initialize
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 TraverseClean()
clean env and others
void testTraverseNormal4Package()
normal test for one package
CU_TestInfo Traverse_testcases[]
Traverse() test cases.
void testTraverseNullParams()
abnormal test for null parameters
char * NewDir
Test result directory.
void testTraverseNormal4Dir()
normal test for one directory
void testTraverseNormal4Package2()
normal test for one package another case
magic_t MagicCookie
for Magic
int exists
Default not exists.
int MkDirs(char *Fname)
Same as command-line "mkdir -p".
int Recurse
Level of unpack recursion. Default to infinite.