diff options
| author | Egor Tensin <egor@tensin.name> | 2026-07-23 11:21:08 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-07-23 11:39:07 +0200 |
| commit | 64c1d0c067557a5102a19122fdeb613ad9e7679a (patch) | |
| tree | 38e2992fddfe3018439f5552571eb36f1ebe3ecc | |
| parent | update my email (diff) | |
| download | aes-tools-64c1d0c067557a5102a19122fdeb613ad9e7679a.tar.gz aes-tools-64c1d0c067557a5102a19122fdeb613ad9e7679a.zip | |
aesxx/utils: add more basic tests
| -rw-r--r-- | aesxx/utils/test/basic.cmake | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/aesxx/utils/test/basic.cmake b/aesxx/utils/test/basic.cmake index 2383f61..aabd57b 100644 --- a/aesxx/utils/test/basic.cmake +++ b/aesxx/utils/test/basic.cmake @@ -79,7 +79,7 @@ foreach(action encrypt decrypt) -- "$<TARGET_FILE:${tgt}>" -a aes256 -m ecb foobar ) - add_test(NAME "${tgt}_invalid_iv" COMMAND Python3::Interpreter + add_test(NAME "${tgt}_invalid_iv1" COMMAND Python3::Interpreter "${CMAKE_SOURCE_DIR}/cmake/tools/ctest-driver.py" run --exit-code 1 @@ -103,4 +103,29 @@ foreach(action encrypt decrypt) -- "$<TARGET_FILE:${tgt}>" -a aes128 -m cbc 11111111111111111111111111111111 22222222222222222222222222222222 0 ) + + set(exe "${action}_file") + set(tgt "util_${exe}") + add_test(NAME "${tgt}_no_key" COMMAND Python3::Interpreter + "${CMAKE_SOURCE_DIR}/cmake/tools/ctest-driver.py" + run + --exit-code 1 + --pass-regex [=[the option '--key' is required but missing]=] + -- + "$<TARGET_FILE:${tgt}>" -a aes128 -m ecb -i in.txt -o out.txt + ) + add_test(NAME "${tgt}_no_files" COMMAND Python3::Interpreter + "${CMAKE_SOURCE_DIR}/cmake/tools/ctest-driver.py" + run + --exit-code 1 + --pass-regex [=[the option '--input' is required but missing]=] + -- + "$<TARGET_FILE:${tgt}>" -a aes128 -m ecb -k 11111111111111111111111111111111 + ) + add_test(NAME "${tgt}_no_iv" COMMAND Python3::Interpreter + "${CMAKE_SOURCE_DIR}/cmake/tools/ctest-driver.py" + run + -- + "$<TARGET_FILE:${tgt}>" -a aes128 -m cbc -k 11111111111111111111111111111111 -i in.txt -o out.txt + ) endforeach() |
