diff options
author | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2014-08-18 23:42:06 +0900 |
---|---|---|
committer | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2014-08-18 23:42:06 +0900 |
commit | aecd3a2c3f3956a66815eef88b355f644fe1ae5e (patch) | |
tree | 4e12b19ee6037c97d6e8cef78d0b9cd8e1f08cad /cat/test | |
parent | f6b202b6e70cff11f6f611ff56c1ab5584914bb5 (diff) | |
download | libarchive-aecd3a2c3f3956a66815eef88b355f644fe1ae5e.tar.gz |
Add additional tests for lz4 compression in front-end applications.
Diffstat (limited to 'cat/test')
-rw-r--r-- | cat/test/CMakeLists.txt | 1 | ||||
-rw-r--r-- | cat/test/test_expand.lz4.uu | 5 | ||||
-rw-r--r-- | cat/test/test_expand_lz4.c | 42 |
3 files changed, 48 insertions, 0 deletions
diff --git a/cat/test/CMakeLists.txt b/cat/test/CMakeLists.txt index 86ae6927..ebb702ad 100644 --- a/cat/test/CMakeLists.txt +++ b/cat/test/CMakeLists.txt @@ -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 diff --git a/cat/test/test_expand.lz4.uu b/cat/test/test_expand.lz4.uu new file mode 100644 index 00000000..78306eaa --- /dev/null +++ b/cat/test/test_expand.lz4.uu @@ -0,0 +1,5 @@ +begin 644 test_expand.lz4 +M!")-&&1PN1T``(!C;VYT96YT<R!O9B!T97-T7V5X<&%N9"YL>C0N"@`````Y +#!E9+ +` +end diff --git a/cat/test/test_expand_lz4.c b/cat/test/test_expand_lz4.c new file mode 100644 index 00000000..1b1d2106 --- /dev/null +++ b/cat/test/test_expand_lz4.c @@ -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"); + } +} |