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 <tobias@stoeckmann.org>
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");
+ }
}