diff options
author | Martin Matuska <mm@FreeBSD.org> | 2024-04-16 21:39:31 +0000 |
---|---|---|
committer | Martin Matuska <mm@FreeBSD.org> | 2024-04-16 21:39:31 +0000 |
commit | b9128a37faafede823eb456aa65a11ac69997284 (patch) | |
tree | 97c4af1bb04684688fbcb7743f043efcfe021b53 /contrib/libarchive/test_utils | |
parent | e0919a4bac2b57a086688ae8ec58058b91f61d86 (diff) | |
parent | a509d68f27b9f114b876bbe3b9caa9d0ee0c5606 (diff) |
libarchive: merge from vendor branch
Libarchive 3.7.3
New features:
#1941 uudecode filter: support file name and file mode in raw mode
#1943 7-zip reader: translate Windows permissions into UNIX
permissions
#1962 zstd filter now supports the "long" write option
#2012 add trailing letter b to bsdtar(1) substitute pattern
#2031 PCRE2 support
#2054 add support for long options "--group" and "--owner" to tar(1)
Security fixes:
#2101 Fix possible vulnerability in tar error reporting introduced
in f27c173
Important bugfixes:
#1974 ISO9660: preserve the natural order of links
#2105 rar5: fix infinite loop if during rar5 decompression the last
block produced no data
#2027 xz filter: fix incorrect eof at the end of an lzip member
#2043 zip: fix end-of-data marker processing when decompressing zip
archives
PR: 278315 (exp-run)
MFC after: 1 week
Diffstat (limited to 'contrib/libarchive/test_utils')
-rw-r--r-- | contrib/libarchive/test_utils/test_common.h | 15 | ||||
-rw-r--r-- | contrib/libarchive/test_utils/test_main.c | 18 |
2 files changed, 19 insertions, 14 deletions
diff --git a/contrib/libarchive/test_utils/test_common.h b/contrib/libarchive/test_utils/test_common.h index 6250235c6ca9..8e1ec82436f8 100644 --- a/contrib/libarchive/test_utils/test_common.h +++ b/contrib/libarchive/test_utils/test_common.h @@ -21,8 +21,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef TEST_COMMON_H @@ -134,16 +132,6 @@ #include <stdint.h> #endif -/* Get a real definition for __FBSDID if we can */ -#if HAVE_SYS_CDEFS_H -#include <sys/cdefs.h> -#endif - -/* If not, define it so as to avoid dangling semicolons. */ -#ifndef __FBSDID -#define __FBSDID(a) struct _undefined_hack -#endif - #ifndef O_BINARY #define O_BINARY 0 #endif @@ -178,6 +166,8 @@ /* Assert two integers are the same. Reports value of each one if not. */ #define assertEqualInt(v1,v2) \ assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL) +#define assertEqualAddress(v1,v2) \ + assertion_equal_address(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL) /* Assert two strings are the same. Reports value of each one if not. */ #define assertEqualString(v1,v2) \ assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 0) @@ -291,6 +281,7 @@ int assertion_compare_fflags(const char *, int, const char *, const char *, int assertion_empty_file(const char *, int, const char *); int assertion_equal_file(const char *, int, const char *, const char *); int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *); +int assertion_equal_address(const char *, int, const void *, const char *, const void *, const char *, void *); int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *); int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *); int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int); diff --git a/contrib/libarchive/test_utils/test_main.c b/contrib/libarchive/test_utils/test_main.c index e4b884ee3c44..6617732a335b 100644 --- a/contrib/libarchive/test_utils/test_main.c +++ b/contrib/libarchive/test_utils/test_main.c @@ -625,6 +625,21 @@ assertion_equal_int(const char *file, int line, return (0); } +/* Verify two pointers are equal. */ +int +assertion_equal_address(const char *file, int line, + const void *v1, const char *e1, const void *v2, const char *e2, void *extra) +{ + assertion_count(file, line); + if (v1 == v2) + return (1); + failure_start(file, line, "%s != %s", e1, e2); + logprintf(" %s=0x%llx\n", e1, (unsigned long long)(uintptr_t)v1); + logprintf(" %s=0x%llx\n", e2, (unsigned long long)(uintptr_t)v2); + failure_finish(extra); + return (0); +} + /* * Utility to convert a single UTF-8 sequence. */ @@ -1245,7 +1260,7 @@ assertion_file_contains_lines_any_order(const char *file, int line, c = *p; } if (actual_count) { - actual = calloc(sizeof(char *), actual_count); + actual = calloc(actual_count, sizeof(char *)); if (actual == NULL) { failure_start(pathname, line, "Can't allocate memory"); failure_finish(NULL); @@ -4175,7 +4190,6 @@ main(int argc, char **argv) free(refdir_alloc); free(testprogdir); usage(progname); - return (1); } for (i = 0; i < test_num; i++) { tests_run++; |