Skip to content

Commit

Permalink
Add test to cover bz.avail_out == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
desvxx authored and ni4 committed Oct 4, 2024
1 parent 84975ea commit 9329129
Show file tree
Hide file tree
Showing 2 changed files with 10,205 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/tests/cli_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4820,6 +4820,31 @@ def test_rnp_compression(self):
file_encryption_rnp_to_gpg(size, z)
rnp_signing_gpg_to_rnp(size, z)

def test_rnp_compression_corner_cases(self):
shutil.rmtree(RNPDIR)
kring = shutil.copytree(data_path(KEYRING_DIR_1), RNPDIR)
gpg_import_pubring()
gpg_import_secring()

src = data_path('test_compression/cleartext-z-bz.txt')
algosrnp = [None, 'zip', 'zlib', 'bzip2']

for algo in algosrnp:
z = [algo, None]
dst, enc = reg_workfiles('cleartext', '.gpg', '.rnp')
# Encrypt cleartext file with RNP
rnp_encrypt_file_ex(src, enc, [], None, None, None, z, False)

# Decrypt encrypted file with GPG
gpg_decrypt_file(enc, dst, PASSWORD)
compare_files(src, dst, GPG_DATA_DIFFERS)
remove_files(dst)
# Decrypt encrypted file with RNP
rnp_decrypt_file(enc, dst)
compare_files(src, dst, RNP_DATA_DIFFERS)
remove_files(enc, dst)
clear_workfiles()

class SignDefault(unittest.TestCase):
'''
Things to try later:
Expand Down
Loading

0 comments on commit 9329129

Please sign in to comment.