From: Michihiro NAKAJIMA Date: Fri, 5 Feb 2010 04:48:23 +0000 (-0500) Subject: Fix test_read_format_cpio_afio failure on the some platform, X-Git-Tag: v3.0.0a~1283 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5db1525519681078cfaf0223df2c5ec7f84d805;p=thirdparty%2Flibarchive.git Fix test_read_format_cpio_afio failure on the some platform, on which the size of uid_t is too small to set a over 65535 value. But this fix will be removed when we use int64_t for uid. SVN-Revision: 1871 --- diff --git a/libarchive/test/test_read_format_cpio_afio.c b/libarchive/test/test_read_format_cpio_afio.c index 71748e01b..0d7b79a23 100644 --- a/libarchive/test/test_read_format_cpio_afio.c +++ b/libarchive/test/test_read_format_cpio_afio.c @@ -66,6 +66,15 @@ static unsigned char archive[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; +/* + * XXX This must be removed when we use int64_t for uid. + */ +static int +uid_size(void) +{ + return (sizeof(uid_t)); +} + DEFINE_TEST(test_read_format_cpio_afio) { unsigned char *p; @@ -95,7 +104,8 @@ DEFINE_TEST(test_read_format_cpio_afio) */ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt(17, archive_entry_size(ae)); - assertEqualInt(65536, archive_entry_uid(ae)); + if (uid_size() > 4) + assertEqualInt(65536, archive_entry_uid(ae)); assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE); assertA(archive_format(a) == ARCHIVE_FORMAT_CPIO_AFIO_LARGE); assertEqualInt(ARCHIVE_OK, archive_read_close(a));