tests: Add fremove() pass to fopenf() unit test for cleanup

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2020-04-27 23:18:47 +02:00
parent 16ea69adb4
commit f85ff3c835
+7
View File
@@ -6,6 +6,7 @@ int main(void)
char *dir = "/tmp";
char *file = "__foo__";
printf("Pass 1/2: fopenf() ===========================\n");
fp = fopenf("w", "%s/%s", dir, file);
if (fp) {
fputs("foo", fp);
@@ -14,5 +15,11 @@ int main(void)
fail_unless(fexist("/tmp/__foo__"));
printf("Pass 2/2: fremove() ==========================\n");
fremove("%s/%s", dir, file);
fail_unless(!fexist("/tmp/__foo__"));
printf("DONE =========================================\n");
return 0;
}