Files
libarchive/cpio/test/test_extract_cpio_zstd.c
Emil Velikov 6287b99eb7 Convert the tools and respective tests to SPDX (#2317)
This is the first part of converting the project to use SPDX license
identifiers instead using the verbose license text.

The patches are semi-automated and I've went through manually to ensure
no license changes were made. That said, I would welcome another pair of
eyes, since I am only human.

See https://github.com/libarchive/libarchive/issues/2298

---------

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2024-10-12 20:54:16 -07:00

30 lines
783 B
C

/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2017 Sean Purcell
* All rights reserved.
*/
#include "test.h"
DEFINE_TEST(test_extract_cpio_zstd)
{
const char *reffile = "test_extract.cpio.zst";
int f;
extract_reference_file(reffile);
f = systemf("%s -it < %s >test.out 2>test.err", testprog, reffile);
if (f == 0 || canZstd()) {
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 zstd is not supported on this platform");
}
}