Deleted Added
full compact
test_option_version.c (303975) test_option_version.c (305313)
1/*-
2 * Copyright (c) 2003-2007 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-2007 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: releng/11.0/contrib/libarchive/cpio/test/test_option_version.c 302075 2016-06-22 07:49:59Z mm $");
26__FBSDID("$FreeBSD: releng/11.0/contrib/libarchive/cpio/test/test_option_version.c 305313 2016-09-03 00:27:41Z mm $");
27
28/*
29 * Test that --version option works and generates reasonable output.
30 */
31
32static void
33verify(const char *p, size_t s)
34{

--- 35 unchanged lines hidden (view full) ---

70 while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
71 ++q;
72 --s;
73 }
74 /* Skip a single trailing a,b,c, or d. */
75 if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
76 ++q;
77 /* Skip arbitrary third-party version numbers. */
27
28/*
29 * Test that --version option works and generates reasonable output.
30 */
31
32static void
33verify(const char *p, size_t s)
34{

--- 35 unchanged lines hidden (view full) ---

70 while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
71 ++q;
72 --s;
73 }
74 /* Skip a single trailing a,b,c, or d. */
75 if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
76 ++q;
77 /* Skip arbitrary third-party version numbers. */
78 while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) {
78 while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) {
79 ++q;
80 --s;
81 }
82 /* All terminated by end-of-line: \r, \r\n, or \n */
83 assert(s >= 1);
84 failure("Version: %s", p);
85 if (*q == '\x0d') {
86 if (q[1] != '\0')

--- 28 unchanged lines hidden ---
79 ++q;
80 --s;
81 }
82 /* All terminated by end-of-line: \r, \r\n, or \n */
83 assert(s >= 1);
84 failure("Version: %s", p);
85 if (*q == '\x0d') {
86 if (q[1] != '\0')

--- 28 unchanged lines hidden ---