1e64fe029SMartin Matuska /* 2*bd66c1b4SMartin Matuska * SPDX-License-Identifier: BSD-2-Clause 3*bd66c1b4SMartin Matuska * 4e64fe029SMartin Matuska * Copyright (c) 2023 Adrian Vovk 5e64fe029SMartin Matuska * All rights reserved. 6e64fe029SMartin Matuska */ 7e64fe029SMartin Matuska #include "test.h" 8e64fe029SMartin Matuska 9e64fe029SMartin Matuska /* Test P arg - password protected */ DEFINE_TEST(test_P_encryption)10*bd66c1b4SMartin MatuskaDEFINE_TEST(test_P_encryption) 11e64fe029SMartin Matuska { 12e64fe029SMartin Matuska const char *reffile = "test_encrypted.zip"; 13e64fe029SMartin Matuska int r; 14e64fe029SMartin Matuska 15e64fe029SMartin Matuska extract_reference_file(reffile); 16e64fe029SMartin Matuska r = systemf("%s -P password %s >test.out 2>test.err", testprog, reffile); 17e64fe029SMartin Matuska assertEqualInt(0, r); 18e64fe029SMartin Matuska assertNonEmptyFile("test.out"); 19e64fe029SMartin Matuska assertEmptyFile("test.err"); 20e64fe029SMartin Matuska 21e64fe029SMartin Matuska assertTextFileContents("plaintext\n", "encrypted/file.txt"); 22e64fe029SMartin Matuska } 23