17 #include "run_tests.h" 33 deleteTmpFiles(
"./test-result/");
35 FO_ASSERT_EQUAL(
exists, 0);
36 Filename =
"../testdata/ext2file.fs";
37 MkDirs(
"./test-result/ext2file.fs.dir");
40 FO_ASSERT_EQUAL(
Result, 0);
41 FO_ASSERT_EQUAL(
exists, 1);
52 deleteTmpFiles(
"./test-result/");
54 FO_ASSERT_EQUAL(
exists, 0);
55 Filename =
"../testdata/ext3file.fs";
56 MkDirs(
"./test-result/ext3file.fs");
59 FO_ASSERT_EQUAL(
Result, 0);
60 FO_ASSERT_EQUAL(
exists, 1);
72 deleteTmpFiles(
"./test-result/");
74 FO_ASSERT_EQUAL(
exists, 0);
75 Filename =
"../testdata/ext2file.fs";
76 MkDirs(
"./test-result/ext2file.fs.dir");
79 FO_ASSERT_EQUAL(
Result, 1);
80 FO_ASSERT_EQUAL(
exists, 0);
91 deleteTmpFiles(
"./test-result/");
93 FO_ASSERT_EQUAL(
exists, 0);
95 MkDirs(
"./test-result/fatfile.fs.dir");
98 FO_ASSERT_EQUAL(
Result, 0);
99 FO_ASSERT_EQUAL(
exists, 1);
110 deleteTmpFiles(
"./test-result/");
112 FO_ASSERT_EQUAL(
exists, 0);
113 Filename =
"../testdata/ntfsfile.fs";
114 MkDirs(
"./test-result/ntfsfile.fs.dir");
117 FO_ASSERT_EQUAL(
Result, 0);
118 FO_ASSERT_EQUAL(
exists, 1);
123 static char *Name = NULL;
131 Name = (
char *)malloc(100);
152 strcpy(Name,
"Fossology\0");
154 FO_ASSERT_EQUAL(strcmp(Name,
"fossology"), 0);
167 strcpy(Name,
"Fosso\0");
169 FO_ASSERT_EQUAL(strcmp(Name,
"fosso"), 0);
171 strcpy(Name,
"FOSSOLOGY HELLO\0");
173 FO_ASSERT_EQUAL(strcmp(Name,
"fossology hello"), 0);
184 strcpy(Name,
"Fosso (hello)");
186 FO_ASSERT_EQUAL(strcmp(Name,
"fosso"), 0);
199 FO_ASSERT_EQUAL(strcmp(Name,
""), 0);
static int Result
Result of calls.
int file_dir_exists(char *path_name)
test if a file or directory exists
int FatDiskNameInit()
initialize
CU_TestInfo ununpack_disk_testcases[]
Disk image test cases.
void FatDiskName(char *Name)
Special handling for FAT names.
int ExtractDisk(char *Source, char *FStype, char *Destination)
Given a disk image, type of system, and a directory, extract all files!
void testExtractDisk4Fat()
unpack disk image, fat
void testFatDiskNameNameEmpty()
Convert to lowercase.
void testFatDiskName1()
Convert to lowercase.
void testFatDiskName3()
Convert to lowercase.
void testExtractDisk4Ext2()
unpack disk image, ext2
void testExtractDisk4Ext2FstypeUnknow()
unpack disk image, ext2, FStype is unknown
void testExtractDisk4Ext3()
unpack disk image, ext3
int FatDiskNameClean()
clean env and others
void testExtractDisk4Ntfs()
unpack disk image, ntfs
int exists
Default not exists.
int MkDirs(char *Fname)
Same as command-line "mkdir -p".
void testFatDiskName2()
Convert to lowercase.