From: Stephan Bosch Date: Wed, 4 Sep 2019 21:37:11 +0000 (+0200) Subject: lib: test-base64 - Abort random test at first error and print parameters. X-Git-Tag: 2.3.8~93 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a1b0b14db40b21fc69e8316f2bb96a2afaa48349;p=thirdparty%2Fdovecot%2Fcore.git lib: test-base64 - Abort random test at first error and print parameters. --- diff --git a/src/lib/test-base64.c b/src/lib/test-base64.c index f546cf6d0e..4db27c939b 100644 --- a/src/lib/test-base64.c +++ b/src/lib/test-base64.c @@ -1010,6 +1010,15 @@ test_base64_random_lowlevel_case(const struct base64_scheme *b64, max_line_len, i, in_buf, in_buf_size, buf1, buf2); + + if (test_has_failed()) { + i_info("One block test failed (" + "enc_flags=%02x dec_flags=%02x " + "max_line_len=%"PRIuSIZE_T" size=%"PRIuSIZE_T")", + enc_flags, dec_flags, max_line_len, + in_buf_size); + return; + } } /* streaming; single-byte trickle */ @@ -1022,6 +1031,15 @@ test_base64_random_lowlevel_case(const struct base64_scheme *b64, max_line_len, i, in_buf, in_buf_size, buf1, buf2, 1); + + if (test_has_failed()) { + i_info("Streaming single-byte trickle test failed (" + "enc_flags=%02x dec_flags=%02x " + "max_line_len=%"PRIuSIZE_T" size=%"PRIuSIZE_T")", + enc_flags, dec_flags, max_line_len, + in_buf_size); + return; + } } /* streaming; random chunks */ @@ -1034,6 +1052,14 @@ test_base64_random_lowlevel_case(const struct base64_scheme *b64, max_line_len, i, in_buf, in_buf_size, buf1, buf2, 0); + if (test_has_failed()) { + i_info("Streaming random chunks test failed (" + "enc_flags=%02x dec_flags=%02x " + "max_line_len=%"PRIuSIZE_T" size=%"PRIuSIZE_T")", + enc_flags, dec_flags, max_line_len, + in_buf_size); + return; + } } }