diff options
author | des <des@FreeBSD.org> | 2008-06-26 11:50:11 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2008-06-26 11:50:11 +0000 |
commit | 3ac85717e48dd195448daba2007df75feac6879e (patch) | |
tree | 7c8c3e18d8a699c07548b1de3f80d21a36431bed /lib/libarchive | |
parent | cec42b7b1305fd4f08eb2532223bce22f3c4ce04 (diff) | |
download | FreeBSD-src-3ac85717e48dd195448daba2007df75feac6879e.zip FreeBSD-src-3ac85717e48dd195448daba2007df75feac6879e.tar.gz |
Add regression test for CRC32 check. The test file has been modified to
include an invalid checksum for file2.
Approved by: kientzle
Diffstat (limited to 'lib/libarchive')
-rw-r--r-- | lib/libarchive/test/test_read_format_zip.c | 5 | ||||
-rw-r--r-- | lib/libarchive/test/test_read_format_zip.zip.uu | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/libarchive/test/test_read_format_zip.c b/lib/libarchive/test/test_read_format_zip.c index 8493ca5..707391c 100644 --- a/lib/libarchive/test/test_read_format_zip.c +++ b/lib/libarchive/test/test_read_format_zip.c @@ -51,17 +51,18 @@ DEFINE_TEST(test_read_format_zip) assertEqualString("file1", archive_entry_pathname(ae)); assertEqualInt(1179604289, archive_entry_mtime(ae)); assertEqualInt(18, archive_entry_size(ae)); - assertEqualInt(18, archive_read_data(a, buff, 18)); + 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)); - assertEqualInt(18, archive_read_data(a, buff, 18)); + 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); assertA(archive_format(a) == ARCHIVE_FORMAT_ZIP); assert(0 == archive_read_close(a)); + #if ARCHIVE_API_VERSION > 1 assert(0 == archive_read_finish(a)); #else diff --git a/lib/libarchive/test/test_read_format_zip.zip.uu b/lib/libarchive/test/test_read_format_zip.zip.uu index f61340e..fafbd8d 100644 --- a/lib/libarchive/test/test_read_format_zip.zip.uu +++ b/lib/libarchive/test/test_read_format_zip.zip.uu @@ -1,13 +1,13 @@ $FreeBSD$ -begin 645 test_read_format_zip.zip +begin 644 test_read_format_zip.zip M4$L#!`H``````%EFLS8````````````````$`!4`9&ER+U54"0`#&55/1AE5 M3T95>`0`Z`/H`U!+`P04````"`!O9K,V.C=F/0H````2````!0`5`&9I;&4Q M550)``-!54]&K%M/1E5X!`#H`^@#RTC-R<GGRD`B`5!+`P04````"`!::K,V -M.C=F/0H````2````!0`5`&9I;&4R550)``.L6T]&K%M/1E5X!`#H`^@#RTC- +M>%8T$@H````2````!0`5`&9I;&4R550)``.L6T]&K%M/1E5X!`#H`^@#RTC- MR<GGRD`B`5!+`0(7`PH``````%EFLS8````````````````$``T````````` M$`#M00````!D:7(O550%``,954]&57@``%!+`0(7`Q0````(`&]FLS8Z-V8] M"@```!(````%``T```````$```"D@3<```!F:6QE,554!0`#055/1E5X``!0 -M2P$"%P,4````"`!::K,V.C=F/0H````2````!0`-```````!````I(%Y```` +M2P$"%P,4````"`!::K,V>%8T$@H````2````!0`-```````!````I(%Y```` H9FEL93)55`4``ZQ;3T95>```4$L%!@`````#``,`OP```+L````````` ` end |