test_option_s.c (228763) | test_option_s.c (228776) |
---|---|
1/*- 2 * Copyright (c) 2003-2008 Tim Kientzle 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25#include "test.h" | 1/*- 2 * Copyright (c) 2003-2008 Tim Kientzle 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25#include "test.h" |
26__FBSDID("$FreeBSD: head/contrib/libarchive/tar/test/test_option_s.c 228763 2011-12-21 11:13:29Z mm $"); | 26__FBSDID("$FreeBSD: head/contrib/libarchive/tar/test/test_option_s.c 228776 2011-12-21 15:30:49Z mm $"); |
27 28static int 29mkfile(const char *fn, const char *contents) 30{ 31 FILE *f = fopen(fn, "w"); 32 failure("Couldn't create file '%s', errno=%d (%s)\n", 33 fn, errno, strerror(errno)); 34 if (!assert(f != NULL)) --- 4 unchanged lines hidden (view full) --- 39 assertEqualInt(0, fclose(f)); 40 return (0); /* Success */ 41} 42 43DEFINE_TEST(test_option_s) 44{ 45 struct stat st; 46 | 27 28static int 29mkfile(const char *fn, const char *contents) 30{ 31 FILE *f = fopen(fn, "w"); 32 failure("Couldn't create file '%s', errno=%d (%s)\n", 33 fn, errno, strerror(errno)); 34 if (!assert(f != NULL)) --- 4 unchanged lines hidden (view full) --- 39 assertEqualInt(0, fclose(f)); 40 return (0); /* Success */ 41} 42 43DEFINE_TEST(test_option_s) 44{ 45 struct stat st; 46 |
47 /* Create a sample file heirarchy. */ | 47 /* Create a sample file hierarchy. */ |
48 assertMakeDir("in", 0755); 49 assertMakeDir("in/d1", 0755); 50 assertEqualInt(0, mkfile("in/d1/foo", "foo")); 51 assertEqualInt(0, mkfile("in/d1/bar", "bar")); 52 53 /* Does bsdtar support -s option ? */ 54 systemf("%s -cf - -s /foo/bar/ in/d1/foo > NUL 2> check.err", 55 testprog); --- 52 unchanged lines hidden --- | 48 assertMakeDir("in", 0755); 49 assertMakeDir("in/d1", 0755); 50 assertEqualInt(0, mkfile("in/d1/foo", "foo")); 51 assertEqualInt(0, mkfile("in/d1/bar", "bar")); 52 53 /* Does bsdtar support -s option ? */ 54 systemf("%s -cf - -s /foo/bar/ in/d1/foo > NUL 2> check.err", 55 testprog); --- 52 unchanged lines hidden --- |