diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cram/test_base64.t | 12 | ||||
-rw-r--r-- | tests/test-b64_decode.c | 7 | ||||
-rw-r--r-- | tests/test-b64_encode.c | 7 |
3 files changed, 26 insertions, 0 deletions
diff --git a/tests/cram/test_base64.t b/tests/cram/test_base64.t index 4f8809f..0a7a9d5 100644 --- a/tests/cram/test_base64.t +++ b/tests/cram/test_base64.t @@ -19,3 +19,15 @@ check that base64 is producing expected results: 4 foob 5 fooba 6 foobar + +check that b64_encode and b64_decode assert invalid input + + $ alias check="egrep '(dumped|Assertion)' | sed 's;.*\(b64_.*code\).*\(Assertion.*$\);\1: \2;' | LC_ALL=C sort" + + $ test-b64_decode 2>&1 | check + Aborted (core dumped) + b64_decode: Assertion `dest && targsize > 0' failed. + + $ test-b64_encode 2>&1 | check + Aborted (core dumped) + b64_encode: Assertion `dest && targsize > 0' failed. diff --git a/tests/test-b64_decode.c b/tests/test-b64_decode.c new file mode 100644 index 0000000..4798fa8 --- /dev/null +++ b/tests/test-b64_decode.c @@ -0,0 +1,7 @@ +#include "utils.h" + +int main() +{ + b64_decode("Zg==", NULL, 2); + return 0; +} diff --git a/tests/test-b64_encode.c b/tests/test-b64_encode.c new file mode 100644 index 0000000..5f011e5 --- /dev/null +++ b/tests/test-b64_encode.c @@ -0,0 +1,7 @@ +#include "utils.h" + +int main() +{ + b64_encode("foo", 3, NULL, 2); + return 0; +} |