003 File Manager
Current Path:
/usr/src/contrib/libarchive/libarchive/test
usr
/
src
/
contrib
/
libarchive
/
libarchive
/
test
/
📁
..
📄
README
(2.49 KB)
📄
main.c
(77.6 KB)
📄
read_open_memory.c
(6.3 KB)
📄
test.h
(1.9 KB)
📄
test_acl_nfs4.c
(8.49 KB)
📄
test_acl_pax.c
(15.87 KB)
📄
test_acl_pax_nfs4.tar.uu
(7.62 KB)
📄
test_acl_pax_posix1e.tar.uu
(6.93 KB)
📄
test_acl_platform_nfs4.c
(34.03 KB)
📄
test_acl_platform_posix1e.c
(16.11 KB)
📄
test_acl_posix1e.c
(7.13 KB)
📄
test_acl_text.c
(14.72 KB)
📄
test_archive_api_feature.c
(2.22 KB)
📄
test_archive_clear_error.c
(1.69 KB)
📄
test_archive_cmdline.c
(5.35 KB)
📄
test_archive_digest.c
(5.36 KB)
📄
test_archive_getdate.c
(3.82 KB)
📄
test_archive_match_owner.c
(9.59 KB)
📄
test_archive_match_path.c
(14.43 KB)
📄
test_archive_match_time.c
(42.76 KB)
📄
test_archive_pathmatch.c
(14.17 KB)
📄
test_archive_read_add_passphrase.c
(9.14 KB)
📄
test_archive_read_close_twice.c
(1.71 KB)
📄
test_archive_read_close_twice_open_fd.c
(1.97 KB)
📄
test_archive_read_close_twice_open_filename.c
(2.06 KB)
📄
test_archive_read_multiple_data_objects.c
(11.93 KB)
📄
test_archive_read_next_header_empty.c
(3.91 KB)
📄
test_archive_read_next_header_raw.c
(2.31 KB)
📄
test_archive_read_open2.c
(3.44 KB)
📄
test_archive_read_set_filter_option.c
(1.96 KB)
📄
test_archive_read_set_format_option.c
(2.46 KB)
📄
test_archive_read_set_option.c
(2.5 KB)
📄
test_archive_read_set_options.c
(4 KB)
📄
test_archive_read_support.c
(5.12 KB)
📄
test_archive_set_error.c
(1.84 KB)
📄
test_archive_string.c
(10.79 KB)
📄
test_archive_string_conversion.c
(25.02 KB)
📄
test_archive_string_conversion.txt.Z.uu
(157.5 KB)
📄
test_archive_write_add_filter_by_name.c
(6.45 KB)
📄
test_archive_write_set_filter_option.c
(1.96 KB)
📄
test_archive_write_set_format_by_name.c
(8.61 KB)
📄
test_archive_write_set_format_filter_by_ext.c
(7.16 KB)
📄
test_archive_write_set_format_option.c
(2.47 KB)
📄
test_archive_write_set_option.c
(2.5 KB)
📄
test_archive_write_set_options.c
(4 KB)
📄
test_archive_write_set_passphrase.c
(3.1 KB)
📄
test_bad_fd.c
(1.71 KB)
📄
test_compat_bzip2.c
(3.21 KB)
📄
test_compat_bzip2_1.tbz.uu
(1.18 KB)
📄
test_compat_bzip2_2.tbz.uu
(395 B)
📄
test_compat_cpio.c
(4.15 KB)
📄
test_compat_cpio_1.cpio.uu
(879 B)
📄
test_compat_gtar.c
(5.45 KB)
📄
test_compat_gtar_1.tar.uu
(13.83 KB)
📄
test_compat_gtar_2.tar.uu
(2.8 KB)
📄
test_compat_gzip.c
(3.5 KB)
📄
test_compat_gzip_1.tgz.uu
(1.16 KB)
📄
test_compat_gzip_2.tgz.uu
(406 B)
📄
test_compat_lz4.c
(4.75 KB)
📄
test_compat_lz4_1.tar.lz4.uu
(572 B)
📄
test_compat_lz4_2.tar.lz4.uu
(642 B)
📄
test_compat_lz4_3.tar.lz4.uu
(406 B)
📄
test_compat_lz4_B4.tar.lz4.uu
(407.84 KB)
📄
test_compat_lz4_B4BD.tar.lz4.uu
(407.84 KB)
📄
test_compat_lz4_B4BDBX.tar.lz4.uu
(408.19 KB)
📄
test_compat_lz4_B5.tar.lz4.uu
(139.72 KB)
📄
test_compat_lz4_B5BD.tar.lz4.uu
(139.72 KB)
📄
test_compat_lz4_B6.tar.lz4.uu
(72.29 KB)
📄
test_compat_lz4_B6BD.tar.lz4.uu
(72.29 KB)
📄
test_compat_lz4_B7.tar.lz4.uu
(55.43 KB)
📄
test_compat_lz4_B7BD.tar.lz4.uu
(55.43 KB)
📄
test_compat_lzip.c
(4.62 KB)
📄
test_compat_lzip_1.tlz.uu
(437 B)
📄
test_compat_lzip_2.tlz.uu
(359 B)
📄
test_compat_lzma.c
(5.09 KB)
📄
test_compat_lzma_1.tlz.uu
(352 B)
📄
test_compat_lzma_2.tlz.uu
(274 B)
📄
test_compat_lzma_3.tlz.uu
(274 B)
📄
test_compat_lzop.c
(5.09 KB)
📄
test_compat_lzop_1.tar.lzo.uu
(1.67 KB)
📄
test_compat_lzop_2.tar.lzo.uu
(2.17 KB)
📄
test_compat_lzop_3.tar.lzo.uu
(1.74 KB)
📄
test_compat_mac-1.tar.Z.uu
(2.11 KB)
📄
test_compat_mac-2.tar.Z.uu
(988 B)
📄
test_compat_mac.c
(8.21 KB)
📄
test_compat_perl_archive_tar.c
(2.63 KB)
📄
test_compat_perl_archive_tar.tar.uu
(2.81 KB)
📄
test_compat_plexus_archiver_tar.c
(2.75 KB)
📄
test_compat_plexus_archiver_tar.tar.uu
(2.81 KB)
📄
test_compat_solaris_pax_sparse.c
(6.76 KB)
📄
test_compat_solaris_pax_sparse_1.pax.Z.uu
(3.07 KB)
📄
test_compat_solaris_pax_sparse_2.pax.Z.uu
(3.07 KB)
📄
test_compat_solaris_tar_acl.c
(10.4 KB)
📄
test_compat_solaris_tar_acl.tar.uu
(9.7 KB)
📄
test_compat_star_acl.c
(12.21 KB)
📄
test_compat_star_acl_nfs4.tar.uu
(13.83 KB)
📄
test_compat_star_acl_posix1e.tar.uu
(13.83 KB)
📄
test_compat_tar_hardlink.c
(4.22 KB)
📄
test_compat_tar_hardlink_1.tar.uu
(2.12 KB)
📄
test_compat_uudecode.c
(2.72 KB)
📄
test_compat_uudecode_large.c
(2.47 KB)
📄
test_compat_uudecode_large.tar.Z.uu
(65.67 KB)
📄
test_compat_xz.c
(3.04 KB)
📄
test_compat_xz_1.txz.uu
(559 B)
📄
test_compat_zip.c
(17.39 KB)
📄
test_compat_zip_1.zip.uu
(726 B)
📄
test_compat_zip_2.zip.uu
(324 B)
📄
test_compat_zip_3.zip.uu
(952 B)
📄
test_compat_zip_4.zip.uu
(1.31 KB)
📄
test_compat_zip_5.zip.uu
(14.47 KB)
📄
test_compat_zip_6.zip.uu
(472 B)
📄
test_compat_zip_7.xps.uu
(21.46 KB)
📄
test_compat_zip_8.zip.uu
(226 B)
📄
test_compat_zstd.c
(3.17 KB)
📄
test_compat_zstd_1.tar.zst.uu
(553 B)
📄
test_compat_zstd_2.tar.zst.uu
(297 B)
📄
test_empty_write.c
(4.38 KB)
📄
test_entry.c
(37.69 KB)
📄
test_entry_strmode.c
(2.89 KB)
📄
test_extattr_freebsd.c
(5.21 KB)
📄
test_filter_count.c
(2.64 KB)
📄
test_fuzz.c
(15.12 KB)
📄
test_fuzz.cab.uu
(2.81 KB)
📄
test_fuzz.lzh.uu
(9 KB)
📄
test_fuzz_1.iso.Z.uu
(29.68 KB)
📄
test_gnutar_filename_encoding.c
(12.14 KB)
📄
test_link_resolver.c
(7.24 KB)
📄
test_open_failure.c
(7.24 KB)
📄
test_open_fd.c
(4.76 KB)
📄
test_open_file.c
(3.95 KB)
📄
test_open_filename.c
(7.26 KB)
📄
test_pax_filename_encoding.c
(20.46 KB)
📄
test_pax_filename_encoding.tar.uu
(6.95 KB)
📄
test_pax_xattr_header.c
(4.99 KB)
📄
test_pax_xattr_header_all.tar.uu
(4.18 KB)
📄
test_pax_xattr_header_libarchive.tar.uu
(4.19 KB)
📄
test_pax_xattr_header_schily.tar.uu
(4.18 KB)
📄
test_rar_multivolume_multiple_files.part1.rar.uu
(9.71 KB)
📄
test_rar_multivolume_multiple_files.part2.rar.uu
(9.71 KB)
📄
test_rar_multivolume_multiple_files.part3.rar.uu
(9.71 KB)
📄
test_rar_multivolume_multiple_files.part4.rar.uu
(9.71 KB)
📄
test_rar_multivolume_multiple_files.part5.rar.uu
(9.71 KB)
📄
test_rar_multivolume_multiple_files.part6.rar.uu
(6.92 KB)
📄
test_rar_multivolume_single_file.part1.rar.uu
(9.44 KB)
📄
test_rar_multivolume_single_file.part2.rar.uu
(9.44 KB)
📄
test_rar_multivolume_single_file.part3.rar.uu
(8.67 KB)
📄
test_rar_multivolume_uncompressed_files.part01.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part02.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part03.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part04.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part05.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part06.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part07.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part08.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part09.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part10.rar.uu
(4.33 KB)
📄
test_read_data_large.c
(4.34 KB)
📄
test_read_disk.c
(5.66 KB)
📄
test_read_disk_directory_traversals.c
(64.08 KB)
📄
test_read_disk_entry_from_file.c
(2.75 KB)
📄
test_read_extract.c
(6.43 KB)
📄
test_read_file_nonexistent.c
(1.6 KB)
📄
test_read_filter_compress.c
(3.08 KB)
📄
test_read_filter_grzip.c
(2.69 KB)
📄
test_read_filter_grzip.tar.grz.uu
(317 B)
📄
test_read_filter_lrzip.c
(2.69 KB)
📄
test_read_filter_lrzip.tar.lrz.uu
(472 B)
📄
test_read_filter_lzop.c
(3 KB)
📄
test_read_filter_lzop.tar.lzo.uu
(510 B)
📄
test_read_filter_lzop_multiple_parts.c
(3.13 KB)
📄
test_read_filter_lzop_multiple_parts.tar.lzo.uu
(5.24 KB)
📄
test_read_filter_program.c
(3.35 KB)
📄
test_read_filter_program_signature.c
(3.93 KB)
📄
test_read_filter_uudecode.c
(6.24 KB)
📄
test_read_format_7zip.c
(29.56 KB)
📄
test_read_format_7zip_bcj2_bzip2.7z.uu
(19.17 KB)
📄
test_read_format_7zip_bcj2_copy_1.7z.uu
(37.04 KB)
📄
test_read_format_7zip_bcj2_copy_2.7z.uu
(37.06 KB)
📄
test_read_format_7zip_bcj2_copy_lzma.7z.uu
(34.24 KB)
📄
test_read_format_7zip_bcj2_deflate.7z.uu
(18.77 KB)
📄
test_read_format_7zip_bcj2_lzma1_1.7z.uu
(17.19 KB)
📄
test_read_format_7zip_bcj2_lzma1_2.7z.uu
(14.38 KB)
📄
test_read_format_7zip_bcj2_lzma2_1.7z.uu
(17.19 KB)
📄
test_read_format_7zip_bcj2_lzma2_2.7z.uu
(14.39 KB)
📄
test_read_format_7zip_bcj_bzip2.7z.uu
(16.84 KB)
📄
test_read_format_7zip_bcj_copy.7z.uu
(36.97 KB)
📄
test_read_format_7zip_bcj_deflate.7z.uu
(16.47 KB)
📄
test_read_format_7zip_bcj_lzma1.7z.uu
(14.68 KB)
📄
test_read_format_7zip_bcj_lzma2.7z.uu
(14.68 KB)
📄
test_read_format_7zip_bzip2.7z.uu
(2.09 KB)
📄
test_read_format_7zip_copy.7z.uu
(266 B)
📄
test_read_format_7zip_copy_2.7z.uu
(488 B)
📄
test_read_format_7zip_deflate.7z.uu
(2 KB)
📄
test_read_format_7zip_delta4_lzma1.7z.uu
(24.46 KB)
📄
test_read_format_7zip_delta4_lzma2.7z.uu
(24.47 KB)
📄
test_read_format_7zip_delta_lzma1.7z.uu
(16.81 KB)
📄
test_read_format_7zip_delta_lzma2.7z.uu
(16.82 KB)
📄
test_read_format_7zip_empty_archive.7z.uu
(101 B)
📄
test_read_format_7zip_empty_file.7z.uu
(160 B)
📄
test_read_format_7zip_encryption.7z.uu
(256 B)
📄
test_read_format_7zip_encryption_data.c
(3.01 KB)
📄
test_read_format_7zip_encryption_header.7z.uu
(333 B)
📄
test_read_format_7zip_encryption_header.c
(3.06 KB)
📄
test_read_format_7zip_encryption_partially.7z.uu
(368 B)
📄
test_read_format_7zip_encryption_partially.c
(3.67 KB)
📄
test_read_format_7zip_lzma1.7z.uu
(2.05 KB)
📄
test_read_format_7zip_lzma1_2.7z.uu
(355 B)
📄
test_read_format_7zip_lzma1_lzma2.7z.uu
(447 B)
📄
test_read_format_7zip_lzma2.7z.uu
(2.06 KB)
📄
test_read_format_7zip_malformed.7z.uu
(127 B)
📄
test_read_format_7zip_malformed.c
(2.58 KB)
📄
test_read_format_7zip_malformed2.7z.uu
(128 B)
📄
test_read_format_7zip_packinfo_digests.7z.uu
(266 B)
📄
test_read_format_7zip_packinfo_digests.c
(3.5 KB)
📄
test_read_format_7zip_ppmd.7z.uu
(14.05 KB)
📄
test_read_format_7zip_symbolic_name.7z.uu
(317 B)
📄
test_read_format_ar.ar.uu
(480 B)
📄
test_read_format_ar.c
(3.92 KB)
📄
test_read_format_cab.c
(12.99 KB)
📄
test_read_format_cab_1.cab.uu
(411 B)
📄
test_read_format_cab_2.cab.uu
(383 B)
📄
test_read_format_cab_3.cab.uu
(445 B)
📄
test_read_format_cab_filename.c
(6.16 KB)
📄
test_read_format_cab_filename_cp932.cab.uu
(255 B)
📄
test_read_format_cpio_afio.c
(4.97 KB)
📄
test_read_format_cpio_bin.c
(3.25 KB)
📄
test_read_format_cpio_bin_Z.c
(2.74 KB)
📄
test_read_format_cpio_bin_be.c
(2.61 KB)
📄
test_read_format_cpio_bin_be.cpio.uu
(276 B)
📄
test_read_format_cpio_bin_bz2.c
(2.6 KB)
📄
test_read_format_cpio_bin_gz.c
(2.69 KB)
📄
test_read_format_cpio_bin_le.c
(2.61 KB)
📄
test_read_format_cpio_bin_le.cpio.uu
(266 B)
📄
test_read_format_cpio_bin_lzip.c
(2.76 KB)
📄
test_read_format_cpio_bin_lzma.c
(2.71 KB)
📄
test_read_format_cpio_bin_xz.c
(3.12 KB)
📄
test_read_format_cpio_filename.c
(28.75 KB)
📄
test_read_format_cpio_filename_cp866.cpio.uu
(757 B)
📄
test_read_format_cpio_filename_eucjp.cpio.uu
(757 B)
📄
test_read_format_cpio_filename_koi8r.cpio.uu
(757 B)
📄
test_read_format_cpio_filename_utf8_jp.cpio.uu
(759 B)
📄
test_read_format_cpio_filename_utf8_ru.cpio.uu
(759 B)
📄
test_read_format_cpio_odc.c
(3.44 KB)
📄
test_read_format_cpio_svr4_bzip2_rpm.c
(4.62 KB)
📄
test_read_format_cpio_svr4_bzip2_rpm.rpm.uu
(2.71 KB)
📄
test_read_format_cpio_svr4_gzip.c
(2.74 KB)
📄
test_read_format_cpio_svr4_gzip_rpm.c
(4.62 KB)
📄
test_read_format_cpio_svr4_gzip_rpm.rpm.uu
(2.63 KB)
📄
test_read_format_cpio_svr4c_Z.c
(2.84 KB)
📄
test_read_format_empty.c
(2.08 KB)
📄
test_read_format_gtar_filename.c
(16.85 KB)
📄
test_read_format_gtar_filename_cp866.tar.Z.uu
(448 B)
📄
test_read_format_gtar_filename_eucjp.tar.Z.uu
(448 B)
📄
test_read_format_gtar_filename_koi8r.tar.Z.uu
(440 B)
📄
test_read_format_gtar_gz.c
(2.75 KB)
📄
test_read_format_gtar_lzma.c
(3.17 KB)
📄
test_read_format_gtar_sparse.c
(8.39 KB)
📄
test_read_format_gtar_sparse_1_13.tar.uu
(82.73 KB)
📄
test_read_format_gtar_sparse_1_17.tar.uu
(82.73 KB)
📄
test_read_format_gtar_sparse_1_17_posix00.tar.uu
(96.52 KB)
📄
test_read_format_gtar_sparse_1_17_posix01.tar.uu
(82.74 KB)
📄
test_read_format_gtar_sparse_1_17_posix10.tar.uu
(82.74 KB)
📄
test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
(82.75 KB)
📄
test_read_format_gtar_sparse_skip_entry.c
(5.13 KB)
📄
test_read_format_gtar_sparse_skip_entry.tar.Z.uu
(750 B)
📄
test_read_format_iso.iso.Z.uu
(1.32 KB)
📄
test_read_format_iso_2.iso.Z.uu
(1.98 KB)
📄
test_read_format_iso_Z.c
(3.85 KB)
📄
test_read_format_iso_joliet.iso.Z.uu
(3.71 KB)
📄
test_read_format_iso_joliet_by_nero.iso.Z.uu
(3.74 KB)
📄
test_read_format_iso_joliet_long.iso.Z.uu
(4.03 KB)
📄
test_read_format_iso_joliet_rockridge.iso.Z.uu
(3.84 KB)
📄
test_read_format_iso_multi_extent.c
(3.85 KB)
📄
test_read_format_iso_multi_extent.iso.Z.uu
(3.78 KB)
📄
test_read_format_iso_rockridge.iso.Z.uu
(12.23 KB)
📄
test_read_format_iso_rockridge_ce.iso.Z.uu
(3.53 KB)
📄
test_read_format_iso_rockridge_new.iso.Z.uu
(12.35 KB)
📄
test_read_format_iso_rockridge_rr_moved.iso.Z.uu
(18.13 KB)
📄
test_read_format_iso_xorriso.c
(8.47 KB)
📄
test_read_format_iso_xorriso.iso.Z.uu
(3.53 KB)
📄
test_read_format_iso_zisofs.iso.Z.uu
(3.56 KB)
📄
test_read_format_isojoliet_bz2.c
(5.82 KB)
📄
test_read_format_isojoliet_long.c
(5.69 KB)
📄
test_read_format_isojoliet_rr.c
(7.16 KB)
📄
test_read_format_isojoliet_versioned.c
(3.66 KB)
📄
test_read_format_isorr_bz2.c
(8.89 KB)
📄
test_read_format_isorr_ce.c
(8.11 KB)
📄
test_read_format_isorr_new_bz2.c
(8.92 KB)
📄
test_read_format_isorr_rr_moved.c
(11.53 KB)
📄
test_read_format_isozisofs_bz2.c
(7.96 KB)
📄
test_read_format_lha.c
(10.27 KB)
📄
test_read_format_lha_bugfix_0.c
(2.99 KB)
📄
test_read_format_lha_bugfix_0.lzh.uu
(998 B)
📄
test_read_format_lha_filename.c
(7.76 KB)
📄
test_read_format_lha_filename_cp932.lzh.uu
(275 B)
📄
test_read_format_lha_filename_utf16.c
(5.55 KB)
📄
test_read_format_lha_filename_utf16.lzh.uu
(1.03 KB)
📄
test_read_format_lha_header0.lzh.uu
(529 B)
📄
test_read_format_lha_header1.lzh.uu
(629 B)
📄
test_read_format_lha_header2.lzh.uu
(629 B)
📄
test_read_format_lha_header3.lzh.uu
(807 B)
📄
test_read_format_lha_lh0.lzh.uu
(645 B)
📄
test_read_format_lha_lh6.lzh.uu
(629 B)
📄
test_read_format_lha_lh7.lzh.uu
(629 B)
📄
test_read_format_lha_withjunk.lzh.uu
(650 B)
📄
test_read_format_mtree.c
(34.82 KB)
📄
test_read_format_mtree.mtree.uu
(2.29 KB)
📄
test_read_format_mtree_crash747.c
(1.95 KB)
📄
test_read_format_mtree_crash747.mtree.bz2.uu
(212 B)
📄
test_read_format_mtree_nomagic.mtree.uu
(505 B)
📄
test_read_format_mtree_nomagic2.mtree.uu
(432 B)
📄
test_read_format_mtree_nomagic3.mtree.uu
(432 B)
📄
test_read_format_mtree_noprint.mtree.uu
(115 B)
📄
test_read_format_pax_bz2.c
(3.19 KB)
📄
test_read_format_rar.c
(156.59 KB)
📄
test_read_format_rar.rar.uu
(482 B)
📄
test_read_format_rar5.c
(44.49 KB)
📄
test_read_format_rar5_arm.rar.uu
(55.32 KB)
📄
test_read_format_rar5_arm_filter_on_window_boundary.rar.uu
(408 B)
📄
test_read_format_rar5_blake2.rar.uu
(935 B)
📄
test_read_format_rar5_block_size_is_too_small.rar.uu
(372 B)
📄
test_read_format_rar5_compressed.rar.uu
(640 B)
📄
test_read_format_rar5_different_solid_window_size.rar.uu
(4.28 KB)
📄
test_read_format_rar5_different_window_size.rar.uu
(40.73 KB)
📄
test_read_format_rar5_different_winsize_on_merge.rar.uu
(822 B)
📄
test_read_format_rar5_distance_overflow.rar.uu
(392 B)
📄
test_read_format_rar5_extra_field_version.rar.uu
(452 B)
📄
test_read_format_rar5_fileattr.rar.uu
(635 B)
📄
test_read_format_rar5_hardlink.rar.uu
(221 B)
📄
test_read_format_rar5_invalid_dict_reference.rar.uu
(417 B)
📄
test_read_format_rar5_leftshift1.rar.uu
(393 B)
📄
test_read_format_rar5_leftshift2.rar.uu
(203 B)
📄
test_read_format_rar5_multiarchive.part01.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part02.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part03.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part04.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part05.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part06.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part07.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part08.rar.uu
(12.44 KB)
📄
test_read_format_rar5_multiarchive_solid.part01.rar.uu
(17.98 KB)
📄
test_read_format_rar5_multiarchive_solid.part02.rar.uu
(17.98 KB)
📄
test_read_format_rar5_multiarchive_solid.part03.rar.uu
(17.98 KB)
📄
test_read_format_rar5_multiarchive_solid.part04.rar.uu
(4.48 KB)
📄
test_read_format_rar5_multiple_files.rar.uu
(2.27 KB)
📄
test_read_format_rar5_multiple_files_solid.rar.uu
(982 B)
📄
test_read_format_rar5_nonempty_dir_stream.rar.uu
(402 B)
📄
test_read_format_rar5_owner.rar.uu
(322 B)
📄
test_read_format_rar5_readtables_overflow.rar.uu
(786 B)
📄
test_read_format_rar5_solid.rar.uu
(1.46 KB)
📄
test_read_format_rar5_stored.rar.uu
(186 B)
📄
test_read_format_rar5_stored_manyfiles.rar.uu
(3.54 KB)
📄
test_read_format_rar5_symlink.rar.uu
(316 B)
📄
test_read_format_rar5_truncated_huff.rar.uu
(281 B)
📄
test_read_format_rar5_win32.rar.uu
(4.04 KB)
📄
test_read_format_rar_binary_data.rar.uu
(1.42 MB)
📄
test_read_format_rar_compress_best.rar.uu
(16.41 KB)
📄
test_read_format_rar_compress_normal.rar.uu
(19.69 KB)
📄
test_read_format_rar_encryption_data.c
(3.46 KB)
📄
test_read_format_rar_encryption_data.rar.uu
(315 B)
📄
test_read_format_rar_encryption_header.c
(3.06 KB)
📄
test_read_format_rar_encryption_header.rar.uu
(365 B)
📄
test_read_format_rar_encryption_partially.c
(3.53 KB)
📄
test_read_format_rar_encryption_partially.rar.uu
(302 B)
📄
test_read_format_rar_invalid1.c
(2.03 KB)
📄
test_read_format_rar_invalid1.rar.uu
(138 B)
📄
test_read_format_rar_multi_lzss_blocks.rar.uu
(26.71 KB)
📄
test_read_format_rar_multivolume.part0001.rar.uu
(80.75 KB)
📄
test_read_format_rar_multivolume.part0002.rar.uu
(80.75 KB)
📄
test_read_format_rar_multivolume.part0003.rar.uu
(80.75 KB)
📄
test_read_format_rar_multivolume.part0004.rar.uu
(12.4 KB)
📄
test_read_format_rar_noeof.rar.uu
(142 B)
📄
test_read_format_rar_ppmd_lzss_conversion.rar.uu
(237.77 KB)
📄
test_read_format_rar_ppmd_use_after_free.rar.uu
(479 B)
📄
test_read_format_rar_ppmd_use_after_free2.rar.uu
(460 B)
📄
test_read_format_rar_sfx.exe.uu
(133.92 KB)
📄
test_read_format_rar_subblock.rar.uu
(250 B)
📄
test_read_format_rar_unicode.rar.uu
(967 B)
📄
test_read_format_rar_windows.rar.uu
(1.12 KB)
📄
test_read_format_raw.bufr.uu
(5.56 KB)
📄
test_read_format_raw.c
(6.44 KB)
📄
test_read_format_raw.data.Z.uu
(68 B)
📄
test_read_format_raw.data.gz.uu
(107 B)
📄
test_read_format_raw.data.uu
(62 B)
📄
test_read_format_tar.c
(24.86 KB)
📄
test_read_format_tar_concatenated.c
(3.46 KB)
📄
test_read_format_tar_concatenated.tar.uu
(4.19 KB)
📄
test_read_format_tar_empty_filename.c
(2.81 KB)
📄
test_read_format_tar_empty_filename.tar.uu
(2.12 KB)
📄
test_read_format_tar_empty_pax.c
(2.61 KB)
📄
test_read_format_tar_empty_pax.tar.Z.uu
(467 B)
📄
test_read_format_tar_empty_with_gnulabel.c
(2.26 KB)
📄
test_read_format_tar_empty_with_gnulabel.tar.uu
(13.84 KB)
📄
test_read_format_tar_filename.c
(14.37 KB)
📄
test_read_format_tar_filename_koi8r.tar.Z.uu
(692 B)
📄
test_read_format_tbz.c
(2.69 KB)
📄
test_read_format_tgz.c
(2.72 KB)
📄
test_read_format_tlz.c
(2.82 KB)
📄
test_read_format_txz.c
(3.01 KB)
📄
test_read_format_tz.c
(2.84 KB)
📄
test_read_format_ustar_filename.c
(19.57 KB)
📄
test_read_format_ustar_filename_cp866.tar.Z.uu
(370 B)
📄
test_read_format_ustar_filename_eucjp.tar.Z.uu
(376 B)
📄
test_read_format_ustar_filename_koi8r.tar.Z.uu
(362 B)
📄
test_read_format_warc.c
(3.64 KB)
📄
test_read_format_warc.warc.uu
(1.24 KB)
📄
test_read_format_xar.c
(44.73 KB)
📄
test_read_format_zip.c
(36.61 KB)
📄
test_read_format_zip.zip.uu
(647 B)
📄
test_read_format_zip_7075_utf8_paths.c
(3.75 KB)
📄
test_read_format_zip_7075_utf8_paths.zip.uu
(1.08 KB)
📄
test_read_format_zip_7z_lzma.zip.uu
(2.55 KB)
📄
test_read_format_zip_bz2_hang.zip.uu
(138 B)
📄
test_read_format_zip_bzip2.zipx.uu
(1003 B)
📄
test_read_format_zip_bzip2_multi.zipx.uu
(5.68 KB)
📄
test_read_format_zip_comment_stored.c
(2.93 KB)
📄
test_read_format_zip_comment_stored_1.zip.uu
(560 B)
📄
test_read_format_zip_comment_stored_2.zip.uu
(33.02 KB)
📄
test_read_format_zip_encryption_data.c
(3.48 KB)
📄
test_read_format_zip_encryption_data.zip.uu
(1.39 KB)
📄
test_read_format_zip_encryption_header.c
(3.06 KB)
📄
test_read_format_zip_encryption_header.zip.uu
(1.81 KB)
📄
test_read_format_zip_encryption_partially.c
(3.53 KB)
📄
test_read_format_zip_encryption_partially.zip.uu
(964 B)
📄
test_read_format_zip_extra_padding.c
(3.74 KB)
📄
test_read_format_zip_extra_padding.zip.uu
(271 B)
📄
test_read_format_zip_filename.c
(42.68 KB)
📄
test_read_format_zip_filename_cp866.zip.uu
(481 B)
📄
test_read_format_zip_filename_cp932.zip.uu
(391 B)
📄
test_read_format_zip_filename_koi8r.zip.uu
(481 B)
📄
test_read_format_zip_filename_utf8_jp.zip.uu
(766 B)
📄
test_read_format_zip_filename_utf8_ru.zip.uu
(517 B)
📄
test_read_format_zip_filename_utf8_ru2.zip.uu
(502 B)
📄
test_read_format_zip_high_compression.c
(4.93 KB)
📄
test_read_format_zip_high_compression.zip.uu
(932 B)
📄
test_read_format_zip_jar.c
(2.36 KB)
📄
test_read_format_zip_jar.jar.uu
(215 B)
📄
test_read_format_zip_length_at_end.zip.uu
(321 B)
📄
test_read_format_zip_lzma.zipx.uu
(1010 B)
📄
test_read_format_zip_lzma_alone_leak.zipx.uu
(178 B)
📄
test_read_format_zip_lzma_multi.zipx.uu
(5.58 KB)
📄
test_read_format_zip_lzma_stream_end.zipx.uu
(1002 B)
📄
test_read_format_zip_mac_metadata.c
(4.85 KB)
📄
test_read_format_zip_mac_metadata.zip.uu
(902 B)
📄
test_read_format_zip_malformed.c
(2.49 KB)
📄
test_read_format_zip_malformed1.zip.uu
(140 B)
📄
test_read_format_zip_msdos.c
(4.87 KB)
📄
test_read_format_zip_msdos.zip.uu
(1.2 KB)
📄
test_read_format_zip_nested.c
(3.61 KB)
📄
test_read_format_zip_nested.zip.uu
(842 B)
📄
test_read_format_zip_nofiletype.c
(2.68 KB)
📄
test_read_format_zip_nofiletype.zip.uu
(330 B)
📄
test_read_format_zip_padded.c
(3.22 KB)
📄
test_read_format_zip_padded1.zip.uu
(599 B)
📄
test_read_format_zip_padded2.zip.uu
(741 B)
📄
test_read_format_zip_padded3.zip.uu
(861 B)
📄
test_read_format_zip_ppmd8.zipx.uu
(879 B)
📄
test_read_format_zip_ppmd8_crash_1.zipx.uu
(118 B)
📄
test_read_format_zip_ppmd8_crash_2.zipx.uu
(118 B)
📄
test_read_format_zip_ppmd8_multi.zipx.uu
(4.9 KB)
📄
test_read_format_zip_sfx.c
(2.66 KB)
📄
test_read_format_zip_sfx.uu
(1.91 KB)
📄
test_read_format_zip_symlink.zip.uu
(475 B)
📄
test_read_format_zip_traditional_encryption_data.c
(6.72 KB)
📄
test_read_format_zip_traditional_encryption_data.zip.uu
(615 B)
📄
test_read_format_zip_ux.zip.uu
(280 B)
📄
test_read_format_zip_winzip_aes.c
(5.69 KB)
📄
test_read_format_zip_winzip_aes128.zip.uu
(3.87 KB)
📄
test_read_format_zip_winzip_aes256.zip.uu
(3.88 KB)
📄
test_read_format_zip_winzip_aes256_large.zip.uu
(132.06 KB)
📄
test_read_format_zip_winzip_aes256_stored.zip.uu
(9.47 KB)
📄
test_read_format_zip_winzip_aes_large.c
(8.91 KB)
📄
test_read_format_zip_with_invalid_traditional_eocd.c
(2.45 KB)
📄
test_read_format_zip_with_invalid_traditional_eocd.zip.uu
(684 B)
📄
test_read_format_zip_xz_multi.zipx.uu
(7.42 KB)
📄
test_read_format_zip_zip64.c
(4.37 KB)
📄
test_read_format_zip_zip64a.zip.uu
(260 B)
📄
test_read_format_zip_zip64b.zip.uu
(248 B)
📄
test_read_large.c
(3.67 KB)
📄
test_read_large_splitted_rar_aa.uu
(53.84 KB)
📄
test_read_large_splitted_rar_ab.uu
(53.84 KB)
📄
test_read_large_splitted_rar_ac.uu
(53.84 KB)
📄
test_read_large_splitted_rar_ad.uu
(53.84 KB)
📄
test_read_large_splitted_rar_ae.uu
(22.49 KB)
📄
test_read_pax_truncated.c
(10.35 KB)
📄
test_read_pax_xattr_rht_security_selinux.c
(2.56 KB)
📄
test_read_pax_xattr_rht_security_selinux.tar.uu
(13.84 KB)
📄
test_read_pax_xattr_schily.c
(2.88 KB)
📄
test_read_pax_xattr_schily.tar.uu
(13.83 KB)
📄
test_read_position.c
(4.14 KB)
📄
test_read_set_format.c
(8.39 KB)
📄
test_read_splitted_rar_aa.uu
(160 B)
📄
test_read_splitted_rar_ab.uu
(160 B)
📄
test_read_splitted_rar_ac.uu
(160 B)
📄
test_read_splitted_rar_ad.uu
(68 B)
📄
test_read_too_many_filters.c
(2.08 KB)
📄
test_read_too_many_filters.gz.uu
(573 B)
📄
test_read_truncated.c
(5.13 KB)
📄
test_read_truncated_filter.c
(5.18 KB)
📄
test_sparse_basic.c
(17.67 KB)
📄
test_splitted_rar_seek_support_aa.uu
(9.44 KB)
📄
test_splitted_rar_seek_support_ab.uu
(9.44 KB)
📄
test_splitted_rar_seek_support_ac.uu
(8.37 KB)
📄
test_tar_filenames.c
(5.05 KB)
📄
test_tar_large.c
(8.08 KB)
📄
test_ustar_filename_encoding.c
(12.12 KB)
📄
test_ustar_filenames.c
(5.71 KB)
📄
test_warn_missing_hardlink_target.c
(1.85 KB)
📄
test_write_disk.c
(12.62 KB)
📄
test_write_disk_appledouble.c
(7.95 KB)
📄
test_write_disk_appledouble.cpio.gz.uu
(558 B)
📄
test_write_disk_failures.c
(2.48 KB)
📄
test_write_disk_hardlink.c
(7.45 KB)
📄
test_write_disk_hfs_compression.c
(9.93 KB)
📄
test_write_disk_hfs_compression.tgz.uu
(108.83 KB)
📄
test_write_disk_lookup.c
(4.94 KB)
📄
test_write_disk_mac_metadata.c
(7.03 KB)
📄
test_write_disk_mac_metadata.tar.gz.uu
(678 B)
📄
test_write_disk_no_hfs_compression.c
(8.01 KB)
📄
test_write_disk_no_hfs_compression.tgz.uu
(106.69 KB)
📄
test_write_disk_perms.c
(17.58 KB)
📄
test_write_disk_secure.c
(11.75 KB)
📄
test_write_disk_secure744.c
(3.09 KB)
📄
test_write_disk_secure745.c
(2.9 KB)
📄
test_write_disk_secure746.c
(4.61 KB)
📄
test_write_disk_sparse.c
(8.72 KB)
📄
test_write_disk_symlink.c
(9.42 KB)
📄
test_write_disk_times.c
(5.86 KB)
📄
test_write_filter_b64encode.c
(6.75 KB)
📄
test_write_filter_bzip2.c
(9.76 KB)
📄
test_write_filter_compress.c
(3.36 KB)
📄
test_write_filter_gzip.c
(10.73 KB)
📄
test_write_filter_gzip_timestamp.c
(4.34 KB)
📄
test_write_filter_lrzip.c
(4.75 KB)
📄
test_write_filter_lz4.c
(13.55 KB)
📄
test_write_filter_lzip.c
(9.29 KB)
📄
test_write_filter_lzma.c
(9.52 KB)
📄
test_write_filter_lzop.c
(9.75 KB)
📄
test_write_filter_program.c
(4.72 KB)
📄
test_write_filter_uuencode.c
(6.74 KB)
📄
test_write_filter_xz.c
(9.72 KB)
📄
test_write_filter_zstd.c
(9.67 KB)
📄
test_write_format_7zip.c
(19.63 KB)
📄
test_write_format_7zip_empty.c
(9.93 KB)
📄
test_write_format_7zip_large.c
(5.74 KB)
📄
test_write_format_ar.c
(7.65 KB)
📄
test_write_format_cpio.c
(8.99 KB)
📄
test_write_format_cpio_empty.c
(2.68 KB)
📄
test_write_format_cpio_newc.c
(7.94 KB)
📄
test_write_format_cpio_odc.c
(9.1 KB)
📄
test_write_format_gnutar.c
(10.03 KB)
📄
test_write_format_gnutar_filenames.c
(5.32 KB)
📄
test_write_format_iso9660.c
(40.42 KB)
📄
test_write_format_iso9660_boot.c
(9.73 KB)
📄
test_write_format_iso9660_empty.c
(7.22 KB)
📄
test_write_format_iso9660_filename.c
(12.4 KB)
📄
test_write_format_iso9660_zisofs.c
(28.81 KB)
📄
test_write_format_mtree.c
(9.68 KB)
📄
test_write_format_mtree_absolute_path.c
(3.81 KB)
📄
test_write_format_mtree_classic.c
(6.5 KB)
📄
test_write_format_mtree_classic_indent.c
(6.71 KB)
📄
test_write_format_mtree_fflags.c
(4.13 KB)
📄
test_write_format_mtree_no_separator.c
(3.95 KB)
📄
test_write_format_mtree_quoted_filename.c
(3.3 KB)
📄
test_write_format_pax.c
(9.52 KB)
📄
test_write_format_raw.c
(4.7 KB)
📄
test_write_format_raw_b64.c
(2.9 KB)
📄
test_write_format_shar_empty.c
(2.21 KB)
📄
test_write_format_tar.c
(4.44 KB)
📄
test_write_format_tar_empty.c
(2.82 KB)
📄
test_write_format_tar_sparse.c
(10.68 KB)
📄
test_write_format_tar_ustar.c
(13.19 KB)
📄
test_write_format_tar_v7tar.c
(9.15 KB)
📄
test_write_format_warc.c
(5.56 KB)
📄
test_write_format_warc_empty.c
(4.64 KB)
📄
test_write_format_xar.c
(10.92 KB)
📄
test_write_format_xar_empty.c
(4.58 KB)
📄
test_write_format_zip.c
(32.25 KB)
📄
test_write_format_zip_compression_store.c
(16.05 KB)
📄
test_write_format_zip_empty.c
(3.37 KB)
📄
test_write_format_zip_empty_zip64.c
(4.62 KB)
📄
test_write_format_zip_file.c
(9.87 KB)
📄
test_write_format_zip_file_zip64.c
(11.52 KB)
📄
test_write_format_zip_large.c
(13.63 KB)
📄
test_write_format_zip_zip64.c
(2.62 KB)
📄
test_write_open_memory.c
(3.21 KB)
📄
test_write_read_format_zip.c
(26.34 KB)
📄
test_xattr_platform.c
(3.57 KB)
📄
test_zip_filename_encoding.c
(17.47 KB)
Editing: test_entry.c
/*- * Copyright (c) 2003-2007 Tim Kientzle * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" __FBSDID("$FreeBSD$"); #include <locale.h> #ifdef HAVE_LINUX_FS_H #include <linux/fs.h> /* for Linux file flags */ #endif #ifndef HAVE_WCSCPY static wchar_t * wcscpy(wchar_t *s1, const wchar_t *s2) { wchar_t *dest = s1; while ((*s1 = *s2) != L'\0') ++s1, ++s2; return dest; } #endif /* * Most of these tests are system-independent, though a few depend on * features of the local system. Such tests are conditionalized on * the platform name. On unsupported platforms, only the * system-independent features will be tested. * * No, I don't want to use config.h in the test files because I want * the tests to also serve as a check on the correctness of config.h. * A mis-configured library build should cause tests to fail. */ DEFINE_TEST(test_entry) { char buff[128]; wchar_t wbuff[128]; struct stat st; struct archive_entry *e, *e2; const struct stat *pst; unsigned long set, clear; /* For fflag testing. */ int type, permset, tag, qual; /* For ACL testing. */ const char *name; /* For ACL testing. */ const char *xname; /* For xattr tests. */ const void *xval; /* For xattr tests. */ size_t xsize; /* For xattr tests. */ wchar_t wc; long l; int i; assert((e = archive_entry_new()) != NULL); /* * Verify that the AE_IF* defines match S_IF* defines * on this platform. See comments in archive_entry.h. */ #ifdef S_IFREG assertEqualInt(S_IFREG, AE_IFREG); #endif #ifdef S_IFLNK assertEqualInt(S_IFLNK, AE_IFLNK); #endif #ifdef S_IFSOCK assertEqualInt(S_IFSOCK, AE_IFSOCK); #endif #ifdef S_IFCHR assertEqualInt(S_IFCHR, AE_IFCHR); #endif /* Work around MinGW, which defines S_IFBLK wrong. */ /* sourceforge.net/tracker/?func=detail&atid=102435&aid=1942809&group_id=2435 */ #if defined(S_IFBLK) && !defined(_WIN32) assertEqualInt(S_IFBLK, AE_IFBLK); #endif #ifdef S_IFDIR assertEqualInt(S_IFDIR, AE_IFDIR); #endif #ifdef S_IFIFO assertEqualInt(S_IFIFO, AE_IFIFO); #endif /* * Basic set/read tests for all fields. * We should be able to set any field and read * back the same value. * * For methods that "copy" a string, we should be able * to overwrite the original passed-in string without * changing the value in the entry. * * The following tests are ordered alphabetically by the * name of the field. */ /* atime */ archive_entry_set_atime(e, 13579, 24680); assertEqualInt(archive_entry_atime(e), 13579); assertEqualInt(archive_entry_atime_nsec(e), 24680); archive_entry_set_atime(e, 13580, 1000000001L); assertEqualInt(archive_entry_atime(e), 13581); assertEqualInt(archive_entry_atime_nsec(e), 1); archive_entry_set_atime(e, 13580, -7); assertEqualInt(archive_entry_atime(e), 13579); assertEqualInt(archive_entry_atime_nsec(e), 999999993); archive_entry_unset_atime(e); assertEqualInt(archive_entry_atime(e), 0); assertEqualInt(archive_entry_atime_nsec(e), 0); assert(!archive_entry_atime_is_set(e)); /* birthtime */ archive_entry_set_birthtime(e, 17579, 24990); assertEqualInt(archive_entry_birthtime(e), 17579); assertEqualInt(archive_entry_birthtime_nsec(e), 24990); archive_entry_set_birthtime(e, 17580, 1234567890L); assertEqualInt(archive_entry_birthtime(e), 17581); assertEqualInt(archive_entry_birthtime_nsec(e), 234567890); archive_entry_set_birthtime(e, 17581, -24990); assertEqualInt(archive_entry_birthtime(e), 17580); assertEqualInt(archive_entry_birthtime_nsec(e), 999975010); archive_entry_unset_birthtime(e); assertEqualInt(archive_entry_birthtime(e), 0); assertEqualInt(archive_entry_birthtime_nsec(e), 0); assert(!archive_entry_birthtime_is_set(e)); /* ctime */ archive_entry_set_ctime(e, 13580, 24681); assertEqualInt(archive_entry_ctime(e), 13580); assertEqualInt(archive_entry_ctime_nsec(e), 24681); archive_entry_set_ctime(e, 13581, 2008182348L); assertEqualInt(archive_entry_ctime(e), 13583); assertEqualInt(archive_entry_ctime_nsec(e), 8182348); archive_entry_set_ctime(e, 13582, -24681); assertEqualInt(archive_entry_ctime(e), 13581); assertEqualInt(archive_entry_ctime_nsec(e), 999975319); archive_entry_unset_ctime(e); assertEqualInt(archive_entry_ctime(e), 0); assertEqualInt(archive_entry_ctime_nsec(e), 0); assert(!archive_entry_ctime_is_set(e)); /* dev */ assert(!archive_entry_dev_is_set(e)); archive_entry_set_dev(e, 235); assert(archive_entry_dev_is_set(e)); assertEqualInt(archive_entry_dev(e), 235); /* devmajor/devminor are tested specially below. */ /* filetype */ archive_entry_set_filetype(e, AE_IFREG); assertEqualInt(archive_entry_filetype(e), AE_IFREG); /* fflags are tested specially below */ /* gid */ archive_entry_set_gid(e, 204); assertEqualInt(archive_entry_gid(e), 204); /* gname */ archive_entry_set_gname(e, "group"); assertEqualString(archive_entry_gname(e), "group"); assertEqualString(archive_entry_gname_utf8(e), "group"); assertEqualWString(archive_entry_gname_w(e), L"group"); wcscpy(wbuff, L"wgroup"); archive_entry_copy_gname_w(e, wbuff); assertEqualWString(archive_entry_gname_w(e), L"wgroup"); memset(wbuff, 0, sizeof(wbuff)); assertEqualWString(archive_entry_gname_w(e), L"wgroup"); assertEqualString(archive_entry_gname_utf8(e), "wgroup"); assertEqualString(archive_entry_gname(e), "wgroup"); archive_entry_set_gname_utf8(e, "group"); assertEqualString(archive_entry_gname_utf8(e), "group"); assertEqualWString(archive_entry_gname_w(e), L"group"); assertEqualString(archive_entry_gname(e), "group"); archive_entry_update_gname_utf8(e, "group2"); assertEqualString(archive_entry_gname_utf8(e), "group2"); assertEqualWString(archive_entry_gname_w(e), L"group2"); assertEqualString(archive_entry_gname(e), "group2"); /* hardlink */ archive_entry_set_hardlink(e, "hardlinkname"); assertEqualString(archive_entry_hardlink(e), "hardlinkname"); assertEqualString(archive_entry_hardlink_utf8(e), "hardlinkname"); assertEqualWString(archive_entry_hardlink_w(e), L"hardlinkname"); strcpy(buff, "hardlinkname2"); archive_entry_copy_hardlink(e, buff); assertEqualString(archive_entry_hardlink(e), "hardlinkname2"); assertEqualWString(archive_entry_hardlink_w(e), L"hardlinkname2"); assertEqualString(archive_entry_hardlink_utf8(e), "hardlinkname2"); memset(buff, 0, sizeof(buff)); assertEqualString(archive_entry_hardlink(e), "hardlinkname2"); assertEqualString(archive_entry_hardlink_utf8(e), "hardlinkname2"); assertEqualWString(archive_entry_hardlink_w(e), L"hardlinkname2"); archive_entry_copy_hardlink(e, NULL); assertEqualString(archive_entry_hardlink(e), NULL); assertEqualWString(archive_entry_hardlink_w(e), NULL); assertEqualString(archive_entry_hardlink_utf8(e), NULL); wcscpy(wbuff, L"whardlink"); archive_entry_copy_hardlink_w(e, wbuff); assertEqualWString(archive_entry_hardlink_w(e), L"whardlink"); assertEqualString(archive_entry_hardlink_utf8(e), "whardlink"); assertEqualString(archive_entry_hardlink(e), "whardlink"); memset(wbuff, 0, sizeof(wbuff)); assertEqualWString(archive_entry_hardlink_w(e), L"whardlink"); archive_entry_copy_hardlink_w(e, NULL); assertEqualString(archive_entry_hardlink(e), NULL); assertEqualWString(archive_entry_hardlink_w(e), NULL); archive_entry_set_hardlink_utf8(e, "hardlinkname"); assertEqualString(archive_entry_hardlink_utf8(e), "hardlinkname"); assertEqualWString(archive_entry_hardlink_w(e), L"hardlinkname"); assertEqualString(archive_entry_hardlink(e), "hardlinkname"); archive_entry_update_hardlink_utf8(e, "hardlinkname2"); assertEqualString(archive_entry_hardlink_utf8(e), "hardlinkname2"); assertEqualWString(archive_entry_hardlink_w(e), L"hardlinkname2"); assertEqualString(archive_entry_hardlink(e), "hardlinkname2"); /* ino */ assert(!archive_entry_ino_is_set(e)); archive_entry_set_ino(e, 8593); assert(archive_entry_ino_is_set(e)); assertEqualInt(archive_entry_ino(e), 8593); assertEqualInt(archive_entry_ino64(e), 8593); archive_entry_set_ino64(e, 8594); assert(archive_entry_ino_is_set(e)); assertEqualInt(archive_entry_ino(e), 8594); assertEqualInt(archive_entry_ino64(e), 8594); /* link */ archive_entry_set_hardlink(e, "hardlinkname"); archive_entry_set_symlink(e, NULL); archive_entry_set_link(e, "link"); assertEqualString(archive_entry_hardlink(e), "link"); assertEqualString(archive_entry_symlink(e), NULL); archive_entry_copy_link(e, "link2"); assertEqualString(archive_entry_hardlink(e), "link2"); assertEqualString(archive_entry_symlink(e), NULL); archive_entry_copy_link_w(e, L"link3"); assertEqualString(archive_entry_hardlink(e), "link3"); assertEqualString(archive_entry_symlink(e), NULL); archive_entry_set_hardlink(e, NULL); archive_entry_set_symlink(e, "symlink"); archive_entry_set_link(e, "link"); assertEqualString(archive_entry_hardlink(e), NULL); assertEqualString(archive_entry_symlink(e), "link"); archive_entry_copy_link(e, "link2"); assertEqualString(archive_entry_hardlink(e), NULL); assertEqualString(archive_entry_symlink(e), "link2"); archive_entry_copy_link_w(e, L"link3"); assertEqualString(archive_entry_hardlink(e), NULL); assertEqualString(archive_entry_symlink(e), "link3"); /* Arbitrarily override symlink if both hardlink and symlink set. */ archive_entry_set_hardlink(e, "hardlink"); archive_entry_set_symlink(e, "symlink"); archive_entry_set_link(e, "link"); assertEqualString(archive_entry_hardlink(e), "hardlink"); assertEqualString(archive_entry_symlink(e), "link"); /* mode */ archive_entry_set_mode(e, 0123456); assertEqualInt(archive_entry_mode(e), 0123456); /* mtime */ archive_entry_set_mtime(e, 13581, 24682); assertEqualInt(archive_entry_mtime(e), 13581); assertEqualInt(archive_entry_mtime_nsec(e), 24682); archive_entry_set_mtime(e, 13582, 1358297468); assertEqualInt(archive_entry_mtime(e), 13583); assertEqualInt(archive_entry_mtime_nsec(e), 358297468); archive_entry_set_mtime(e, 13583, -24682); assertEqualInt(archive_entry_mtime(e), 13582); assertEqualInt(archive_entry_mtime_nsec(e), 999975318); archive_entry_unset_mtime(e); assertEqualInt(archive_entry_mtime(e), 0); assertEqualInt(archive_entry_mtime_nsec(e), 0); assert(!archive_entry_mtime_is_set(e)); /* nlink */ archive_entry_set_nlink(e, 736); assertEqualInt(archive_entry_nlink(e), 736); /* pathname */ archive_entry_set_pathname(e, "path"); assertEqualString(archive_entry_pathname(e), "path"); assertEqualString(archive_entry_pathname_utf8(e), "path"); assertEqualWString(archive_entry_pathname_w(e), L"path"); archive_entry_set_pathname(e, "path"); assertEqualString(archive_entry_pathname(e), "path"); assertEqualWString(archive_entry_pathname_w(e), L"path"); assertEqualString(archive_entry_pathname_utf8(e), "path"); strcpy(buff, "path2"); archive_entry_copy_pathname(e, buff); assertEqualString(archive_entry_pathname(e), "path2"); assertEqualWString(archive_entry_pathname_w(e), L"path2"); assertEqualString(archive_entry_pathname_utf8(e), "path2"); memset(buff, 0, sizeof(buff)); assertEqualString(archive_entry_pathname(e), "path2"); assertEqualString(archive_entry_pathname_utf8(e), "path2"); assertEqualWString(archive_entry_pathname_w(e), L"path2"); wcscpy(wbuff, L"wpath"); archive_entry_copy_pathname_w(e, wbuff); assertEqualWString(archive_entry_pathname_w(e), L"wpath"); assertEqualString(archive_entry_pathname_utf8(e), "wpath"); assertEqualString(archive_entry_pathname(e), "wpath"); memset(wbuff, 0, sizeof(wbuff)); assertEqualWString(archive_entry_pathname_w(e), L"wpath"); assertEqualString(archive_entry_pathname(e), "wpath"); assertEqualString(archive_entry_pathname_utf8(e), "wpath"); archive_entry_set_pathname_utf8(e, "path"); assertEqualWString(archive_entry_pathname_w(e), L"path"); assertEqualString(archive_entry_pathname(e), "path"); assertEqualString(archive_entry_pathname_utf8(e), "path"); archive_entry_update_pathname_utf8(e, "path2"); assertEqualWString(archive_entry_pathname_w(e), L"path2"); assertEqualString(archive_entry_pathname(e), "path2"); assertEqualString(archive_entry_pathname_utf8(e), "path2"); /* rdev */ archive_entry_set_rdev(e, 532); assertEqualInt(archive_entry_rdev(e), 532); /* rdevmajor/rdevminor are tested specially below. */ /* size */ archive_entry_set_size(e, 987654321); assertEqualInt(archive_entry_size(e), 987654321); archive_entry_unset_size(e); assertEqualInt(archive_entry_size(e), 0); assert(!archive_entry_size_is_set(e)); /* sourcepath */ archive_entry_copy_sourcepath(e, "path1"); assertEqualString(archive_entry_sourcepath(e), "path1"); /* symlink */ archive_entry_set_symlink(e, "symlinkname"); assertEqualString(archive_entry_symlink(e), "symlinkname"); assertEqualString(archive_entry_symlink_utf8(e), "symlinkname"); assertEqualWString(archive_entry_symlink_w(e), L"symlinkname"); strcpy(buff, "symlinkname2"); archive_entry_copy_symlink(e, buff); assertEqualString(archive_entry_symlink(e), "symlinkname2"); assertEqualWString(archive_entry_symlink_w(e), L"symlinkname2"); assertEqualString(archive_entry_symlink_utf8(e), "symlinkname2"); memset(buff, 0, sizeof(buff)); assertEqualString(archive_entry_symlink(e), "symlinkname2"); assertEqualString(archive_entry_symlink_utf8(e), "symlinkname2"); assertEqualWString(archive_entry_symlink_w(e), L"symlinkname2"); archive_entry_copy_symlink_w(e, NULL); assertEqualWString(archive_entry_symlink_w(e), NULL); assertEqualString(archive_entry_symlink(e), NULL); assertEqualString(archive_entry_symlink_utf8(e), NULL); archive_entry_copy_symlink_w(e, L"wsymlink"); assertEqualWString(archive_entry_symlink_w(e), L"wsymlink"); assertEqualString(archive_entry_symlink_utf8(e), "wsymlink"); assertEqualString(archive_entry_symlink(e), "wsymlink"); archive_entry_copy_symlink(e, NULL); assertEqualWString(archive_entry_symlink_w(e), NULL); assertEqualString(archive_entry_symlink(e), NULL); assertEqualString(archive_entry_symlink_utf8(e), NULL); archive_entry_set_symlink_utf8(e, "symlinkname"); assertEqualWString(archive_entry_symlink_w(e), L"symlinkname"); assertEqualString(archive_entry_symlink(e), "symlinkname"); assertEqualString(archive_entry_symlink_utf8(e), "symlinkname"); archive_entry_update_symlink_utf8(e, "symlinkname2"); assertEqualWString(archive_entry_symlink_w(e), L"symlinkname2"); assertEqualString(archive_entry_symlink(e), "symlinkname2"); assertEqualString(archive_entry_symlink_utf8(e), "symlinkname2"); /* uid */ archive_entry_set_uid(e, 83); assertEqualInt(archive_entry_uid(e), 83); /* uname */ archive_entry_set_uname(e, "user"); assertEqualString(archive_entry_uname(e), "user"); assertEqualString(archive_entry_uname_utf8(e), "user"); assertEqualWString(archive_entry_uname_w(e), L"user"); wcscpy(wbuff, L"wuser"); archive_entry_copy_uname_w(e, wbuff); assertEqualWString(archive_entry_uname_w(e), L"wuser"); memset(wbuff, 0, sizeof(wbuff)); assertEqualWString(archive_entry_uname_w(e), L"wuser"); assertEqualString(archive_entry_uname_utf8(e), "wuser"); assertEqualString(archive_entry_uname(e), "wuser"); archive_entry_set_uname_utf8(e, "user"); assertEqualString(archive_entry_uname_utf8(e), "user"); assertEqualWString(archive_entry_uname_w(e), L"user"); assertEqualString(archive_entry_uname(e), "user"); archive_entry_set_uname_utf8(e, "user"); assertEqualWString(archive_entry_uname_w(e), L"user"); assertEqualString(archive_entry_uname(e), "user"); assertEqualString(archive_entry_uname_utf8(e), "user"); archive_entry_update_uname_utf8(e, "user2"); assertEqualWString(archive_entry_uname_w(e), L"user2"); assertEqualString(archive_entry_uname(e), "user2"); assertEqualString(archive_entry_uname_utf8(e), "user2"); /* Test fflags interface. */ archive_entry_set_fflags(e, 0x55, 0xAA); archive_entry_fflags(e, &set, &clear); failure("Testing set/get of fflags data."); assertEqualInt(set, 0x55); failure("Testing set/get of fflags data."); assertEqualInt(clear, 0xAA); #ifdef __FreeBSD__ /* Converting fflags bitmap to string is currently system-dependent. */ /* TODO: Make this system-independent. */ assertEqualString(archive_entry_fflags_text(e), "uappnd,nouchg,nodump,noopaque,uunlnk,nosystem"); #endif #if defined(__FreeBSD__) || defined(__APPLE__) /* Test archive_entry_copy_fflags_text_w() */ archive_entry_copy_fflags_text_w(e, L" ,nouappnd, nouchg, dump,hidden"); archive_entry_fflags(e, &set, &clear); assertEqualInt(UF_HIDDEN, set); assertEqualInt(UF_NODUMP | UF_IMMUTABLE | UF_APPEND, clear); /* Test archive_entry_copy_fflags_text() */ archive_entry_copy_fflags_text(e, " ,nouappnd, nouchg, dump,hidden"); archive_entry_fflags(e, &set, &clear); assertEqualInt(UF_HIDDEN, set); assertEqualInt(UF_NODUMP | UF_IMMUTABLE | UF_APPEND, clear); #elif defined(_WIN32) && !defined(CYGWIN) archive_entry_copy_fflags_text_w(e, L"rdonly,hidden,nosystem"); archive_entry_fflags(e, &set, &clear); assertEqualInt(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN, set); assertEqualInt(FILE_ATTRIBUTE_SYSTEM, clear); archive_entry_copy_fflags_text(e, "rdonly,hidden,nosystem"); archive_entry_fflags(e, &set, &clear); assertEqualInt(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN, set); assertEqualInt(FILE_ATTRIBUTE_SYSTEM, clear); #elif defined FS_IOC_GETFLAGS /* Linux */ archive_entry_copy_fflags_text_w(e, L"sappnd,schg,dump,noundel"); archive_entry_fflags(e, &set, &clear); assertEqualInt(FS_APPEND_FL | FS_IMMUTABLE_FL, set); assertEqualInt(FS_NODUMP_FL | FS_UNRM_FL, clear); archive_entry_copy_fflags_text(e, "sappnd,schg,dump,noundel"); archive_entry_fflags(e, &set, &clear); assertEqualInt(FS_APPEND_FL | FS_IMMUTABLE_FL, set); assertEqualInt(FS_NODUMP_FL | FS_UNRM_FL, clear); #endif /* See test_acl_basic.c for tests of ACL set/get consistency. */ /* Test xattrs set/get consistency. */ archive_entry_xattr_add_entry(e, "xattr1", "xattrvalue1", 12); assertEqualInt(1, archive_entry_xattr_reset(e)); assertEqualInt(0, archive_entry_xattr_next(e, &xname, &xval, &xsize)); assertEqualString(xname, "xattr1"); assertEqualString(xval, "xattrvalue1"); assertEqualInt((int)xsize, 12); assertEqualInt(1, archive_entry_xattr_count(e)); assertEqualInt(ARCHIVE_WARN, archive_entry_xattr_next(e, &xname, &xval, &xsize)); assertEqualString(xname, NULL); assertEqualString(xval, NULL); assertEqualInt((int)xsize, 0); archive_entry_xattr_clear(e); assertEqualInt(0, archive_entry_xattr_reset(e)); assertEqualInt(ARCHIVE_WARN, archive_entry_xattr_next(e, &xname, &xval, &xsize)); assertEqualString(xname, NULL); assertEqualString(xval, NULL); assertEqualInt((int)xsize, 0); archive_entry_xattr_add_entry(e, "xattr1", "xattrvalue1", 12); assertEqualInt(1, archive_entry_xattr_reset(e)); archive_entry_xattr_add_entry(e, "xattr2", "xattrvalue2", 12); assertEqualInt(2, archive_entry_xattr_reset(e)); assertEqualInt(0, archive_entry_xattr_next(e, &xname, &xval, &xsize)); assertEqualInt(0, archive_entry_xattr_next(e, &xname, &xval, &xsize)); assertEqualInt(ARCHIVE_WARN, archive_entry_xattr_next(e, &xname, &xval, &xsize)); assertEqualString(xname, NULL); assertEqualString(xval, NULL); assertEqualInt((int)xsize, 0); /* * Test clone() implementation. */ /* Set values in 'e' */ archive_entry_clear(e); archive_entry_set_atime(e, 13579, 24680); archive_entry_set_birthtime(e, 13779, 24990); archive_entry_set_ctime(e, 13580, 24681); archive_entry_set_dev(e, 235); 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"); archive_entry_set_ino(e, 8593); archive_entry_set_mode(e, 0123456); archive_entry_set_mtime(e, 13581, 24682); archive_entry_set_nlink(e, 736); archive_entry_set_pathname(e, "path"); archive_entry_set_rdev(e, 532); archive_entry_set_size(e, 987654321); archive_entry_copy_sourcepath(e, "source"); archive_entry_set_symlink(e, "symlinkname"); archive_entry_set_uid(e, 83); archive_entry_set_uname(e, "user"); /* Add an ACL entry. */ archive_entry_acl_add_entry(e, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ, ARCHIVE_ENTRY_ACL_USER, 77, "user77"); /* Add an extended attribute. */ archive_entry_xattr_add_entry(e, "xattr1", "xattrvalue", 11); /* Make a clone. */ e2 = archive_entry_clone(e); /* Clone should have same contents. */ assertEqualInt(archive_entry_atime(e2), 13579); assertEqualInt(archive_entry_atime_nsec(e2), 24680); assertEqualInt(archive_entry_birthtime(e2), 13779); assertEqualInt(archive_entry_birthtime_nsec(e2), 24990); assertEqualInt(archive_entry_ctime(e2), 13580); assertEqualInt(archive_entry_ctime_nsec(e2), 24681); assertEqualInt(archive_entry_dev(e2), 235); archive_entry_fflags(e, &set, &clear); assertEqualInt(clear, 0xAA); assertEqualInt(set, 0x55); assertEqualInt(archive_entry_gid(e2), 204); assertEqualString(archive_entry_gname(e2), "group"); assertEqualString(archive_entry_hardlink(e2), "hardlinkname"); assertEqualInt(archive_entry_ino(e2), 8593); assertEqualInt(archive_entry_mode(e2), 0123456); assertEqualInt(archive_entry_mtime(e2), 13581); assertEqualInt(archive_entry_mtime_nsec(e2), 24682); assertEqualInt(archive_entry_nlink(e2), 736); assertEqualString(archive_entry_pathname(e2), "path"); assertEqualInt(archive_entry_rdev(e2), 532); assertEqualInt(archive_entry_size(e2), 987654321); assertEqualString(archive_entry_sourcepath(e2), "source"); assertEqualString(archive_entry_symlink(e2), "symlinkname"); assertEqualInt(archive_entry_uid(e2), 83); assertEqualString(archive_entry_uname(e2), "user"); /* Verify ACL was copied. */ assertEqualInt(4, archive_entry_acl_reset(e2, ARCHIVE_ENTRY_ACL_TYPE_ACCESS)); /* First three are standard permission bits. */ assertEqualInt(0, archive_entry_acl_next(e2, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, &type, &permset, &tag, &qual, &name)); assertEqualInt(type, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); assertEqualInt(permset, 4); assertEqualInt(tag, ARCHIVE_ENTRY_ACL_USER_OBJ); assertEqualInt(qual, -1); assertEqualString(name, NULL); assertEqualInt(0, archive_entry_acl_next(e2, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, &type, &permset, &tag, &qual, &name)); assertEqualInt(type, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); assertEqualInt(permset, 5); assertEqualInt(tag, ARCHIVE_ENTRY_ACL_GROUP_OBJ); assertEqualInt(qual, -1); assertEqualString(name, NULL); assertEqualInt(0, archive_entry_acl_next(e2, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, &type, &permset, &tag, &qual, &name)); assertEqualInt(type, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); assertEqualInt(permset, 6); assertEqualInt(tag, ARCHIVE_ENTRY_ACL_OTHER); assertEqualInt(qual, -1); assertEqualString(name, NULL); /* Fourth is custom one. */ assertEqualInt(0, archive_entry_acl_next(e2, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, &type, &permset, &tag, &qual, &name)); assertEqualInt(type, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); assertEqualInt(permset, ARCHIVE_ENTRY_ACL_READ); assertEqualInt(tag, ARCHIVE_ENTRY_ACL_USER); assertEqualInt(qual, 77); assertEqualString(name, "user77"); /* Verify xattr was copied. */ assertEqualInt(1, archive_entry_xattr_reset(e2)); assertEqualInt(0, archive_entry_xattr_next(e2, &xname, &xval, &xsize)); assertEqualString(xname, "xattr1"); assertEqualString(xval, "xattrvalue"); assertEqualInt((int)xsize, 11); assertEqualInt(ARCHIVE_WARN, archive_entry_xattr_next(e2, &xname, &xval, &xsize)); assertEqualString(xname, NULL); assertEqualString(xval, NULL); assertEqualInt((int)xsize, 0); /* Change the original */ archive_entry_set_atime(e, 13580, 24690); archive_entry_set_birthtime(e, 13980, 24999); archive_entry_set_ctime(e, 13590, 24691); archive_entry_set_dev(e, 245); archive_entry_set_fflags(e, 0x85, 0xDA); archive_entry_set_filetype(e, AE_IFLNK); archive_entry_set_gid(e, 214); archive_entry_set_gname(e, "grouper"); archive_entry_set_hardlink(e, "hardlinkpath"); archive_entry_set_ino(e, 8763); archive_entry_set_mode(e, 0123654); archive_entry_set_mtime(e, 18351, 28642); archive_entry_set_nlink(e, 73); archive_entry_set_pathname(e, "pathest"); archive_entry_set_rdev(e, 132); archive_entry_set_size(e, 987456321); archive_entry_copy_sourcepath(e, "source2"); archive_entry_set_symlink(e, "symlinkpath"); archive_entry_set_uid(e, 93); archive_entry_set_uname(e, "username"); archive_entry_acl_clear(e); archive_entry_xattr_clear(e); /* Clone should still have same contents. */ assertEqualInt(archive_entry_atime(e2), 13579); assertEqualInt(archive_entry_atime_nsec(e2), 24680); assertEqualInt(archive_entry_birthtime(e2), 13779); assertEqualInt(archive_entry_birthtime_nsec(e2), 24990); assertEqualInt(archive_entry_ctime(e2), 13580); assertEqualInt(archive_entry_ctime_nsec(e2), 24681); assertEqualInt(archive_entry_dev(e2), 235); archive_entry_fflags(e2, &set, &clear); assertEqualInt(clear, 0xAA); assertEqualInt(set, 0x55); assertEqualInt(archive_entry_gid(e2), 204); assertEqualString(archive_entry_gname(e2), "group"); assertEqualString(archive_entry_hardlink(e2), "hardlinkname"); assertEqualInt(archive_entry_ino(e2), 8593); assertEqualInt(archive_entry_mode(e2), 0123456); assertEqualInt(archive_entry_mtime(e2), 13581); assertEqualInt(archive_entry_mtime_nsec(e2), 24682); assertEqualInt(archive_entry_nlink(e2), 736); assertEqualString(archive_entry_pathname(e2), "path"); assertEqualInt(archive_entry_rdev(e2), 532); assertEqualInt(archive_entry_size(e2), 987654321); assertEqualString(archive_entry_sourcepath(e2), "source"); assertEqualString(archive_entry_symlink(e2), "symlinkname"); assertEqualInt(archive_entry_uid(e2), 83); assertEqualString(archive_entry_uname(e2), "user"); /* Verify ACL was unchanged. */ assertEqualInt(4, archive_entry_acl_reset(e2, ARCHIVE_ENTRY_ACL_TYPE_ACCESS)); /* First three are standard permission bits. */ assertEqualInt(0, archive_entry_acl_next(e2, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, &type, &permset, &tag, &qual, &name)); assertEqualInt(type, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); assertEqualInt(permset, 4); assertEqualInt(tag, ARCHIVE_ENTRY_ACL_USER_OBJ); assertEqualInt(qual, -1); assertEqualString(name, NULL); assertEqualInt(0, archive_entry_acl_next(e2, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, &type, &permset, &tag, &qual, &name)); assertEqualInt(type, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); assertEqualInt(permset, 5); assertEqualInt(tag, ARCHIVE_ENTRY_ACL_GROUP_OBJ); assertEqualInt(qual, -1); assertEqualString(name, NULL); assertEqualInt(0, archive_entry_acl_next(e2, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, &type, &permset, &tag, &qual, &name)); assertEqualInt(type, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); assertEqualInt(permset, 6); assertEqualInt(tag, ARCHIVE_ENTRY_ACL_OTHER); assertEqualInt(qual, -1); assertEqualString(name, NULL); /* Fourth is custom one. */ assertEqualInt(0, archive_entry_acl_next(e2, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, &type, &permset, &tag, &qual, &name)); assertEqualInt(type, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); assertEqualInt(permset, ARCHIVE_ENTRY_ACL_READ); assertEqualInt(tag, ARCHIVE_ENTRY_ACL_USER); assertEqualInt(qual, 77); assertEqualString(name, "user77"); assertEqualInt(1, archive_entry_acl_next(e2, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, &type, &permset, &tag, &qual, &name)); assertEqualInt(type, 0); assertEqualInt(permset, 0); assertEqualInt(tag, 0); assertEqualInt(qual, -1); assertEqualString(name, NULL); /* Verify xattr was unchanged. */ assertEqualInt(1, archive_entry_xattr_reset(e2)); /* Release clone. */ archive_entry_free(e2); /* * Test clear() implementation. */ archive_entry_clear(e); assertEqualInt(archive_entry_atime(e), 0); assertEqualInt(archive_entry_atime_nsec(e), 0); assertEqualInt(archive_entry_birthtime(e), 0); assertEqualInt(archive_entry_birthtime_nsec(e), 0); assertEqualInt(archive_entry_ctime(e), 0); assertEqualInt(archive_entry_ctime_nsec(e), 0); assertEqualInt(archive_entry_dev(e), 0); archive_entry_fflags(e, &set, &clear); assertEqualInt(clear, 0); assertEqualInt(set, 0); assertEqualInt(archive_entry_filetype(e), 0); assertEqualInt(archive_entry_gid(e), 0); assertEqualString(archive_entry_gname(e), NULL); assertEqualString(archive_entry_hardlink(e), NULL); assertEqualInt(archive_entry_ino(e), 0); assertEqualInt(archive_entry_mode(e), 0); assertEqualInt(archive_entry_mtime(e), 0); assertEqualInt(archive_entry_mtime_nsec(e), 0); assertEqualInt(archive_entry_nlink(e), 0); assertEqualString(archive_entry_pathname(e), NULL); assertEqualInt(archive_entry_rdev(e), 0); assertEqualInt(archive_entry_size(e), 0); assertEqualString(archive_entry_symlink(e), NULL); assertEqualInt(archive_entry_uid(e), 0); assertEqualString(archive_entry_uname(e), NULL); /* ACLs should be cleared. */ assertEqualInt(archive_entry_acl_count(e, ARCHIVE_ENTRY_ACL_TYPE_ACCESS), 0); assertEqualInt(archive_entry_acl_count(e, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT), 0); /* Extended attributes should be cleared. */ assertEqualInt(archive_entry_xattr_count(e), 0); /* * Test archive_entry_copy_stat(). */ memset(&st, 0, sizeof(st)); /* Set all of the standard 'struct stat' fields. */ st.st_atime = 456789; st.st_ctime = 345678; st.st_dev = 123; st.st_gid = 34; st.st_ino = 234; st.st_mode = 077777; st.st_mtime = 234567; st.st_nlink = 345; st.st_size = 123456789; st.st_uid = 23; #ifdef __FreeBSD__ /* On FreeBSD, high-res timestamp data should come through. */ st.st_atimespec.tv_nsec = 6543210; st.st_ctimespec.tv_nsec = 5432109; st.st_mtimespec.tv_nsec = 3210987; st.st_birthtimespec.tv_nsec = 7459386; #endif /* Copy them into the entry. */ archive_entry_copy_stat(e, &st); /* Read each one back separately and compare. */ assertEqualInt(archive_entry_atime(e), 456789); assertEqualInt(archive_entry_ctime(e), 345678); assertEqualInt(archive_entry_dev(e), 123); assertEqualInt(archive_entry_gid(e), 34); assertEqualInt(archive_entry_ino(e), 234); assertEqualInt(archive_entry_mode(e), 077777); assertEqualInt(archive_entry_mtime(e), 234567); assertEqualInt(archive_entry_nlink(e), 345); assertEqualInt(archive_entry_size(e), 123456789); assertEqualInt(archive_entry_uid(e), 23); #if __FreeBSD__ /* On FreeBSD, high-res timestamp data should come through. */ assertEqualInt(archive_entry_atime_nsec(e), 6543210); assertEqualInt(archive_entry_ctime_nsec(e), 5432109); assertEqualInt(archive_entry_mtime_nsec(e), 3210987); assertEqualInt(archive_entry_birthtime_nsec(e), 7459386); #endif /* * Test archive_entry_stat(). */ /* First, clear out any existing stat data. */ memset(&st, 0, sizeof(st)); archive_entry_copy_stat(e, &st); /* Set a bunch of fields individually. */ archive_entry_set_atime(e, 456789, 321); archive_entry_set_ctime(e, 345678, 432); archive_entry_set_dev(e, 123); archive_entry_set_gid(e, 34); archive_entry_set_ino(e, 234); archive_entry_set_mode(e, 012345); archive_entry_set_mode(e, 012345); archive_entry_set_mtime(e, 234567, 543); archive_entry_set_nlink(e, 345); archive_entry_set_size(e, 123456789); archive_entry_set_uid(e, 23); /* Retrieve a stat structure. */ assert((pst = archive_entry_stat(e)) != NULL); if (pst == NULL) return; /* Check that the values match. */ assertEqualInt(pst->st_atime, 456789); assertEqualInt(pst->st_ctime, 345678); assertEqualInt(pst->st_dev, 123); assertEqualInt(pst->st_gid, 34); assertEqualInt(pst->st_ino, 234); assertEqualInt(pst->st_mode, 012345); assertEqualInt(pst->st_mtime, 234567); assertEqualInt(pst->st_nlink, 345); assertEqualInt(pst->st_size, 123456789); assertEqualInt(pst->st_uid, 23); #ifdef __FreeBSD__ /* On FreeBSD, high-res timestamp data should come through. */ assertEqualInt(pst->st_atimespec.tv_nsec, 321); assertEqualInt(pst->st_ctimespec.tv_nsec, 432); assertEqualInt(pst->st_mtimespec.tv_nsec, 543); #endif /* Changing any one value should update struct stat. */ archive_entry_set_atime(e, 456788, 0); assert((pst = archive_entry_stat(e)) != NULL); if (pst == NULL) return; assertEqualInt(pst->st_atime, 456788); archive_entry_set_ctime(e, 345677, 431); assert((pst = archive_entry_stat(e)) != NULL); if (pst == NULL) return; assertEqualInt(pst->st_ctime, 345677); archive_entry_set_dev(e, 122); assert((pst = archive_entry_stat(e)) != NULL); if (pst == NULL) return; assertEqualInt(pst->st_dev, 122); archive_entry_set_gid(e, 33); assert((pst = archive_entry_stat(e)) != NULL); if (pst == NULL) return; assertEqualInt(pst->st_gid, 33); archive_entry_set_ino(e, 233); assert((pst = archive_entry_stat(e)) != NULL); if (pst == NULL) return; assertEqualInt(pst->st_ino, 233); archive_entry_set_mode(e, 012344); assert((pst = archive_entry_stat(e)) != NULL); if (pst == NULL) return; assertEqualInt(pst->st_mode, 012344); archive_entry_set_mtime(e, 234566, 542); assert((pst = archive_entry_stat(e)) != NULL); if (pst == NULL) return; assertEqualInt(pst->st_mtime, 234566); archive_entry_set_nlink(e, 344); assert((pst = archive_entry_stat(e)) != NULL); if (pst == NULL) return; assertEqualInt(pst->st_nlink, 344); archive_entry_set_size(e, 123456788); assert((pst = archive_entry_stat(e)) != NULL); if (pst == NULL) return; assertEqualInt(pst->st_size, 123456788); archive_entry_set_uid(e, 22); assert((pst = archive_entry_stat(e)) != NULL); if (pst == NULL) return; assertEqualInt(pst->st_uid, 22); /* We don't need to check high-res fields here. */ /* * Test dev/major/minor interfaces. Setting 'dev' or 'rdev' * should change the corresponding major/minor values, and * vice versa. * * The test here is system-specific because it assumes that * makedev(), major(), and minor() are defined in sys/stat.h. * I'm not too worried about it, though, because the code is * simple. If it works on FreeBSD, it's unlikely to be broken * anywhere else. Note: The functionality is present on every * platform even if these tests only run some places; * libarchive's more extensive configuration logic should find * the necessary definitions on every platform. */ #if __FreeBSD__ archive_entry_set_dev(e, 0x12345678); assertEqualInt(archive_entry_devmajor(e), major(0x12345678)); assertEqualInt(archive_entry_devminor(e), minor(0x12345678)); assertEqualInt(archive_entry_dev(e), 0x12345678); archive_entry_set_devmajor(e, 0xfe); archive_entry_set_devminor(e, 0xdcba98); assertEqualInt(archive_entry_devmajor(e), 0xfe); assertEqualInt(archive_entry_devminor(e), 0xdcba98); assertEqualInt(archive_entry_dev(e), makedev(0xfe, 0xdcba98)); archive_entry_set_rdev(e, 0x12345678); assertEqualInt(archive_entry_rdevmajor(e), major(0x12345678)); assertEqualInt(archive_entry_rdevminor(e), minor(0x12345678)); assertEqualInt(archive_entry_rdev(e), 0x12345678); archive_entry_set_rdevmajor(e, 0xfe); archive_entry_set_rdevminor(e, 0xdcba98); assertEqualInt(archive_entry_rdevmajor(e), 0xfe); assertEqualInt(archive_entry_rdevminor(e), 0xdcba98); assertEqualInt(archive_entry_rdev(e), makedev(0xfe, 0xdcba98)); #endif /* * Exercise the character-conversion logic, if we can. */ if (NULL == setlocale(LC_ALL, "en_US.UTF-8")) { skipping("Can't exercise charset-conversion logic without" " a suitable locale."); } else { /* A filename that cannot be converted to wide characters. */ archive_entry_copy_pathname(e, "abc\314\214mno\374xyz"); failure("Converting invalid chars to Unicode should fail."); assert(NULL == archive_entry_pathname_w(e)); /* failure("Converting invalid chars to UTF-8 should fail."); assert(NULL == archive_entry_pathname_utf8(e)); */ /* A group name that cannot be converted. */ archive_entry_copy_gname(e, "abc\314\214mno\374xyz"); failure("Converting invalid chars to Unicode should fail."); assert(NULL == archive_entry_gname_w(e)); /* A user name that cannot be converted. */ archive_entry_copy_uname(e, "abc\314\214mno\374xyz"); failure("Converting invalid chars to Unicode should fail."); assert(NULL == archive_entry_uname_w(e)); /* A hardlink target that cannot be converted. */ archive_entry_copy_hardlink(e, "abc\314\214mno\374xyz"); failure("Converting invalid chars to Unicode should fail."); assert(NULL == archive_entry_hardlink_w(e)); /* A symlink target that cannot be converted. */ archive_entry_copy_symlink(e, "abc\314\214mno\374xyz"); failure("Converting invalid chars to Unicode should fail."); assert(NULL == archive_entry_symlink_w(e)); } l = 0x12345678L; wc = (wchar_t)l; /* Wide character too big for UTF-8. */ if (NULL == setlocale(LC_ALL, "C") || (long)wc != l) { skipping("Testing charset conversion failure requires 32-bit wchar_t and support for \"C\" locale."); } else { /* * Build the string L"xxx\U12345678yyy\u5678zzz" without * using wcscpy or C99 \u#### syntax. */ name = "xxxAyyyBzzz"; for (i = 0; i < (int)strlen(name); ++i) wbuff[i] = name[i]; wbuff[3] = (wchar_t)0x12345678; wbuff[7] = (wchar_t)0x5678; /* A Unicode filename that cannot be converted to UTF-8. */ archive_entry_copy_pathname_w(e, wbuff); failure("Converting wide characters from Unicode should fail."); assertEqualString(NULL, archive_entry_pathname(e)); } /* Release the experimental entry. */ archive_entry_free(e); }
Upload File
Create Folder