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

+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");
}
}