mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-14 14:55:41 +00:00
Fix up test suite so it works again with the libarchive 1.x API.
In particular, FreeBSD 6 still uses the libarchive 1.x API and this correction will permit MFCing new libarchive features back to FreeBSD 6.
This commit is contained in:
parent
438e9b4a9e
commit
85c04a017f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=181555
@ -93,7 +93,11 @@ test_compat_tar_hardlink_1(void)
|
||||
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR);
|
||||
|
||||
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
|
||||
#if ARCHIVE_VERSION_NUMBER < 2000000
|
||||
archive_read_finish(a);
|
||||
#else
|
||||
assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
|
||||
#endif
|
||||
}
|
||||
|
||||
DEFINE_TEST(test_compat_tar_hardlink)
|
||||
|
@ -149,7 +149,11 @@ DEFINE_TEST(test_pax_filename_encoding_2)
|
||||
archive_entry_free(entry);
|
||||
|
||||
assertEqualInt(0, archive_write_close(a));
|
||||
#if ARCHIVE_VERSION_NUMBER < 2000000
|
||||
archive_write_finish(a);
|
||||
#else
|
||||
assertEqualInt(0, archive_write_finish(a));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Now read the entries back.
|
||||
@ -175,7 +179,11 @@ DEFINE_TEST(test_pax_filename_encoding_2)
|
||||
assertEqualString(longname, archive_entry_pathname(entry));
|
||||
|
||||
assertEqualInt(0, archive_read_close(a));
|
||||
#if ARCHIVE_VERSION_NUMBER < 2000000
|
||||
archive_read_finish(a);
|
||||
#else
|
||||
assertEqualInt(0, archive_read_finish(a));
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@ -249,7 +257,11 @@ DEFINE_TEST(test_pax_filename_encoding_3)
|
||||
archive_entry_free(entry);
|
||||
|
||||
assertEqualInt(0, archive_write_close(a));
|
||||
#if ARCHIVE_VERSION_NUMBER < 2000000
|
||||
archive_write_finish(a);
|
||||
#else
|
||||
assertEqualInt(0, archive_write_finish(a));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Now read the entries back.
|
||||
@ -293,5 +305,9 @@ DEFINE_TEST(test_pax_filename_encoding_3)
|
||||
assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &entry));
|
||||
|
||||
assertEqualInt(0, archive_read_close(a));
|
||||
#if ARCHIVE_VERSION_NUMBER < 2000000
|
||||
archive_read_finish(a);
|
||||
#else
|
||||
assertEqualInt(0, archive_read_finish(a));
|
||||
#endif
|
||||
}
|
||||
|
@ -111,7 +111,11 @@ test_filename(const char *prefix, int dlen, int flen)
|
||||
|
||||
/* Close out the archive. */
|
||||
assertA(0 == archive_write_close(a));
|
||||
assertA(0 == archive_write_finish(a));
|
||||
#if ARCHIVE_VERSION_NUMBER < 2000000
|
||||
archive_write_finish(a);
|
||||
#else
|
||||
assertEqualInt(0, archive_write_finish(a));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Now, read the data back.
|
||||
@ -153,7 +157,11 @@ test_filename(const char *prefix, int dlen, int flen)
|
||||
failure("This fails if entries were written that should not have been written. dlen=%d, flen=%d", dlen, flen);
|
||||
assertEqualInt(1, archive_read_next_header(a, &ae));
|
||||
assert(0 == archive_read_close(a));
|
||||
assert(0 == archive_read_finish(a));
|
||||
#if ARCHIVE_VERSION_NUMBER < 2000000
|
||||
archive_read_finish(a);
|
||||
#else
|
||||
assertEqualInt(0, archive_read_finish(a));
|
||||
#endif
|
||||
}
|
||||
|
||||
DEFINE_TEST(test_ustar_filenames)
|
||||
|
@ -131,7 +131,11 @@ DEFINE_TEST(test_write_disk_hardlink)
|
||||
assertEqualInt(sizeof(data), archive_write_data(ad, data, sizeof(data)));
|
||||
assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
|
||||
archive_entry_free(ae);
|
||||
#if ARCHIVE_VERSION_NUMBER < 2000000
|
||||
archive_write_finish(ad);
|
||||
#else
|
||||
assertEqualInt(0, archive_write_finish(ad));
|
||||
#endif
|
||||
|
||||
/* Test the entries on disk. */
|
||||
assert(0 == stat("link1a", &st));
|
||||
|
@ -188,7 +188,11 @@ DEFINE_TEST(test_write_format_tar_ustar)
|
||||
assertEqualIntA(a, 0, archive_write_header(a, entry));
|
||||
archive_entry_free(entry);
|
||||
|
||||
#if ARCHIVE_VERSION_NUMBER < 2000000
|
||||
archive_write_finish(a);
|
||||
#else
|
||||
assert(0 == archive_write_finish(a));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Verify the archive format.
|
||||
|
Loading…
Reference in New Issue
Block a user