diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-08-11 01:19:36 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-08-11 01:19:36 +0000 |
commit | 0e0fb66ac7a403be2f1baab6feeceaffc885ecf0 (patch) | |
tree | ed6046241fe51a44ea72ed6584ca60a47a2a1a76 /lib/libarchive/test | |
parent | aa6984275ee884472c39949cb11c890b3cfdd3e2 (diff) | |
download | FreeBSD-src-0e0fb66ac7a403be2f1baab6feeceaffc885ecf0.zip FreeBSD-src-0e0fb66ac7a403be2f1baab6feeceaffc885ecf0.tar.gz |
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.
Diffstat (limited to 'lib/libarchive/test')
-rw-r--r-- | lib/libarchive/test/test_compat_tar_hardlink.c | 4 | ||||
-rw-r--r-- | lib/libarchive/test/test_pax_filename_encoding.c | 16 | ||||
-rw-r--r-- | lib/libarchive/test/test_ustar_filenames.c | 12 | ||||
-rw-r--r-- | lib/libarchive/test/test_write_disk_hardlink.c | 4 | ||||
-rw-r--r-- | lib/libarchive/test/test_write_format_tar_ustar.c | 4 |
5 files changed, 38 insertions, 2 deletions
diff --git a/lib/libarchive/test/test_compat_tar_hardlink.c b/lib/libarchive/test/test_compat_tar_hardlink.c index 6d1566f..c1021ef 100644 --- a/lib/libarchive/test/test_compat_tar_hardlink.c +++ b/lib/libarchive/test/test_compat_tar_hardlink.c @@ -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) diff --git a/lib/libarchive/test/test_pax_filename_encoding.c b/lib/libarchive/test/test_pax_filename_encoding.c index c63f06f..6491634 100644 --- a/lib/libarchive/test/test_pax_filename_encoding.c +++ b/lib/libarchive/test/test_pax_filename_encoding.c @@ -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 } diff --git a/lib/libarchive/test/test_ustar_filenames.c b/lib/libarchive/test/test_ustar_filenames.c index 88b4b2c..3c842a3 100644 --- a/lib/libarchive/test/test_ustar_filenames.c +++ b/lib/libarchive/test/test_ustar_filenames.c @@ -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) diff --git a/lib/libarchive/test/test_write_disk_hardlink.c b/lib/libarchive/test/test_write_disk_hardlink.c index 76969d1..68f2f26 100644 --- a/lib/libarchive/test/test_write_disk_hardlink.c +++ b/lib/libarchive/test/test_write_disk_hardlink.c @@ -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)); diff --git a/lib/libarchive/test/test_write_format_tar_ustar.c b/lib/libarchive/test/test_write_format_tar_ustar.c index 53eb07c..53d21e1 100644 --- a/lib/libarchive/test/test_write_format_tar_ustar.c +++ b/lib/libarchive/test/test_write_format_tar_ustar.c @@ -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. |