From f85ff3c835db1905127de05636ca427b66a7f5f3 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 27 Apr 2020 23:18:47 +0200 Subject: [PATCH] tests: Add fremove() pass to fopenf() unit test for cleanup Signed-off-by: Joachim Nilsson --- tests/fopenf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/fopenf.c b/tests/fopenf.c index 7b89b02..4fcf035 100644 --- a/tests/fopenf.c +++ b/tests/fopenf.c @@ -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; }