6 #include "fileHandlingTest.h" //required because of the h.in thingy
17 //extern const char srcdir[];
20 CreatePath(const char* filename, enum DirectoryType argument) {
21 const char srcdir[] = SRCDIR_DEF;//"@abs_srcdir@/data/";
22 char * path = emalloc (sizeof (char) * (strlen(srcdir) + 256));
27 strcat(path, filename);
34 GetFileSize(FILE *file) {
35 fseek(file, 0L, SEEK_END);
36 int length = ftell(file);
37 fseek(file, 0L, SEEK_SET);
44 CompareFileContent(FILE* expected, FILE* actual) {
47 char actualLine[1024];
48 char expectedLine[1024];
49 size_t lenAct = sizeof actualLine;
50 size_t lenExp = sizeof expectedLine;
52 while ( ( (fgets(actualLine, lenAct, actual)) != NULL)
53 && ( (fgets(expectedLine, lenExp, expected)) != NULL )
57 if( strcmp(actualLine,expectedLine) !=0 ){
58 printf("Comparision failed on line %d",currentLine);
70 ClearFile(const char * filename) {
71 if (!truncate(filename, 0))