summaryrefslogtreecommitdiff
path: root/libarchive/test/test_read_format_lha.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/test/test_read_format_lha.c')
-rw-r--r--libarchive/test/test_read_format_lha.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libarchive/test/test_read_format_lha.c b/libarchive/test/test_read_format_lha.c
index 36c5d080340a..6a53976c2a75 100644
--- a/libarchive/test/test_read_format_lha.c
+++ b/libarchive/test/test_read_format_lha.c
@@ -169,6 +169,8 @@ verify(const char *refname, int posix)
assertEqualIntA(a, ARCHIVE_EOF,
archive_read_data_block(a, &pv, &s, &o));
assertEqualInt(s, 0);
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
/* Verify directory2. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
@@ -181,6 +183,8 @@ verify(const char *refname, int posix)
assertEqualIntA(a, ARCHIVE_EOF,
archive_read_data_block(a, &pv, &s, &o));
assertEqualInt(s, 0);
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
if (posix) {
/* Verify symbolic link file1. */
@@ -192,6 +196,8 @@ verify(const char *refname, int posix)
assertEqualInt(uid, archive_entry_uid(ae));
assertEqualInt(gid, archive_entry_gid(ae));
assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
/* Verify symbolic link file2. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
@@ -202,6 +208,8 @@ verify(const char *refname, int posix)
assertEqualInt(uid, archive_entry_uid(ae));
assertEqualInt(gid, archive_entry_gid(ae));
assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
}
/* Verify regular file1. */
@@ -214,6 +222,8 @@ verify(const char *refname, int posix)
assertEqualInt(file1_size, archive_entry_size(ae));
assertEqualInt(file1_size, archive_read_data(a, buff, file1_size));
assertEqualMem(buff, file1, file1_size);
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
/* Verify regular file2. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
@@ -228,6 +238,8 @@ verify(const char *refname, int posix)
assertEqualInt(file2_size, archive_entry_size(ae));
assertEqualInt(file2_size, archive_read_data(a, buff, file2_size));
assertEqualMem(buff, file2, file2_size);
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
/* Verify the number of files read. */
if (posix) {
@@ -246,6 +258,10 @@ verify(const char *refname, int posix)
assertEqualInt(4, archive_file_count(a));
}
+ /* Verify encryption status */
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
+
/* Verify archive format. */
assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0));
assertEqualIntA(a, ARCHIVE_FORMAT_LHA, archive_format(a));