From a782f919e80393edcd7a2cb6564ab6c05b05ace5 Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Sun, 4 Apr 2010 01:43:17 -0400 Subject: [PATCH] fwrite is marked w/ check return, thus doing make check results in build failures due to -Werror forced in trunk. assert the fwrite return to fix the issue, and more importantly the extremely unlikely scenario where the write doesn't manage to flush the desired size (if this isn't caught, it'll result in weird failures further in the tests) SVN-Revision: 2059 --- libarchive/test/test_fuzz.c | 2 +- tar/test/test_option_T_upper.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libarchive/test/test_fuzz.c b/libarchive/test/test_fuzz.c index 088bb9d95..bb38fcf4e 100644 --- a/libarchive/test/test_fuzz.c +++ b/libarchive/test/test_fuzz.c @@ -143,7 +143,7 @@ DEFINE_TEST(test_fuzz) * If we crash, that file will be useful. */ f = fopen("after.test.failure.send.this.file." "to.libarchive.maintainers.with.system.details", "wb"); - fwrite(image, 1, (size_t)size, f); + assertEqualInt((size_t)size, fwrite(image, 1, (size_t)size, f)); fclose(f); assert((a = archive_read_new()) != NULL); diff --git a/tar/test/test_option_T_upper.c b/tar/test/test_option_T_upper.c index 99554f029..94cd8cca0 100644 --- a/tar/test/test_option_T_upper.c +++ b/tar/test/test_option_T_upper.c @@ -79,12 +79,12 @@ DEFINE_TEST(test_option_T_upper) return; /* Use null-terminated names. */ fprintf(f, "d1/d2/f3"); - fwrite("\0", 1, 1, f); + assertEqualInt(1, fwrite("\0", 1, 1, f)); fprintf(f, "d1/d2/f5"); - fwrite("\0", 1, 1, f); + assertEqualInt(1, fwrite("\0", 1, 1, f)); if (gnarlyFilesSupported) { fprintf(f, "d1/d2/f\x0a"); - fwrite("\0", 1, 1, f); + assertEqualInt(1, fwrite("\0", 1, 1, f)); } fclose(f); -- 2.47.3