]> git.ipfire.org Git - thirdparty/dovecot/core.git/commit
lib-test: improve expected error handling
authorPhil Carmody <phil@dovecot.fi>
Wed, 1 Jun 2016 10:57:34 +0000 (13:57 +0300)
committerGitLab <gitlab@git.dovecot.net>
Mon, 8 Aug 2016 08:25:32 +0000 (11:25 +0300)
commit0e0a294cfa87a8e44f29997cac48fd5030767b2b
treee77d42bdd7cfee88f52ab4dc7cc55a8e4ccd5e75
parentceee39b0d2f8f5705b05cccb010c764e9771a9bc
lib-test: improve expected error handling

If we expect a specific error string, then when we see it, suppress it.

We do not suppress errors expected by count, because if we get unexpected
errors, then we do not want them suppressed, and we have no way of
distinguishing between the expected and unexpected errors.

This of course favours the use of the expected string version of the helper,
but alas that's not always usable, as you can only expect one at a time.

Additionally, if we failed to see an expected message, then when we no longer
expect to see it, reset the expected message state to not cascade further
test assertion failures.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
Conflicts:
src/lib-test/test-common.c
src/lib-test/test-common.c
src/lib-test/test-common.h
src/lib/test-failures.c