From: Tobias Stoeckmann Date: Mon, 2 Jun 2025 19:38:11 +0000 (+0200) Subject: unzip: Pass test if encryption support is missing X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c40a3887ab878f3ef7ffc3e063fb5a1645e26715;p=thirdparty%2Flibarchive.git 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 --- 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"); + } }