/
githubmirror
/
libarchive
Обзор
Документация
Войти
/
githubmirror
/
libarchive
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
unzip/test/test_P_encryption.c
30 строк
716 B
Tobias Stoeckmann
unzip: Skip another test if zlib unavailable
21 июн 2026, 22:07
21 июн 2026, 22:07
ed9f5ad
Код
Авторство
О чём код?
/* * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2023 Adrian Vovk * All rights reserved. */ #include "test.h" /* Test P arg - password protected */ DEFINE_TEST(test_P_encryption) { #ifdef HAVE_LIBZ const char *reffile = "test_encrypted.zip"; int r; extract_reference_file(reffile); r = systemf("%s -P password %s >test.out 2>test.err", testprog, reffile); 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"); } #else skipping("zlib not available"); #endif }