diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-09-01 05:38:33 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-09-01 05:38:33 +0000 |
commit | da7b4a0824397b1c724cdf9a9b03b642ef8610ae (patch) | |
tree | 33ffbad3b60850d7aaaa2e6c79990403e110b2c2 /lib | |
parent | 4f7f14505ade23cf1713dac8e039845e724b1326 (diff) | |
download | FreeBSD-src-da7b4a0824397b1c724cdf9a9b03b642ef8610ae.zip FreeBSD-src-da7b4a0824397b1c724cdf9a9b03b642ef8610ae.tar.gz |
Style: Use ARCHIVE_VERSION_NUMBER to conditionalize tests on
the particular libarchive version being tested instead of the
deprecated ARCHIVE_API_VERSION and ARCHIVE_VERSION_STAMP macros.
Diffstat (limited to 'lib')
53 files changed, 309 insertions, 311 deletions
diff --git a/lib/libarchive/test/read_open_memory.c b/lib/libarchive/test/read_open_memory.c index 63a7778..fac9b23 100644 --- a/lib/libarchive/test/read_open_memory.c +++ b/lib/libarchive/test/read_open_memory.c @@ -48,7 +48,7 @@ struct read_memory_data { static int memory_read_close(struct archive *, void *); static int memory_read_open(struct archive *, void *); -#if ARCHIVE_API_VERSION < 2 +#if ARCHIVE_VERSION_NUMBER < 2000000 static ssize_t memory_read_skip(struct archive *, void *, size_t request); #else static off_t memory_read_skip(struct archive *, void *, off_t request); @@ -113,7 +113,7 @@ memory_read(struct archive *a, void *client_data, const void **buff) /* * How mean can a skip() routine be? Let's try to find out. */ -#if ARCHIVE_API_VERSION < 2 +#if ARCHIVE_VERSION_NUMBER < 2000000 static ssize_t memory_read_skip(struct archive *a, void *client_data, size_t skip) #else diff --git a/lib/libarchive/test/test_acl_basic.c b/lib/libarchive/test/test_acl_basic.c index f07e74d..cfc8539 100644 --- a/lib/libarchive/test/test_acl_basic.c +++ b/lib/libarchive/test/test_acl_basic.c @@ -165,7 +165,7 @@ compare_acls(struct archive_entry *ae, struct acl_t *acls, int n, int mode) assert(matched == 1); } } -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 /* Known broken before 1.9.0. */ skipping("archive_entry_acl_next() exits with ARCHIVE_EOF"); #else diff --git a/lib/libarchive/test/test_acl_pax.c b/lib/libarchive/test/test_acl_pax.c index a40256b..01c36d1 100644 --- a/lib/libarchive/test/test_acl_pax.c +++ b/lib/libarchive/test/test_acl_pax.c @@ -386,7 +386,7 @@ compare_acls(struct archive_entry *ae, struct acl_t *acls, int n, int mode) assert(matched == 1); } } -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 /* Known broken before 1.9.0. */ skipping("archive_entry_acl_next() exits with ARCHIVE_EOF"); #else @@ -446,10 +446,10 @@ DEFINE_TEST(test_acl_pax) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif /* Write out the data we generated to a file for manual inspection. */ @@ -509,9 +509,9 @@ DEFINE_TEST(test_acl_pax) /* Close the archive. */ assertA(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assertA(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_bad_fd.c b/lib/libarchive/test/test_bad_fd.c index dc83d18..a0f9ae1 100644 --- a/lib/libarchive/test/test_bad_fd.c +++ b/lib/libarchive/test/test_bad_fd.c @@ -33,9 +33,9 @@ DEFINE_TEST(test_bad_fd) assertA(0 == archive_read_support_compression_all(a)); assertA(ARCHIVE_FATAL == archive_read_open_fd(a, -1, 1024)); assertA(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assertA(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_compat_gtar.c b/lib/libarchive/test/test_compat_gtar.c index 24a294f..a083855 100644 --- a/lib/libarchive/test/test_compat_gtar.c +++ b/lib/libarchive/test/test_compat_gtar.c @@ -94,10 +94,10 @@ test_compat_gtar_1(void) assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_compat_zip.c b/lib/libarchive/test/test_compat_zip.c index f174c38..9ead938 100644 --- a/lib/libarchive/test/test_compat_zip.c +++ b/lib/libarchive/test/test_compat_zip.c @@ -53,10 +53,10 @@ test_compat_zip_1(void) assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ZIP); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_empty_write.c b/lib/libarchive/test/test_empty_write.c index 37b14b8..a4833a9 100644 --- a/lib/libarchive/test/test_empty_write.c +++ b/lib/libarchive/test/test_empty_write.c @@ -55,13 +55,12 @@ DEFINE_TEST(test_empty_write) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif - /* * Again, with bzip2 compression. */ @@ -84,10 +83,10 @@ DEFINE_TEST(test_empty_write) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif @@ -113,9 +112,9 @@ DEFINE_TEST(test_empty_write) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif } diff --git a/lib/libarchive/test/test_entry.c b/lib/libarchive/test/test_entry.c index 2b1bf3e..2a1c901 100644 --- a/lib/libarchive/test/test_entry.c +++ b/lib/libarchive/test/test_entry.c @@ -88,7 +88,7 @@ DEFINE_TEST(test_entry) assertEqualInt(archive_entry_ctime_nsec(e), 0); assert(!archive_entry_ctime_is_set(e)); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 /* dev */ archive_entry_set_dev(e, 235); assertEqualInt(archive_entry_dev(e), 235); @@ -97,7 +97,7 @@ DEFINE_TEST(test_entry) #endif /* devmajor/devminor are tested specially below. */ -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 /* filetype */ archive_entry_set_filetype(e, AE_IFREG); assertEqualInt(archive_entry_filetype(e), AE_IFREG); @@ -133,7 +133,7 @@ DEFINE_TEST(test_entry) assertEqualWString(archive_entry_hardlink_w(e), L"whardlink"); memset(wbuff, 0, sizeof(wbuff)); assertEqualWString(archive_entry_hardlink_w(e), L"whardlink"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 /* ino */ archive_entry_set_ino(e, 8593); assertEqualInt(archive_entry_ino(e), 8593); @@ -184,7 +184,7 @@ DEFINE_TEST(test_entry) assertEqualInt(archive_entry_mtime_nsec(e), 0); assert(!archive_entry_mtime_is_set(e)); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 /* nlink */ archive_entry_set_nlink(e, 736); assertEqualInt(archive_entry_nlink(e), 736); @@ -208,7 +208,7 @@ DEFINE_TEST(test_entry) memset(wbuff, 0, sizeof(wbuff)); assertEqualWString(archive_entry_pathname_w(e), L"wpath"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 /* rdev */ archive_entry_set_rdev(e, 532); assertEqualInt(archive_entry_rdev(e), 532); @@ -227,7 +227,7 @@ DEFINE_TEST(test_entry) /* symlink */ archive_entry_set_symlink(e, "symlinkname"); assertEqualString(archive_entry_symlink(e), "symlinkname"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 strcpy(buff, "symlinkname2"); archive_entry_copy_symlink(e, buff); assertEqualString(archive_entry_symlink(e), "symlinkname2"); @@ -313,23 +313,23 @@ DEFINE_TEST(test_entry) archive_entry_clear(e); archive_entry_set_atime(e, 13579, 24680); archive_entry_set_ctime(e, 13580, 24681); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_dev(e, 235); #endif archive_entry_set_fflags(e, 0x55, 0xAA); archive_entry_set_gid(e, 204); archive_entry_set_gname(e, "group"); archive_entry_set_hardlink(e, "hardlinkname"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_ino(e, 8593); #endif archive_entry_set_mode(e, 0123456); archive_entry_set_mtime(e, 13581, 24682); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_nlink(e, 736); #endif archive_entry_set_pathname(e, "path"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_rdev(e, 532); #endif archive_entry_set_size(e, 987654321); @@ -350,7 +350,7 @@ DEFINE_TEST(test_entry) assertEqualInt(archive_entry_atime_nsec(e2), 24680); assertEqualInt(archive_entry_ctime(e2), 13580); assertEqualInt(archive_entry_ctime_nsec(e2), 24681); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(archive_entry_dev(e2), 235); #endif archive_entry_fflags(e, &set, &clear); @@ -359,24 +359,24 @@ DEFINE_TEST(test_entry) assertEqualInt(archive_entry_gid(e2), 204); assertEqualString(archive_entry_gname(e2), "group"); assertEqualString(archive_entry_hardlink(e2), "hardlinkname"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(archive_entry_ino(e2), 8593); #endif assertEqualInt(archive_entry_mode(e2), 0123456); assertEqualInt(archive_entry_mtime(e2), 13581); assertEqualInt(archive_entry_mtime_nsec(e2), 24682); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(archive_entry_nlink(e2), 736); #endif assertEqualString(archive_entry_pathname(e2), "path"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(archive_entry_rdev(e2), 532); #endif assertEqualInt(archive_entry_size(e2), 987654321); assertEqualString(archive_entry_symlink(e2), "symlinkname"); assertEqualInt(archive_entry_uid(e2), 83); assertEqualString(archive_entry_uname(e2), "user"); -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("ACL preserved by archive_entry_clone()"); #else /* Verify ACL was copied. */ @@ -417,7 +417,7 @@ DEFINE_TEST(test_entry) assertEqualInt(qual, 77); assertEqualString(name, "user77"); #endif -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("xattr data preserved by archive_entry_clone"); #else /* Verify xattr was copied. */ @@ -436,26 +436,26 @@ DEFINE_TEST(test_entry) /* Change the original */ archive_entry_set_atime(e, 13580, 24690); archive_entry_set_ctime(e, 13590, 24691); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_dev(e, 245); #endif archive_entry_set_fflags(e, 0x85, 0xDA); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_filetype(e, AE_IFLNK); #endif archive_entry_set_gid(e, 214); archive_entry_set_gname(e, "grouper"); archive_entry_set_hardlink(e, "hardlinkpath"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_ino(e, 8763); #endif archive_entry_set_mode(e, 0123654); archive_entry_set_mtime(e, 18351, 28642); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_nlink(e, 73); #endif archive_entry_set_pathname(e, "pathest"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_rdev(e, 132); #endif archive_entry_set_size(e, 987456321); @@ -470,7 +470,7 @@ DEFINE_TEST(test_entry) assertEqualInt(archive_entry_atime_nsec(e2), 24680); assertEqualInt(archive_entry_ctime(e2), 13580); assertEqualInt(archive_entry_ctime_nsec(e2), 24681); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(archive_entry_dev(e2), 235); #endif archive_entry_fflags(e2, &set, &clear); @@ -479,24 +479,24 @@ DEFINE_TEST(test_entry) assertEqualInt(archive_entry_gid(e2), 204); assertEqualString(archive_entry_gname(e2), "group"); assertEqualString(archive_entry_hardlink(e2), "hardlinkname"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(archive_entry_ino(e2), 8593); #endif assertEqualInt(archive_entry_mode(e2), 0123456); assertEqualInt(archive_entry_mtime(e2), 13581); assertEqualInt(archive_entry_mtime_nsec(e2), 24682); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(archive_entry_nlink(e2), 736); #endif assertEqualString(archive_entry_pathname(e2), "path"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(archive_entry_rdev(e2), 532); #endif assertEqualInt(archive_entry_size(e2), 987654321); assertEqualString(archive_entry_symlink(e2), "symlinkname"); assertEqualInt(archive_entry_uid(e2), 83); assertEqualString(archive_entry_uname(e2), "user"); -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("ACL held by clone of archive_entry"); #else /* Verify ACL was unchanged. */ @@ -545,7 +545,7 @@ DEFINE_TEST(test_entry) assertEqualInt(qual, -1); assertEqualString(name, NULL); #endif -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("xattr preserved in archive_entry copy"); #else /* Verify xattr was unchanged. */ @@ -567,7 +567,7 @@ DEFINE_TEST(test_entry) archive_entry_fflags(e, &set, &clear); assertEqualInt(clear, 0); assertEqualInt(set, 0); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(archive_entry_filetype(e), 0); #endif assertEqualInt(archive_entry_gid(e), 0); @@ -577,7 +577,7 @@ DEFINE_TEST(test_entry) assertEqualInt(archive_entry_mode(e), 0); assertEqualInt(archive_entry_mtime(e), 0); assertEqualInt(archive_entry_mtime_nsec(e), 0); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(archive_entry_nlink(e), 0); #endif assertEqualString(archive_entry_pathname(e), NULL); @@ -623,7 +623,7 @@ DEFINE_TEST(test_entry) assertEqualInt(archive_entry_ino(e), 234); assertEqualInt(archive_entry_mode(e), 077777); assertEqualInt(archive_entry_mtime(e), 234567); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(archive_entry_nlink(e), 345); #endif assertEqualInt(archive_entry_size(e), 123456789); @@ -644,17 +644,17 @@ DEFINE_TEST(test_entry) /* Set a bunch of fields individually. */ archive_entry_set_atime(e, 456789, 321); archive_entry_set_ctime(e, 345678, 432); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_dev(e, 123); #endif archive_entry_set_gid(e, 34); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_ino(e, 234); #endif archive_entry_set_mode(e, 012345); archive_entry_set_mode(e, 012345); archive_entry_set_mtime(e, 234567, 543); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_nlink(e, 345); #endif archive_entry_set_size(e, 123456789); @@ -664,16 +664,16 @@ DEFINE_TEST(test_entry) /* Check that the values match. */ assertEqualInt(pst->st_atime, 456789); assertEqualInt(pst->st_ctime, 345678); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(pst->st_dev, 123); #endif assertEqualInt(pst->st_gid, 34); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(pst->st_ino, 234); #endif assertEqualInt(pst->st_mode, 012345); assertEqualInt(pst->st_mtime, 234567); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 assertEqualInt(pst->st_nlink, 345); #endif assertEqualInt(pst->st_size, 123456789); @@ -692,7 +692,7 @@ DEFINE_TEST(test_entry) archive_entry_set_ctime(e, 345677, 431); assert((pst = archive_entry_stat(e)) != NULL); assertEqualInt(pst->st_ctime, 345677); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_dev(e, 122); assert((pst = archive_entry_stat(e)) != NULL); assertEqualInt(pst->st_dev, 122); @@ -700,7 +700,7 @@ DEFINE_TEST(test_entry) archive_entry_set_gid(e, 33); assert((pst = archive_entry_stat(e)) != NULL); assertEqualInt(pst->st_gid, 33); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_ino(e, 233); assert((pst = archive_entry_stat(e)) != NULL); assertEqualInt(pst->st_ino, 233); @@ -711,7 +711,7 @@ DEFINE_TEST(test_entry) archive_entry_set_mtime(e, 234566, 542); assert((pst = archive_entry_stat(e)) != NULL); assertEqualInt(pst->st_mtime, 234566); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_nlink(e, 344); assert((pst = archive_entry_stat(e)) != NULL); assertEqualInt(pst->st_nlink, 344); @@ -739,7 +739,7 @@ DEFINE_TEST(test_entry) * the necessary definitions on every platform. */ #if __FreeBSD__ -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 archive_entry_set_dev(e, 0x12345678); assertEqualInt(archive_entry_devmajor(e), major(0x12345678)); assertEqualInt(archive_entry_devminor(e), minor(0x12345678)); diff --git a/lib/libarchive/test/test_read_compress_program.c b/lib/libarchive/test/test_read_compress_program.c index 0127970..860b5dd 100644 --- a/lib/libarchive/test/test_read_compress_program.c +++ b/lib/libarchive/test/test_read_compress_program.c @@ -34,7 +34,7 @@ static unsigned char archive[] = { DEFINE_TEST(test_read_compress_program) { -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("archive_read_support_compression_program()"); #else struct archive_entry *ae; @@ -48,10 +48,10 @@ DEFINE_TEST(test_read_compress_program) assert(archive_compression(a) == ARCHIVE_COMPRESSION_PROGRAM); assert(archive_format(a) == ARCHIVE_FORMAT_TAR_USTAR); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif #endif } diff --git a/lib/libarchive/test/test_read_data_large.c b/lib/libarchive/test/test_read_data_large.c index 0361d5e..76b9e12 100644 --- a/lib/libarchive/test/test_read_data_large.c +++ b/lib/libarchive/test/test_read_data_large.c @@ -67,10 +67,10 @@ DEFINE_TEST(test_read_data_large) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif /* Check that archive_read_data can handle 10*10^6 at a pop. */ @@ -84,10 +84,10 @@ DEFINE_TEST(test_read_data_large) failure("Read expected 10MB, but data read didn't match what was written"); assert(0 == memcmp(buff2, buff3, sizeof(buff3))); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif /* Check archive_read_data_into_fd */ @@ -100,10 +100,10 @@ DEFINE_TEST(test_read_data_large) assert(tmpfilefd != 0); assertEqualIntA(a, 0, archive_read_data_into_fd(a, tmpfilefd)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif close(tmpfilefd); diff --git a/lib/libarchive/test/test_read_extract.c b/lib/libarchive/test/test_read_extract.c index da23a8c..f443646 100644 --- a/lib/libarchive/test/test_read_extract.c +++ b/lib/libarchive/test/test_read_extract.c @@ -105,10 +105,10 @@ DEFINE_TEST(test_read_extract) archive_entry_free(ae); /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif /* Extract the entries to disk. */ @@ -128,10 +128,10 @@ DEFINE_TEST(test_read_extract) } assertA(ARCHIVE_EOF == archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif /* Test the entries on disk. */ diff --git a/lib/libarchive/test/test_read_format_ar.c b/lib/libarchive/test/test_read_format_ar.c index 95e8b3f..f4b31de 100644 --- a/lib/libarchive/test/test_read_format_ar.c +++ b/lib/libarchive/test/test_read_format_ar.c @@ -28,7 +28,7 @@ #include "test.h" __FBSDID("$FreeBSD$"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 /* * This "archive" is created by "GNU ar". Here we try to verify * our GNU format handling functionality. @@ -59,7 +59,7 @@ char buff[64]; DEFINE_TEST(test_read_format_ar) { -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("test_read_support_format_ar()"); #else struct archive_entry *ae; @@ -110,10 +110,10 @@ DEFINE_TEST(test_read_format_ar) /* Test EOF */ assertA(1 == archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif #endif } diff --git a/lib/libarchive/test/test_read_format_cpio_bin.c b/lib/libarchive/test/test_read_format_cpio_bin.c index dc840c4..4c81d90 100644 --- a/lib/libarchive/test/test_read_format_cpio_bin.c +++ b/lib/libarchive/test/test_read_format_cpio_bin.c @@ -54,10 +54,10 @@ DEFINE_TEST(test_read_format_cpio_bin) assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE); assertA(archive_format(a) == ARCHIVE_FORMAT_CPIO_BIN_LE); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_cpio_bin_Z.c b/lib/libarchive/test/test_read_format_cpio_bin_Z.c index a22c259..9cfadd6 100644 --- a/lib/libarchive/test/test_read_format_cpio_bin_Z.c +++ b/lib/libarchive/test/test_read_format_cpio_bin_Z.c @@ -43,10 +43,10 @@ DEFINE_TEST(test_read_format_cpio_bin_Z) assertA(archive_compression(a) == ARCHIVE_COMPRESSION_COMPRESS); assertA(archive_format(a) == ARCHIVE_FORMAT_CPIO_BIN_LE); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_cpio_bin_bz2.c b/lib/libarchive/test/test_read_format_cpio_bin_bz2.c index 4aeb70a..f72c3b8 100644 --- a/lib/libarchive/test/test_read_format_cpio_bin_bz2.c +++ b/lib/libarchive/test/test_read_format_cpio_bin_bz2.c @@ -44,10 +44,10 @@ DEFINE_TEST(test_read_format_cpio_bin_bz2) assert(archive_compression(a) == ARCHIVE_COMPRESSION_BZIP2); assert(archive_format(a) == ARCHIVE_FORMAT_CPIO_BIN_LE); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_cpio_bin_gz.c b/lib/libarchive/test/test_read_format_cpio_bin_gz.c index cefa0b3..ec058bf 100644 --- a/lib/libarchive/test/test_read_format_cpio_bin_gz.c +++ b/lib/libarchive/test/test_read_format_cpio_bin_gz.c @@ -43,10 +43,10 @@ DEFINE_TEST(test_read_format_cpio_bin_gz) assert(archive_compression(a) == ARCHIVE_COMPRESSION_GZIP); assert(archive_format(a) == ARCHIVE_FORMAT_CPIO_BIN_LE); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_cpio_odc.c b/lib/libarchive/test/test_read_format_cpio_odc.c index 6b758bb..cc0b79b 100644 --- a/lib/libarchive/test/test_read_format_cpio_odc.c +++ b/lib/libarchive/test/test_read_format_cpio_odc.c @@ -58,10 +58,10 @@ DEFINE_TEST(test_read_format_cpio_odc) assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE); assertA(archive_format(a) == ARCHIVE_FORMAT_CPIO_POSIX); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_cpio_svr4_gzip.c b/lib/libarchive/test/test_read_format_cpio_svr4_gzip.c index e46f0f8..3babcfd 100644 --- a/lib/libarchive/test/test_read_format_cpio_svr4_gzip.c +++ b/lib/libarchive/test/test_read_format_cpio_svr4_gzip.c @@ -44,10 +44,10 @@ DEFINE_TEST(test_read_format_cpio_svr4_gzip) assert(archive_compression(a) == ARCHIVE_COMPRESSION_GZIP); assert(archive_format(a) == ARCHIVE_FORMAT_CPIO_SVR4_NOCRC); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_cpio_svr4c_Z.c b/lib/libarchive/test/test_read_format_cpio_svr4c_Z.c index bc89c8f..975aca3 100644 --- a/lib/libarchive/test/test_read_format_cpio_svr4c_Z.c +++ b/lib/libarchive/test/test_read_format_cpio_svr4c_Z.c @@ -46,10 +46,10 @@ DEFINE_TEST(test_read_format_cpio_svr4c_Z) assertA(archive_compression(a) == ARCHIVE_COMPRESSION_COMPRESS); assertA(archive_format(a) == ARCHIVE_FORMAT_CPIO_SVR4_CRC); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_empty.c b/lib/libarchive/test/test_read_format_empty.c index 761b2a9..e1ebbb6 100644 --- a/lib/libarchive/test/test_read_format_empty.c +++ b/lib/libarchive/test/test_read_format_empty.c @@ -39,10 +39,10 @@ DEFINE_TEST(test_read_format_empty) assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE); assertA(archive_format(a) == ARCHIVE_FORMAT_EMPTY); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_gtar_gz.c b/lib/libarchive/test/test_read_format_gtar_gz.c index 5ea549a..af11c33 100644 --- a/lib/libarchive/test/test_read_format_gtar_gz.c +++ b/lib/libarchive/test/test_read_format_gtar_gz.c @@ -44,10 +44,10 @@ DEFINE_TEST(test_read_format_gtar_gz) assert(archive_compression(a) == ARCHIVE_COMPRESSION_GZIP); assert(archive_format(a) == ARCHIVE_FORMAT_TAR_GNUTAR); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_gtar_sparse.c b/lib/libarchive/test/test_read_format_gtar_sparse.c index f3eb274..4506a3a 100644 --- a/lib/libarchive/test/test_read_format_gtar_sparse.c +++ b/lib/libarchive/test/test_read_format_gtar_sparse.c @@ -248,7 +248,7 @@ verify_archive_file(const char *name, struct archive_contents *ac) assertEqualIntA(a, err, ARCHIVE_EOF); failure("%s: Size returned at EOF must be zero", name); assertEqualInt(actual.s, 0); -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 /* libarchive < 1.9 doesn't get this right */ skipping("offset of final sparse chunk"); #else @@ -263,10 +263,10 @@ verify_archive_file(const char *name, struct archive_contents *ac) assertEqualIntA(a, ARCHIVE_EOF, err); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } @@ -281,7 +281,7 @@ DEFINE_TEST(test_read_format_gtar_sparse) * libarchive < 1.9 doesn't support the newer --posix sparse formats * from GNU tar 1.15 and later. */ -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("read support for GNUtar --posix sparse formats"); #else /* diff --git a/lib/libarchive/test/test_read_format_iso_gz.c b/lib/libarchive/test/test_read_format_iso_gz.c index fd8f60e..8aa864a 100644 --- a/lib/libarchive/test/test_read_format_iso_gz.c +++ b/lib/libarchive/test/test_read_format_iso_gz.c @@ -63,10 +63,10 @@ DEFINE_TEST(test_read_format_iso_gz) assert(archive_compression(a) == ARCHIVE_COMPRESSION_GZIP); assert(archive_format(a) == ARCHIVE_FORMAT_ISO9660); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_isorr_bz2.c b/lib/libarchive/test/test_read_format_isorr_bz2.c index 3973104..a6ad832 100644 --- a/lib/libarchive/test/test_read_format_isorr_bz2.c +++ b/lib/libarchive/test/test_read_format_isorr_bz2.c @@ -131,10 +131,10 @@ DEFINE_TEST(test_read_format_isorr_bz2) /* Close the archive. */ assertEqualInt(0, archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertEqualInt(0, archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assertEqualInt(0, archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_mtree.c b/lib/libarchive/test/test_read_format_mtree.c index 861fbc7..f900e4c 100644 --- a/lib/libarchive/test/test_read_format_mtree.c +++ b/lib/libarchive/test/test_read_format_mtree.c @@ -103,10 +103,10 @@ DEFINE_TEST(test_read_format_mtree) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_pax_bz2.c b/lib/libarchive/test/test_read_format_pax_bz2.c index 039bd53..9c59394 100644 --- a/lib/libarchive/test/test_read_format_pax_bz2.c +++ b/lib/libarchive/test/test_read_format_pax_bz2.c @@ -52,10 +52,10 @@ DEFINE_TEST(test_read_format_pax_bz2) assert(archive_compression(a) == ARCHIVE_COMPRESSION_BZIP2); assert(archive_format(a) == ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_tar.c b/lib/libarchive/test/test_read_format_tar.c index bfe0b13..812f90e 100644 --- a/lib/libarchive/test/test_read_format_tar.c +++ b/lib/libarchive/test/test_read_format_tar.c @@ -75,10 +75,10 @@ static void verifyEmpty(void) assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } @@ -447,10 +447,10 @@ static void verify(unsigned char *d, size_t s, f(ae); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif free(buff); } diff --git a/lib/libarchive/test/test_read_format_tar_empty_filename.c b/lib/libarchive/test/test_read_format_tar_empty_filename.c index d9ba69b..4eb249e 100644 --- a/lib/libarchive/test/test_read_format_tar_empty_filename.c +++ b/lib/libarchive/test/test_read_format_tar_empty_filename.c @@ -58,9 +58,9 @@ DEFINE_TEST(test_read_format_tar_empty_filename) assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_tbz.c b/lib/libarchive/test/test_read_format_tbz.c index 17f24ea..b952b03 100644 --- a/lib/libarchive/test/test_read_format_tbz.c +++ b/lib/libarchive/test/test_read_format_tbz.c @@ -45,10 +45,10 @@ DEFINE_TEST(test_read_format_tbz) assert(archive_compression(a) == ARCHIVE_COMPRESSION_BZIP2); assert(archive_format(a) == ARCHIVE_FORMAT_TAR_USTAR); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_tgz.c b/lib/libarchive/test/test_read_format_tgz.c index 4235358..f046733 100644 --- a/lib/libarchive/test/test_read_format_tgz.c +++ b/lib/libarchive/test/test_read_format_tgz.c @@ -44,10 +44,10 @@ DEFINE_TEST(test_read_format_tgz) assert(archive_compression(a) == ARCHIVE_COMPRESSION_GZIP); assert(archive_format(a) == ARCHIVE_FORMAT_TAR_USTAR); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_tz.c b/lib/libarchive/test/test_read_format_tz.c index d7a91e2..94a2841 100644 --- a/lib/libarchive/test/test_read_format_tz.c +++ b/lib/libarchive/test/test_read_format_tz.c @@ -46,10 +46,10 @@ DEFINE_TEST(test_read_format_tz) assertA(archive_compression(a) == ARCHIVE_COMPRESSION_COMPRESS); assertA(archive_format(a) == ARCHIVE_FORMAT_TAR_USTAR); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_format_zip.c b/lib/libarchive/test/test_read_format_zip.c index d385b1c..e4cfaa1 100644 --- a/lib/libarchive/test/test_read_format_zip.c +++ b/lib/libarchive/test/test_read_format_zip.c @@ -65,10 +65,10 @@ DEFINE_TEST(test_read_format_zip) assertA(archive_format(a) == ARCHIVE_FORMAT_ZIP); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_read_large.c b/lib/libarchive/test/test_read_large.c index 44a2b38..6fdae3f 100644 --- a/lib/libarchive/test/test_read_large.c +++ b/lib/libarchive/test/test_read_large.c @@ -52,10 +52,10 @@ DEFINE_TEST(test_read_large) assertA(0 == archive_write_header(a, entry)); archive_entry_free(entry); assertA(sizeof(testdata) == archive_write_data(a, testdata, sizeof(testdata))); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif assert(NULL != (a = archive_read_new())); @@ -64,10 +64,10 @@ DEFINE_TEST(test_read_large) assertA(0 == archive_read_open_memory(a, buff, sizeof(buff))); assertA(0 == archive_read_next_header(a, &entry)); assertA(0 == archive_read_data_into_buffer(a, testdatacopy, sizeof(testdatacopy))); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assertA(0 == archive_read_finish(a)); #endif assert(0 == memcmp(testdata, testdatacopy, sizeof(testdata))); @@ -80,10 +80,10 @@ DEFINE_TEST(test_read_large) assert(0 < (tmpfilefd = mkstemp(tmpfilename))); assertA(0 == archive_read_data_into_fd(a, tmpfilefd)); close(tmpfilefd); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assertA(0 == archive_read_finish(a)); #endif tmpfilefd = open(tmpfilename, O_RDONLY); read(tmpfilefd, testdatacopy, sizeof(testdatacopy)); diff --git a/lib/libarchive/test/test_read_pax_truncated.c b/lib/libarchive/test/test_read_pax_truncated.c index 132c733..f102dddf 100644 --- a/lib/libarchive/test/test_read_pax_truncated.c +++ b/lib/libarchive/test/test_read_pax_truncated.c @@ -60,10 +60,10 @@ DEFINE_TEST(test_read_pax_truncated) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif /* Now, read back a truncated version of the archive and @@ -104,10 +104,10 @@ DEFINE_TEST(test_read_pax_truncated) } wrap_up: assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } @@ -147,10 +147,10 @@ DEFINE_TEST(test_read_pax_truncated) } wrap_up2: assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } @@ -167,10 +167,10 @@ DEFINE_TEST(test_read_pax_truncated) assertA(0 == archive_read_open_memory(a, buff2, used)); assertEqualIntA(a, ARCHIVE_WARN, archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif /* Damage the size field in the pax attributes. */ @@ -182,10 +182,10 @@ DEFINE_TEST(test_read_pax_truncated) assertA(0 == archive_read_open_memory(a, buff2, used)); assertEqualIntA(a, ARCHIVE_WARN, archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif /* Damage the size field in the pax attributes. */ @@ -199,10 +199,10 @@ DEFINE_TEST(test_read_pax_truncated) assertA(0 == archive_read_open_memory(a, buff2, used)); assertEqualIntA(a, ARCHIVE_WARN, archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif /* Damage the size field in the pax attributes. */ @@ -217,10 +217,10 @@ DEFINE_TEST(test_read_pax_truncated) assertA(0 == archive_read_open_memory(a, buff2, used)); assertEqualIntA(a, ARCHIVE_WARN, archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif /* Damage the size field in the pax attributes. */ @@ -233,10 +233,10 @@ DEFINE_TEST(test_read_pax_truncated) assertA(0 == archive_read_open_memory(a, buff2, used)); assertEqualIntA(a, ARCHIVE_WARN, archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif /* Damage the size field in the pax attributes. */ @@ -248,10 +248,10 @@ DEFINE_TEST(test_read_pax_truncated) assertA(0 == archive_read_open_memory(a, buff2, used)); assertEqualIntA(a, ARCHIVE_WARN, archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif /* Damage the ustar header. */ @@ -263,10 +263,10 @@ DEFINE_TEST(test_read_pax_truncated) assertA(0 == archive_read_open_memory(a, buff2, used)); assertEqualIntA(a, ARCHIVE_FATAL, archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif /* diff --git a/lib/libarchive/test/test_read_position.c b/lib/libarchive/test/test_read_position.c index d35766c..c700c8c 100644 --- a/lib/libarchive/test/test_read_position.c +++ b/lib/libarchive/test/test_read_position.c @@ -49,11 +49,11 @@ DEFINE_TEST(test_read_position) assertA(0 == archive_write_header(a, ae)); archive_entry_free(ae); assertA(data_size == (size_t)archive_write_data(a, nulls, sizeof(nulls))); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 assertA(0 == archive_write_close(a)); archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif /* 512-byte header + data_size (rounded up) + 1024 end-of-archive */ assert(write_pos == ((512 + data_size + 1024 + 511)/512)*512); diff --git a/lib/libarchive/test/test_read_truncated.c b/lib/libarchive/test/test_read_truncated.c index 1cc62b2..4c1fec3 100644 --- a/lib/libarchive/test/test_read_truncated.c +++ b/lib/libarchive/test/test_read_truncated.c @@ -56,10 +56,10 @@ DEFINE_TEST(test_read_truncated) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif /* Now, read back a truncated version of the archive and @@ -97,10 +97,10 @@ DEFINE_TEST(test_read_truncated) } wrap_up: assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } @@ -140,10 +140,10 @@ DEFINE_TEST(test_read_truncated) } wrap_up2: assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } } diff --git a/lib/libarchive/test/test_tar_filenames.c b/lib/libarchive/test/test_tar_filenames.c index e96d2ec..ac6df3e 100644 --- a/lib/libarchive/test/test_tar_filenames.c +++ b/lib/libarchive/test/test_tar_filenames.c @@ -101,10 +101,10 @@ test_filename(const char *prefix, int dlen, int flen) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif /* @@ -117,7 +117,7 @@ test_filename(const char *prefix, int dlen, int flen) /* Read the file and check the filename. */ assertA(0 == archive_read_next_header(a, &ae)); -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("Leading '/' preserved on long filenames"); #else assertEqualString(filename, archive_entry_pathname(ae)); @@ -133,7 +133,7 @@ test_filename(const char *prefix, int dlen, int flen) * here. */ assertA(0 == archive_read_next_header(a, &ae)); -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("Trailing '/' preserved on dirnames"); #else assertEqualString(dirname, archive_entry_pathname(ae)); @@ -141,7 +141,7 @@ test_filename(const char *prefix, int dlen, int flen) assert((S_IFDIR | 0755) == archive_entry_mode(ae)); assertA(0 == archive_read_next_header(a, &ae)); -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("Trailing '/' added to dir names"); #else assertEqualString(dirname, archive_entry_pathname(ae)); @@ -151,10 +151,10 @@ test_filename(const char *prefix, int dlen, int flen) /* Verify the end of the archive. */ assert(1 == archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } diff --git a/lib/libarchive/test/test_tar_large.c b/lib/libarchive/test/test_tar_large.c index 5ce3105..542603d 100644 --- a/lib/libarchive/test/test_tar_large.c +++ b/lib/libarchive/test/test_tar_large.c @@ -73,7 +73,7 @@ struct memdata { #define GB ((off_t)1024 * MB) #define TB ((off_t)1024 * GB) -#if ARCHIVE_API_VERSION < 2 +#if ARCHIVE_VERSION_NUMBER < 2000000 static ssize_t memory_read_skip(struct archive *, void *, size_t request); #else static off_t memory_read_skip(struct archive *, void *, off_t request); @@ -167,7 +167,7 @@ memory_read(struct archive *a, void *_private, const void **buff) } -#if ARCHIVE_API_VERSION < 2 +#if ARCHIVE_VERSION_NUMBER < 2000000 static ssize_t memory_read_skip(struct archive *a, void *private, size_t skip) { @@ -273,10 +273,10 @@ DEFINE_TEST(test_tar_large) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif /* @@ -303,10 +303,10 @@ DEFINE_TEST(test_tar_large) /* Close out the archive. */ assertA(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assertA(0 == archive_read_finish(a)); #endif free(memdata.buff); diff --git a/lib/libarchive/test/test_write_compress.c b/lib/libarchive/test/test_write_compress.c index 2f4d38d1..a133690 100644 --- a/lib/libarchive/test/test_write_compress.c +++ b/lib/libarchive/test/test_write_compress.c @@ -68,10 +68,10 @@ DEFINE_TEST(test_write_compress) archive_write_close(a); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assert(0 == archive_write_finish(a)); #endif /* @@ -91,10 +91,10 @@ DEFINE_TEST(test_write_compress) } assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif free(data); diff --git a/lib/libarchive/test/test_write_compress_program.c b/lib/libarchive/test/test_write_compress_program.c index 4376a53..c5d1d9a 100644 --- a/lib/libarchive/test/test_write_compress_program.c +++ b/lib/libarchive/test/test_write_compress_program.c @@ -30,7 +30,7 @@ char buff2[64]; DEFINE_TEST(test_write_compress_program) { -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("archive_write_set_compress_program()"); #else struct archive_entry *ae; @@ -64,10 +64,10 @@ DEFINE_TEST(test_write_compress_program) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif /* @@ -92,10 +92,10 @@ DEFINE_TEST(test_write_compress_program) /* Verify the end of the archive. */ assert(1 == archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif #endif } diff --git a/lib/libarchive/test/test_write_disk.c b/lib/libarchive/test/test_write_disk.c index cb9ef62..41eb1d8 100644 --- a/lib/libarchive/test/test_write_disk.c +++ b/lib/libarchive/test/test_write_disk.c @@ -25,7 +25,7 @@ #include "test.h" __FBSDID("$FreeBSD$"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 #define UMASK 022 @@ -39,10 +39,10 @@ static void create(struct archive_entry *ae, const char *msg) failure("%s", msg); assertEqualIntA(ad, 0, archive_write_header(ad, ae)); assertEqualIntA(ad, 0, archive_write_finish_entry(ad)); -#if ARCHIVE_API_VERSION > 1 - assertEqualInt(0, archive_write_finish(ad)); -#else +#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(archive_entry_pathname(ae), &st)); @@ -88,10 +88,10 @@ static void create_reg_file(struct archive_entry *ae, const char *msg) assertEqualIntA(ad, 0, archive_write_header(ad, ae)); assertEqualInt(sizeof(data), archive_write_data(ad, data, sizeof(data))); assertEqualIntA(ad, 0, archive_write_finish_entry(ad)); -#if ARCHIVE_API_VERSION > 1 - assertEqualInt(0, archive_write_finish(ad)); -#else +#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(archive_entry_pathname(ae), &st)); @@ -132,10 +132,10 @@ static void create_reg_file2(struct archive_entry *ae, const char *msg) archive_write_data_block(ad, data + i, 1000, i)); } assertEqualIntA(ad, 0, archive_write_finish_entry(ad)); -#if ARCHIVE_API_VERSION > 1 - assertEqualInt(0, archive_write_finish(ad)); -#else +#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(archive_entry_pathname(ae), &st)); @@ -156,7 +156,7 @@ static void create_reg_file2(struct archive_entry *ae, const char *msg) DEFINE_TEST(test_write_disk) { -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("archive_write_disk interface"); #else struct archive_entry *ae; diff --git a/lib/libarchive/test/test_write_disk_hardlink.c b/lib/libarchive/test/test_write_disk_hardlink.c index 68f2f26..f8197c8 100644 --- a/lib/libarchive/test/test_write_disk_hardlink.c +++ b/lib/libarchive/test/test_write_disk_hardlink.c @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); */ DEFINE_TEST(test_write_disk_hardlink) { -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("archive_write_disk_hardlink tests"); #else static const char data[]="abcdefghijklmnopqrstuvwxyz"; diff --git a/lib/libarchive/test/test_write_disk_perms.c b/lib/libarchive/test/test_write_disk_perms.c index 15633f6..3db3fdb 100644 --- a/lib/libarchive/test/test_write_disk_perms.c +++ b/lib/libarchive/test/test_write_disk_perms.c @@ -25,7 +25,7 @@ #include "test.h" __FBSDID("$FreeBSD$"); -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 #define UMASK 022 @@ -125,7 +125,7 @@ defaultgid(void) DEFINE_TEST(test_write_disk_perms) { -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("archive_write_disk interface"); #else struct archive *a; @@ -363,10 +363,10 @@ DEFINE_TEST(test_write_disk_perms) assertEqualIntA(a,ARCHIVE_WARN,archive_write_finish_entry(a)); } -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assert(0 == archive_write_finish(a)); #endif archive_entry_free(ae); diff --git a/lib/libarchive/test/test_write_disk_secure.c b/lib/libarchive/test/test_write_disk_secure.c index 9f9b5da..94e09eb 100644 --- a/lib/libarchive/test/test_write_disk_secure.c +++ b/lib/libarchive/test/test_write_disk_secure.c @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); DEFINE_TEST(test_write_disk_secure) { -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("archive_write_disk interface"); #else struct archive *a; @@ -105,11 +105,10 @@ DEFINE_TEST(test_write_disk_secure) archive_entry_free(ae); assert(0 == archive_write_finish_entry(a)); - -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assert(0 == archive_write_finish(a)); #endif /* Test the entries on disk. */ diff --git a/lib/libarchive/test/test_write_format_ar.c b/lib/libarchive/test/test_write_format_ar.c index 09d6baa..19a1327 100644 --- a/lib/libarchive/test/test_write_format_ar.c +++ b/lib/libarchive/test/test_write_format_ar.c @@ -34,7 +34,7 @@ static char strtab[] = "abcdefghijklmn.o/\nggghhhjjjrrrttt.o/\niiijjjdddsssppp.o DEFINE_TEST(test_write_format_ar) { -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 skipping("ar write support"); #else struct archive_entry *ae; @@ -102,10 +102,10 @@ DEFINE_TEST(test_write_format_ar) archive_entry_free(ae); archive_write_close(a); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assert(0 == archive_write_finish(a)); #endif /* @@ -141,10 +141,10 @@ DEFINE_TEST(test_write_format_ar) assert(0 == memcmp(buff2, "88877766", 8)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif /* @@ -175,10 +175,10 @@ DEFINE_TEST(test_write_format_ar) assertA(6 == archive_write_data(a, "555555", 7)); archive_entry_free(ae); archive_write_close(a); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assert(0 == archive_write_finish(a)); #endif /* Now, Read the data back */ @@ -202,10 +202,10 @@ DEFINE_TEST(test_write_format_ar) /* Test EOF */ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif #endif } diff --git a/lib/libarchive/test/test_write_format_cpio.c b/lib/libarchive/test/test_write_format_cpio.c index 5368e56..6d0858a 100644 --- a/lib/libarchive/test/test_write_format_cpio.c +++ b/lib/libarchive/test/test_write_format_cpio.c @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$"); /* The version stamp macro was introduced after cpio write support. */ -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 static void test_format(int (*set_format)(struct archive *)) { @@ -104,10 +104,10 @@ test_format(int (*set_format)(struct archive *)) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif /* @@ -182,10 +182,10 @@ test_format(int (*set_format)(struct archive *)) /* Verify the end of the archive. */ assertEqualIntA(a, 1, archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif free(buff); @@ -194,7 +194,7 @@ test_format(int (*set_format)(struct archive *)) DEFINE_TEST(test_write_format_cpio) { -#if ARCHIVE_VERSION_STAMP >= 1009000 +#if ARCHIVE_VERSION_NUMBER >= 1009000 test_format(archive_write_set_format_cpio); test_format(archive_write_set_format_cpio_newc); #else diff --git a/lib/libarchive/test/test_write_format_cpio_empty.c b/lib/libarchive/test/test_write_format_cpio_empty.c index 9f50e77..81f17a4 100644 --- a/lib/libarchive/test/test_write_format_cpio_empty.c +++ b/lib/libarchive/test/test_write_format_cpio_empty.c @@ -62,10 +62,10 @@ DEFINE_TEST(test_write_format_cpio_empty) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif failure("Empty cpio archive should be exactly 87 bytes, was %d.", used); diff --git a/lib/libarchive/test/test_write_format_cpio_newc.c b/lib/libarchive/test/test_write_format_cpio_newc.c index 9b16e47..83c88ad 100644 --- a/lib/libarchive/test/test_write_format_cpio_newc.c +++ b/lib/libarchive/test/test_write_format_cpio_newc.c @@ -111,10 +111,10 @@ DEFINE_TEST(test_write_format_cpio_newc) archive_entry_free(entry); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assert(0 == archive_write_finish(a)); #endif /* diff --git a/lib/libarchive/test/test_write_format_cpio_odc.c b/lib/libarchive/test/test_write_format_cpio_odc.c index 796dd7e..0434a84 100644 --- a/lib/libarchive/test/test_write_format_cpio_odc.c +++ b/lib/libarchive/test/test_write_format_cpio_odc.c @@ -122,10 +122,10 @@ DEFINE_TEST(test_write_format_cpio_odc) /* Write of data to symlink should fail == zero bytes get written. */ assertEqualIntA(a, 0, archive_write_data(a, "1234567890", 10)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assert(0 == archive_write_finish(a)); #endif /* diff --git a/lib/libarchive/test/test_write_format_shar_empty.c b/lib/libarchive/test/test_write_format_shar_empty.c index 0af57dd..173791b 100644 --- a/lib/libarchive/test/test_write_format_shar_empty.c +++ b/lib/libarchive/test/test_write_format_shar_empty.c @@ -47,10 +47,10 @@ DEFINE_TEST(test_write_format_shar_empty) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif failure("Empty shar archive should be exactly 0 bytes, was %d.", used); diff --git a/lib/libarchive/test/test_write_format_tar.c b/lib/libarchive/test/test_write_format_tar.c index 8b49895..7cd11bf 100644 --- a/lib/libarchive/test/test_write_format_tar.c +++ b/lib/libarchive/test/test_write_format_tar.c @@ -72,10 +72,10 @@ DEFINE_TEST(test_write_format_tar) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif /* This calculation gives "the smallest multiple of * the block size that is at least 2048 bytes". */ @@ -105,10 +105,10 @@ DEFINE_TEST(test_write_format_tar) /* Verify the end of the archive. */ assert(1 == archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_read_finish(a); +#else + assert(0 == archive_read_finish(a)); #endif } } diff --git a/lib/libarchive/test/test_write_format_tar_empty.c b/lib/libarchive/test/test_write_format_tar_empty.c index 86bdebc..538bccf 100644 --- a/lib/libarchive/test/test_write_format_tar_empty.c +++ b/lib/libarchive/test/test_write_format_tar_empty.c @@ -46,13 +46,13 @@ DEFINE_TEST(test_write_format_tar_empty) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 /* Earlier versions wrote 0-length files for empty tar archives. */ skipping("empty tar archive size"); #else @@ -73,13 +73,13 @@ DEFINE_TEST(test_write_format_tar_empty) /* Close out the archive. */ assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assertA(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assertA(0 == archive_write_finish(a)); #endif -#if ARCHIVE_VERSION_STAMP < 1009000 +#if ARCHIVE_VERSION_NUMBER < 1009000 /* Earlier versions wrote 0-length files for empty tar archives. */ skipping("empty tar archive size"); #else diff --git a/lib/libarchive/test/test_write_open_memory.c b/lib/libarchive/test/test_write_open_memory.c index 9042876..d5f982c 100644 --- a/lib/libarchive/test/test_write_open_memory.c +++ b/lib/libarchive/test/test_write_open_memory.c @@ -64,10 +64,10 @@ DEFINE_TEST(test_write_open_memory) assertA(ARCHIVE_FATAL == archive_write_close(a)); else assertA(0 == archive_write_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_write_finish(a)); -#else +#if ARCHIVE_VERSION_NUMBER < 2000000 archive_write_finish(a); +#else + assert(0 == archive_write_finish(a)); #endif assert(buff[i] == 0xAE); assert(s <= i); |