summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/test/test_read_format_zip.c
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-01-01 22:28:04 +0000
committerkientzle <kientzle@FreeBSD.org>2008-01-01 22:28:04 +0000
commit02ff80aa514f0bbb5712a71b96f5593ada26bb80 (patch)
tree0719828e5aab493661568e13eaa8b2aa062e27da /lib/libarchive/test/test_read_format_zip.c
parentf89bbe213dfe121e5c9af00662285358ab07dc81 (diff)
downloadFreeBSD-src-02ff80aa514f0bbb5712a71b96f5593ada26bb80.zip
FreeBSD-src-02ff80aa514f0bbb5712a71b96f5593ada26bb80.tar.gz
Extensive improvements to the libarchive_test test program that
exercises and verifies the libarchive APIs: * Improved error reporting; hexdumps are now provided for many file/memory content differences. * Overall status more clearly counts "tests" and "assertions" * Reference files can now be stored on disk instead of having to be compiled into the test program itself. A couple of tests have been converted to this more natural structure. * Several memory leaks corrected so that leaks within libarchive itself can be more easily detected and diagnosed. * New test: GNU tar compatibility * New test: Zip compatibility * New test: Zero-byte writes to a compressed archive entry * New test: archive_entry_strmode() format verification * New test: mtree reader * New test: write/read of large (2G - 1TB) entries to tar archives (thanks to recent performance work, this test only requires a few seconds) * New test: detailed format verification of cpio odc and newc writers * Many minor additions/improvements to existing tests as well.
Diffstat (limited to 'lib/libarchive/test/test_read_format_zip.c')
-rw-r--r--lib/libarchive/test/test_read_format_zip.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libarchive/test/test_read_format_zip.c b/lib/libarchive/test/test_read_format_zip.c
index 96caf85..02592b4 100644
--- a/lib/libarchive/test/test_read_format_zip.c
+++ b/lib/libarchive/test/test_read_format_zip.c
@@ -48,6 +48,9 @@ DEFINE_TEST(test_read_format_zip)
struct archive_entry *ae;
struct archive *a;
char *buff[128];
+ const void *pv;
+ size_t s;
+ off_t o;
assert((a = archive_read_new()) != NULL);
assertA(0 == archive_read_support_compression_all(a));
@@ -57,6 +60,9 @@ DEFINE_TEST(test_read_format_zip)
assertEqualString("dir/", archive_entry_pathname(ae));
assertEqualInt(1179604249, archive_entry_mtime(ae));
assertEqualInt(0, archive_entry_size(ae));
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_data_block(a, &pv, &s, &o));
+ assertEqualInt(s, 0);
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("file1", archive_entry_pathname(ae));
assertEqualInt(1179604289, archive_entry_mtime(ae));
OpenPOWER on IntegriCloud