Explain why two apparently-identical archive_read_data() calls

really should have different return values.
This commit is contained in:
Tim Kientzle 2008-08-10 03:13:42 +00:00
parent 07fe09e227
commit dde4785e50
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=181489

View File

@ -51,12 +51,14 @@ DEFINE_TEST(test_read_format_zip)
assertEqualString("file1", archive_entry_pathname(ae));
assertEqualInt(1179604289, archive_entry_mtime(ae));
assertEqualInt(18, archive_entry_size(ae));
failure("archive_read_data() returns number of bytes read");
assertEqualInt(18, archive_read_data(a, buff, 19));
assert(0 == memcmp(buff, "hello\nhello\nhello\n", 18));
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("file2", archive_entry_pathname(ae));
assertEqualInt(1179605932, archive_entry_mtime(ae));
assertEqualInt(18, archive_entry_size(ae));
failure("file2 has a bad CRC, so reading to end should fail");
assertEqualInt(ARCHIVE_WARN, archive_read_data(a, buff, 19));
assert(0 == memcmp(buff, "hello\nhello\nhello\n", 18));
assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE);