Add additional tests for lz4 compression in front-end applications.

This commit is contained in:
Michihiro NAKAJIMA committed 2014-08-18 23:42:06 +09:00
1 parent f6b202b6e7
commit aecd3a2c3f
10 files changed
+167

No files matched your search

+6
View File
@@ -861,6 +861,7 @@ bsdtar_test_SOURCES= \
tar/test/test_extract_tar_gz.c \
tar/test/test_extract_tar_lrz.c \
tar/test/test_extract_tar_lz.c \
tar/test/test_extract_tar_lz4.c \
tar/test/test_extract_tar_lzma.c \
tar/test/test_extract_tar_lzo.c \
tar/test/test_extract_tar_xz.c \
@@ -930,6 +931,7 @@ bsdtar_test_EXTRA_DIST= \
tar/test/test_extract.tar.gz.uu \
tar/test/test_extract.tar.lrz.uu \
tar/test/test_extract.tar.lz.uu \
tar/test/test_extract.tar.lz4.uu \
tar/test/test_extract.tar.lzma.uu \
tar/test/test_extract.tar.lzo.uu \
tar/test/test_extract.tar.xz.uu \
@@ -1010,6 +1012,7 @@ bsdcpio_test_SOURCES= \
cpio/test/test_extract_cpio_gz.c \
cpio/test/test_extract_cpio_lrz.c \
cpio/test/test_extract_cpio_lz.c \
cpio/test/test_extract_cpio_lz4.c \
cpio/test/test_extract_cpio_lzma.c \
cpio/test/test_extract_cpio_lzo.c \
cpio/test/test_extract_cpio_xz.c \
@@ -1071,6 +1074,7 @@ bsdcpio_test_EXTRA_DIST= \
cpio/test/test_extract.cpio.gz.uu \
cpio/test/test_extract.cpio.lrz.uu \
cpio/test/test_extract.cpio.lz.uu \
cpio/test/test_extract.cpio.lz4.uu \
cpio/test/test_extract.cpio.lzma.uu \
cpio/test/test_extract.cpio.lzo.uu \
cpio/test/test_extract.cpio.xz.uu \
@@ -1149,6 +1153,7 @@ bsdcat_test_SOURCES= \
cat/test/test_expand_Z.c \
cat/test/test_expand_bz2.c \
cat/test/test_expand_gz.c \
cat/test/test_expand_lz4.c \
cat/test/test_expand_mixed.c \
cat/test/test_expand_plain.c \
cat/test/test_expand_xz.c \
@@ -1181,6 +1186,7 @@ bsdcat_test_EXTRA_DIST= \
cat/test/test_expand.Z.uu \
cat/test/test_expand.bz2.uu \
cat/test/test_expand.gz.uu \
cat/test/test_expand.lz4.uu \
cat/test/test_expand.plain.uu \
cat/test/test_expand.xz.uu \
cat/test/CMakeLists.txt
+1
View File
@@ -17,6 +17,7 @@ IF(ENABLE_CAT AND ENABLE_TEST)
test_expand_Z.c
test_expand_bz2.c
test_expand_gz.c
test_expand_lz4.c
test_expand_mixed.c
test_expand_plain.c
test_expand_xz.c
+5
View File
@@ -0,0 +1,5 @@
begin 644 test_expand.lz4
M!")-&&1PN1T``(!C;VYT96YT<R!O9B!T97-T7V5X<&%N9"YL>C0N"@`````Y
#!E9+
`
end
+42
View File
@@ -0,0 +1,42 @@
/*-
* Copyright (c) 2014 Mike Kazantsev
* Copyright (c) 2012, 2014 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
DEFINE_TEST(test_expand_lz4)
{
const char *reffile = "test_expand.lz4";
int f;
extract_reference_file(reffile);
f = systemf("%s %s >test.out 2>test.err", testprog, reffile);
if (f == 0 || canLz4()) {
assertEqualInt(0, f);
assertTextFileContents("contents of test_expand.lz4.\n", "test.out");
assertEmptyFile("test.err");
} else {
skipping("It seems lz4 is not supported on this platform");
}
}
+1
View File
@@ -19,6 +19,7 @@ IF(ENABLE_CPIO AND ENABLE_TEST)
test_extract_cpio_gz
test_extract_cpio_lrz
test_extract_cpio_lz
test_extract_cpio_lz4
test_extract_cpio_lzma
test_extract_cpio_lzo
test_extract_cpio_xz
+7
View File
@@ -0,0 +1,7 @@
begin 644 test_extract.cpio.lz4
M!")-&&1PN9$````A,#<"`&`P-#`P,3`!`&`Q,3`P-C8/`#0W-3`&```)``$&
M`,$P,3(P,S(W-#`R,S01`!$V!@```@#Q!3(S9FEL93$`8V]N=&5N=',@;V8@
M$@`A+@IC``AE`!\R90`4$#2#``YE`!TR90`6,F4`#P(`#@+H``P"`"<Q,Q(`
=OU1204E,15(A(2$``0#'4````````````"BVD[$`
`
end
+48
View File
@@ -0,0 +1,48 @@
/*-
* Copyright (c) 2012,2014 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_cpio_lz4)
{
const char *reffile = "test_extract.cpio.lz4";
int f;
extract_reference_file(reffile);
f = systemf("%s -it < %s >test.out 2>test.err", testprog, reffile);
if (f == 0 || canLz4()) {
assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err",
testprog, reffile));
assertFileExists("file1");
assertTextFileContents("contents of file1.\n", "file1");
assertFileExists("file2");
assertTextFileContents("contents of file2.\n", "file2");
assertEmptyFile("test.out");
assertTextFileContents("1 block\n", "test.err");
} else {
skipping("It seems lz4 is not supported on this platform");
}
}
+1
View File
@@ -41,6 +41,7 @@ IF(ENABLE_TAR AND ENABLE_TEST)
test_option_k.c
test_option_keep_newer_files.c
test_option_lrzip.c
test_option_lz4.c
test_option_lzma.c
test_option_lzop.c
test_option_n.c
+8
View File
@@ -0,0 +1,8 @@
begin 644 test_extract.tar.lz4
M!")-&&1PN:L```!O9FEL93$``0!+Z#`P,#8V-"``,#`Q-S4P"``#`@#_"3(S
M(#$R,#,R-S0P,C,T(#`Q,3,V-0`@,)<`2P("`+)U<W1A<@`P,&-U91$`#P(`
M!`\@``T"RP``W0```@`?($8`!`\"`'[!8V]N=&5N=',@;V8@#`(O+@JD`'X/
M`@#_2@#T`1\R80%,#P`$&B$T-0`$+S<P``3_9!\R``3_W0\"`/___^M0````
*````````J.?`=```
`
end
+48
View File
@@ -0,0 +1,48 @@
/*-
* Copyright (c) 2012,2014 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_tar_lz4)
{
const char *reffile = "test_extract.tar.lz4";
int f;
extract_reference_file(reffile);
f = systemf("%s -tf %s >test.out 2>test.err", testprog, reffile);
if (f == 0 || canLz4()) {
assertEqualInt(0, systemf("%s -xf %s >test.out 2>test.err",
testprog, reffile));
assertFileExists("file1");
assertTextFileContents("contents of file1.\n", "file1");
assertFileExists("file2");
assertTextFileContents("contents of file2.\n", "file2");
assertEmptyFile("test.out");
assertEmptyFile("test.err");
} else {
skipping("It seems lz4 is not supported on this platform");
}
}