mirror of
https://github.com/troglobit/libite.git
synced 2026-10-06 07:23:42 +07:00
tests: Add fremove() pass to fopenf() unit test for cleanup
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user