From 00d0ad40362e4d74d07d7fec9abccd6d87c2bdee Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 15 Feb 2021 11:02:51 +0100 Subject: [PATCH] Clarify the advice about reporting errors in test hooks Signed-off-by: Gilles Peskine --- programs/ssl/ssl_test_lib.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/programs/ssl/ssl_test_lib.h b/programs/ssl/ssl_test_lib.h index 8f37d6341..2712da67a 100644 --- a/programs/ssl/ssl_test_lib.h +++ b/programs/ssl/ssl_test_lib.h @@ -265,9 +265,16 @@ void test_hooks_init( void ); /** Check if any test hooks detected a problem. * - * \note When implementing a test hook, make sure to print a message - * to standard error either at the time the problem is detected - * or during the execution of this function. + * If a problem was detected, it's ok for the calling program to keep going, + * but it should ultimately exit with an error status. + * + * \note When implementing a test hook that detects errors on its own + * (as opposed to e.g. leaving the error for a memory sanitizer to + * report), make sure to print a message to standard error either at + * the time the problem is detected or during the execution of this + * function. This function does not indicate what problem was detected, + * so printing a message is the only way to provide feedback in the + * logs of the calling program. * * \return Nonzero if a problem was detected. * \c 0 if no problem was detected.