From c40a3887ab878f3ef7ffc3e063fb5a1645e26715 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Mon, 2 Jun 2025 21:38:11 +0200 Subject: [PATCH] unzip: Pass test if encryption support is missing If no encryption support exists, the -P option will always fail. "Skip" the test by making sure that there really is no encryption support according to libarchive functions. Signed-off-by: Tobias Stoeckmann --- unzip/test/test_P_encryption.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/unzip/test/test_P_encryption.c b/unzip/test/test_P_encryption.c index e2cf3cda0..ed08a0688 100644 --- a/unzip/test/test_P_encryption.c +++ b/unzip/test/test_P_encryption.c @@ -14,9 +14,13 @@ DEFINE_TEST(test_P_encryption) extract_reference_file(reffile); r = systemf("%s -P password %s >test.out 2>test.err", testprog, reffile); - assertEqualInt(0, r); - assertNonEmptyFile("test.out"); - assertEmptyFile("test.err"); + if (r == 256) { + assertTextFileContents("unzip: Decryption is unsupported due to lack of crypto library\n", "test.err"); + } else { + assertEqualInt(0, r); + assertNonEmptyFile("test.out"); + assertEmptyFile("test.err"); - assertTextFileContents("plaintext\n", "encrypted/file.txt"); + assertTextFileContents("plaintext\n", "encrypted/file.txt"); + } } -- 2.47.3