BTest for sub_bytes

This commit is contained in:
Vern Paxson 2024-05-31 15:53:15 -07:00
parent d551d4b9cf
commit cbf1cd7398
3 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.

View file

@ -0,0 +1,9 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
bcde
bcde
bcde
bcde
bcde
bcde
bcde
bcde

View file

@ -0,0 +1,22 @@
# @TEST-DOC: Test the sub_bytes() function.
#
# @TEST-EXEC: zeek -b %INPUT >out
# @TEST-EXEC: btest-diff out
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
# These tests are to ensure that script optimization gets all the permutations
# correct, for varying combinations of constant and variable arguments.
global s = "abcdefghij";
global a = 2;
global b = 4;
print sub_bytes(s, a, b);
print sub_bytes(s, 2, b);
print sub_bytes(s, a, 4);
print sub_bytes(s, 2, 4);
print sub_bytes("abcdefghij", a, b);
print sub_bytes("abcdefghij", 2, b);
print sub_bytes("abcdefghij", a, 4);
print sub_bytes("abcdefghij", 2, 4);