diff options
Diffstat (limited to 'lib/libc/tests')
-rw-r--r-- | lib/libc/tests/stdio/fmemopen2_test.c | 2 | ||||
-rw-r--r-- | lib/libc/tests/stdio/freopen_test.c | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/tests/stdio/fmemopen2_test.c b/lib/libc/tests/stdio/fmemopen2_test.c index 62831fb..6b6392d 100644 --- a/lib/libc/tests/stdio/fmemopen2_test.c +++ b/lib/libc/tests/stdio/fmemopen2_test.c @@ -249,12 +249,14 @@ ATF_TC_BODY(test_append_binary_pos, tc) FILE *fp; fp = fmemopen(NULL, 16, "ab+"); + ATF_REQUIRE(fp != NULL); ATF_REQUIRE(ftell(fp) == 0L); fclose(fp); /* Make sure that a pre-allocated buffer behaves correctly. */ char buf[] = "Hello"; fp = fmemopen(buf, sizeof(buf), "ab+"); + ATF_REQUIRE(fp != NULL); ATF_REQUIRE(ftell(fp) == strlen(buf)); fclose(fp); } diff --git a/lib/libc/tests/stdio/freopen_test.c b/lib/libc/tests/stdio/freopen_test.c index 1719927..8ca4719 100644 --- a/lib/libc/tests/stdio/freopen_test.c +++ b/lib/libc/tests/stdio/freopen_test.c @@ -48,7 +48,6 @@ runtest(const char *fname1, const char *mode1, const char *fname2, "fopen(\"%s\", \"%s\") failed; errno=%d", fname1, mode1, errno); fp2 = freopen(fname2, mode2, fp1); if (fp2 == NULL) { - fclose(fp1); ATF_REQUIRE_MSG(success == false, "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) succeeded " "unexpectedly", fname2_print, mode2, fname1, mode1); |