xref: /freebsd/contrib/libarchive/cat/test/test_expand_lz4.c (revision bd66c1b43e33540205dbc1187c2f2a15c58b57ba)
1cdf63a70SMartin Matuska /*-
2*bd66c1b4SMartin Matuska  * SPDX-License-Identifier: BSD-2-Clause
3*bd66c1b4SMartin Matuska  *
4cdf63a70SMartin Matuska  * Copyright (c) 2014 Mike Kazantsev
5cdf63a70SMartin Matuska  * Copyright (c) 2012, 2014 Michihiro NAKAJIMA
6cdf63a70SMartin Matuska  * All rights reserved.
7cdf63a70SMartin Matuska  */
8cdf63a70SMartin Matuska #include "test.h"
9cdf63a70SMartin Matuska 
DEFINE_TEST(test_expand_lz4)10cdf63a70SMartin Matuska DEFINE_TEST(test_expand_lz4)
11cdf63a70SMartin Matuska {
12cdf63a70SMartin Matuska 	const char *reffile = "test_expand.lz4";
13cdf63a70SMartin Matuska 	int f;
14cdf63a70SMartin Matuska 
15cdf63a70SMartin Matuska 	extract_reference_file(reffile);
16cdf63a70SMartin Matuska 	f = systemf("%s %s >test.out 2>test.err", testprog, reffile);
17cdf63a70SMartin Matuska 	if (f == 0 || canLz4()) {
18cdf63a70SMartin Matuska 		assertEqualInt(0, f);
19cdf63a70SMartin Matuska 		assertTextFileContents("contents of test_expand.lz4.\n", "test.out");
20cdf63a70SMartin Matuska 		assertEmptyFile("test.err");
21cdf63a70SMartin Matuska 	} else {
22cdf63a70SMartin Matuska 		skipping("It seems lz4 is not supported on this platform");
23cdf63a70SMartin Matuska 	}
24cdf63a70SMartin Matuska }
25