diff options
Diffstat (limited to 'lib/libarchive/test/test_read_format_ar.c')
-rw-r--r-- | lib/libarchive/test/test_read_format_ar.c | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/lib/libarchive/test/test_read_format_ar.c b/lib/libarchive/test/test_read_format_ar.c index f4b31de..fc95978 100644 --- a/lib/libarchive/test/test_read_format_ar.c +++ b/lib/libarchive/test/test_read_format_ar.c @@ -28,46 +28,19 @@ #include "test.h" __FBSDID("$FreeBSD$"); -#if ARCHIVE_VERSION_NUMBER >= 1009000 -/* - * This "archive" is created by "GNU ar". Here we try to verify - * our GNU format handling functionality. - */ -static unsigned char archive[] = { -'!','<','a','r','c','h','>',10,'/','/',' ',' ',' ',' ',' ',' ',' ', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', -' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', -' ',' ',' ',' ',' ','4','0',' ',' ',' ',' ',' ',' ',' ',' ','`',10, -'y','y','y','t','t','t','s','s','s','a','a','a','f','f','f','.','o', -'/',10,'h','h','h','h','j','j','j','j','k','k','k','k','l','l','l', -'l','.','o','/',10,10,'/','0',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', -' ',' ',' ',' ','1','1','7','5','4','6','5','6','5','2',' ',' ','1', -'0','0','1',' ',' ','0',' ',' ',' ',' ',' ','1','0','0','6','4','4', -' ',' ','8',' ',' ',' ',' ',' ',' ',' ',' ',' ','`',10,'5','5','6', -'6','7','7','8','8','g','g','h','h','.','o','/',' ',' ',' ',' ',' ', -' ',' ',' ',' ','1','1','7','5','4','6','5','6','6','8',' ',' ','1', -'0','0','1',' ',' ','0',' ',' ',' ',' ',' ','1','0','0','6','4','4', -' ',' ','4',' ',' ',' ',' ',' ',' ',' ',' ',' ','`',10,'3','3','3', -'3','/','1','9',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', -'1','1','7','5','4','6','5','7','1','3',' ',' ','1','0','0','1',' ', -' ','0',' ',' ',' ',' ',' ','1','0','0','6','4','4',' ',' ','9',' ', -' ',' ',' ',' ',' ',' ',' ',' ','`',10,'9','8','7','6','5','4','3', -'2','1',10}; - -char buff[64]; -#endif DEFINE_TEST(test_read_format_ar) { -#if ARCHIVE_VERSION_NUMBER < 1009000 - skipping("test_read_support_format_ar()"); -#else + char buff[64]; + const char reffile[] = "test_read_format_ar.ar"; struct archive_entry *ae; struct archive *a; + + extract_reference_file(reffile); assert((a = archive_read_new()) != NULL); assertA(0 == archive_read_support_compression_all(a)); assertA(0 == archive_read_support_format_all(a)); - assertA(0 == archive_read_open_memory(a, archive, sizeof(archive))); + assertA(0 == archive_read_open_file(a, reffile, 7)); /* Filename table. */ assertA(0 == archive_read_next_header(a, &ae)); @@ -110,10 +83,5 @@ DEFINE_TEST(test_read_format_ar) /* Test EOF */ assertA(1 == archive_read_next_header(a, &ae)); assert(0 == archive_read_close(a)); -#if ARCHIVE_VERSION_NUMBER < 2000000 - archive_read_finish(a); -#else assert(0 == archive_read_finish(a)); -#endif -#endif } |