aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/test/test_archive_write_add_filter_by_name.c
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2016-05-11 10:19:44 +0000
committerMartin Matuska <mm@FreeBSD.org>2016-05-11 10:19:44 +0000
commit4e579f6c9425c995106fbf72667f4ec7e5d5db85 (patch)
treed298bb9fa3cf4f58e328e696a77fadf758a534eb /libarchive/test/test_archive_write_add_filter_by_name.c
parent8c8f03ca5b7f1f0d07c23e7c354a45b7c95335f0 (diff)
downloadsrc-4e579f6c9425c995106fbf72667f4ec7e5d5db85.tar.gz
src-4e579f6c9425c995106fbf72667f4ec7e5d5db85.zip
Update vendor/libarchive/dist to git commit 61c56e5 (post 3.2.0)vendor/libarchive/3.2.0
Notes
Notes: svn path=/vendor/libarchive/dist/; revision=299425 svn path=/vendor/libarchive/3.2.0/; revision=299528; tag=vendor/libarchive/3.2.0
Diffstat (limited to 'libarchive/test/test_archive_write_add_filter_by_name.c')
-rw-r--r--libarchive/test/test_archive_write_add_filter_by_name.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libarchive/test/test_archive_write_add_filter_by_name.c b/libarchive/test/test_archive_write_add_filter_by_name.c
index ff5ca5b1d471..38b606b9d165 100644
--- a/libarchive/test/test_archive_write_add_filter_by_name.c
+++ b/libarchive/test/test_archive_write_add_filter_by_name.c
@@ -38,7 +38,7 @@ test_filter_by_name(const char *filter_name, int filter_code,
char *buff;
int r;
- assert((buff = malloc(buffsize)) != NULL);
+ assert((buff = calloc(1, buffsize)) != NULL);
if (buff == NULL)
return;
@@ -70,6 +70,16 @@ test_filter_by_name(const char *filter_name, int filter_code,
return;
}
}
+ if (filter_code == ARCHIVE_FILTER_LRZIP)
+ {
+ /*
+ * There's a bug in lrzip (as of release 0.612) where 2nd stage
+ * compression can't be performed on smaller files. Set lrzip to
+ * use no 2nd stage compression.
+ */
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_options(a, "lrzip:compression=none"));
+ }
assertEqualIntA(a, ARCHIVE_OK, archive_write_set_bytes_per_block(a, 10));
assertEqualIntA(a, ARCHIVE_OK,
archive_write_open_memory(a, buff, buffsize, &used));
@@ -168,6 +178,11 @@ DEFINE_TEST(test_archive_write_add_filter_by_name_lrzip)
test_filter_by_name("lrzip", ARCHIVE_FILTER_LRZIP, canLrzip);
}
+DEFINE_TEST(test_archive_write_add_filter_by_name_lz4)
+{
+ test_filter_by_name("lz4", ARCHIVE_FILTER_LZ4, canLz4);
+}
+
DEFINE_TEST(test_archive_write_add_filter_by_name_lzip)
{
test_filter_by_name("lzip", ARCHIVE_FILTER_LZIP, cannot);