diff -r f600b0d1fc5d -r faab25d520dd test/harness/testcase.c --- a/test/harness/testcase.c Fri Jan 27 10:30:16 2012 +0000 +++ b/test/harness/testcase.c Fri Jan 27 16:18:02 2012 +0000 @@ -21,23 +21,23 @@ char *s; for(;;) { - s=str_dup(template); + s=g_strdup(template); mktemp(s); if (!*s) { errno=EEXIST; - mem_free(s); + g_free(s); return -1; } fd=open(s,O_RDWR|O_CREAT|O_EXCL,0600); if (fd>0) { strcpy(template,s); - mem_free(s); + g_free(s); return fd; } else - mem_free(s); + g_free(s); } } #endif /* !HAVE_MKSTEMP */ @@ -100,16 +100,16 @@ * TRUE on pass or expected-fail. * Suitable message(s) will be printed in all cases. */ -boolean testcase_run(Testcase *testcase) +gboolean testcase_run(Testcase *testcase) { - boolean r; + gboolean r; int fd,exit_status,col; size_t n,pos,offset,header_len; FILE *fp; char input[]="TEST-XXXXXX"; char *endp,*bol; char *command[3]; - String *expected,*report; + GString *expected,*report; char *output; fd=mkstemp(input); if (testcase->input) @@ -126,7 +126,7 @@ close(fd); command[0]=getenv("BOOKLOUPE"); if (!command[0]) - command[0]="." BL_DIR_SEPARATOR_S "bookloupe"; + command[0]="." G_DIR_SEPARATOR_S "bookloupe"; command[1]=input; command[2]=NULL; if (testcase->expected) @@ -141,11 +141,11 @@ return FALSE; if (testcase->expected) { - expected=string_new("\n\nFile: "); - string_append(expected,input); - string_append(expected,"\n\n\n"); + expected=g_string_new("\n\nFile: "); + g_string_append(expected,input); + g_string_append(expected,"\n\n\n"); header_len=expected->len; - string_append(expected,testcase->expected); + g_string_append(expected,testcase->expected); } else { @@ -163,8 +163,8 @@ endp=strchr(output+offset,'\n'); if (!endp) endp=output+strlen(output); - report=string_new(NULL); - string_append_len(report,output,endp-output); + report=g_string_new(NULL); + g_string_append_len(report,output,endp-output); bol=strrchr(report->str,'\n'); if (bol) bol++; @@ -176,14 +176,14 @@ fprintf(stderr,"%s\n%*s^\n",report->str+header_len,col,""); else fprintf(stderr,"%s\n%*s^\n",report->str,col,""); - string_free(report,TRUE); + g_string_free(report,TRUE); } - string_free(expected,TRUE); - mem_free(output); + g_string_free(expected,TRUE); + g_free(output); return FALSE; } - string_free(expected,TRUE); - mem_free(output); + g_string_free(expected,TRUE); + g_free(output); if (exit_status) fprintf(stderr,"bookloupe exited with code %d\n",r); if (!exit_status) @@ -196,8 +196,8 @@ */ void testcase_free(Testcase *testcase) { - mem_free(testcase->basename); - mem_free(testcase->input); - mem_free(testcase->expected); - mem_free(testcase); + g_free(testcase->basename); + g_free(testcase->input); + g_free(testcase->expected); + g_free(testcase); }