test.c: remove file related code

This commit is contained in:
Max Bruckner 2017-01-16 14:53:16 +01:00
parent bb60d6def5
commit 86be961bb5

39
test.c
View File

@ -45,37 +45,6 @@ static void doit(char *text)
}
}
#if 0
/* Read a file, parse, render back, etc. */
static void dofile(char *filename)
{
FILE *f = NULL;
long len = 0;
char *data = NULL;
/* open in read binary mode */
f = fopen(filename,"rb");
/* get the length */
fseek(f, 0, SEEK_END);
len = ftell(f);
fseek(f, 0, SEEK_SET);
data = (char*)malloc(len + 1);
if (data == NULL)
{
printf("Failed to allocate memory.\n");
exit(1);
}
fread(data, 1, len, f);
data[len] = '\0';
fclose(f);
doit(data);
free(data);
}
#endif
/* Used by some code below as an example datatype. */
struct record
{
@ -393,14 +362,6 @@ int main(void)
doit(text5);
doit(text6);
/* Parse standard testfiles: */
/* dofile("../../tests/test1"); */
/* dofile("../../tests/test2"); */
/* dofile("../../tests/test3"); */
/* dofile("../../tests/test4"); */
/* dofile("../../tests/test5"); */
/* dofile("../../tests/test6"); */
/* Now some samplecode for building objects concisely: */
create_objects();