1caf54c4fSMartin Matuska /*- 2*bd66c1b4SMartin Matuska * SPDX-License-Identifier: BSD-2-Clause 3*bd66c1b4SMartin Matuska * 4caf54c4fSMartin Matuska * Copyright (c) 2003-2009 Tim Kientzle 5caf54c4fSMartin Matuska * All rights reserved. 6caf54c4fSMartin Matuska */ 7caf54c4fSMartin Matuska #include "test.h" 8caf54c4fSMartin Matuska 9caf54c4fSMartin Matuska /* 10caf54c4fSMartin Matuska * Regression test: We used to get a bogus error message when we 11caf54c4fSMartin Matuska * asked tar to copy entries out of an empty archive. See 12caf54c4fSMartin Matuska * Issue 51 on libarchive.googlecode.com for details. 13caf54c4fSMartin Matuska */ DEFINE_TEST(test_empty_mtree)14caf54c4fSMartin MatuskaDEFINE_TEST(test_empty_mtree) 15caf54c4fSMartin Matuska { 16caf54c4fSMartin Matuska int r; 17caf54c4fSMartin Matuska 18caf54c4fSMartin Matuska assertMakeFile("test1.mtree", 0777, "#mtree\n"); 19caf54c4fSMartin Matuska 20caf54c4fSMartin Matuska r = systemf("%s cf test1.tar @test1.mtree >test1.out 2>test1.err", 21caf54c4fSMartin Matuska testprog); 22caf54c4fSMartin Matuska failure("Error invoking %s cf", testprog); 23caf54c4fSMartin Matuska assertEqualInt(r, 0); 24caf54c4fSMartin Matuska assertEmptyFile("test1.out"); 25caf54c4fSMartin Matuska assertEmptyFile("test1.err"); 26caf54c4fSMartin Matuska } 27