summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/test/test_write_format_cpio.c
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-09-01 05:38:33 +0000
committerkientzle <kientzle@FreeBSD.org>2008-09-01 05:38:33 +0000
commitda7b4a0824397b1c724cdf9a9b03b642ef8610ae (patch)
tree33ffbad3b60850d7aaaa2e6c79990403e110b2c2 /lib/libarchive/test/test_write_format_cpio.c
parent4f7f14505ade23cf1713dac8e039845e724b1326 (diff)
downloadFreeBSD-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/libarchive/test/test_write_format_cpio.c')
-rw-r--r--lib/libarchive/test/test_write_format_cpio.c16
1 files changed, 8 insertions, 8 deletions
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
OpenPOWER on IntegriCloud