mirror of
https://github.com/troglobit/libite.git
synced 2026-11-06 15:50:57 +00:00
tests: Add fremove() pass to fopenf() unit test for cleanup
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
16ea69adb4
commit
f85ff3c835
1 file changed
+7
@@ -6,6 +6,7 @@ int main(void)
|
|||||||
char *dir = "/tmp";
|
char *dir = "/tmp";
|
||||||
char *file = "__foo__";
|
char *file = "__foo__";
|
||||||
|
|
||||||
|
printf("Pass 1/2: fopenf() ===========================\n");
|
||||||
fp = fopenf("w", "%s/%s", dir, file);
|
fp = fopenf("w", "%s/%s", dir, file);
|
||||||
if (fp) {
|
if (fp) {
|
||||||
fputs("foo", fp);
|
fputs("foo", fp);
|
||||||
@@ -14,5 +15,11 @@ int main(void)
|
|||||||
|
|
||||||
fail_unless(fexist("/tmp/__foo__"));
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user