6 #include "fileHandlingTest.h" /* required because of the h.in thingy */
13 const char * filename,
14 enum DirectoryType argument
17 const char srcdir[] = SRCDIR_DEF;//"@abs_srcdir@/data/";
18 size_t plen = sizeof(srcdir) + strlen(filename) + 1;
19 char * path = emalloc(plen);
24 retc = snprintf(path, plen, "%s%s", srcdir, filename);
25 if (retc <= 0 || (size_t)retc >= plen)
36 /* use a union to get terminally rid of the 'const' attribute */
52 fseek(file, 0L, SEEK_END);
53 int length = ftell(file);
54 fseek(file, 0L, SEEK_SET);
68 char actualLine[1024];
69 char expectedLine[1024];
70 size_t lenAct = sizeof actualLine;
71 size_t lenExp = sizeof expectedLine;
73 while ( ( (fgets(actualLine, lenAct, actual)) != NULL)
74 && ( (fgets(expectedLine, lenExp, expected)) != NULL )
78 if( strcmp(actualLine,expectedLine) !=0 ){
79 printf("Comparision failed on line %d",currentLine);
95 if (!truncate(filename, 0))