Improve test infrastructure documentation

Clarify the function descriptions for several test infrastructure functions.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
This commit is contained in:
Chris Jones 2021-02-03 16:15:00 +00:00
parent 567e0ad8f1
commit 39ddb0a2e1

View File

@ -71,27 +71,40 @@ int mbedtls_test_platform_setup( void );
void mbedtls_test_platform_teardown( void ); void mbedtls_test_platform_teardown( void );
/** /**
* \brief Record the given, usually current, test as a failure. * \brief Record the current test case as a failure.
* *
* \param test Name of the test to fail. * This function can be called directly however it is usually
* called via macros such as TEST_ASSERT, TEST_EQUAL,
* PSA_ASSERT, etc...
*
* \note If the test case was already marked as failed, calling
* `mbedtls_test_fail( )` again will not overwrite any
* previous information about the failure.
*
* \param test Description of the failure or assertion that failed. This
* MUST be a string literal.
* \param line_no Line number where the failure originated. * \param line_no Line number where the failure originated.
* \param filename Filename where the failure originated. * \param filename Filename where the failure originated.
*/ */
void mbedtls_test_fail( const char *test, int line_no, const char* filename ); void mbedtls_test_fail( const char *test, int line_no, const char* filename );
/** /**
* \brief Record the given, usually current, test as skipped. * \brief Record the current test case as skipped.
* *
* \param test Name of the test to skip. * This function can be called directly however it is usually
* \param line_no Line number where the test skipped. * called via the TEST_ASSUME macro.
* \param filename Filename where the test skipped. *
* \param test Description of the assumption that caused the test case to
* be skipped. This MUST be a string literal.
* \param line_no Line number where the test case was skipped.
* \param filename Filename where the test case was skipped.
*/ */
void mbedtls_test_skip( const char *test, int line_no, const char* filename ); void mbedtls_test_skip( const char *test, int line_no, const char* filename );
/** /**
* \brief Set the test step number for failure reports. * \brief Set the test step number for failure reports.
* *
* \note Call this function to display "step NNN" in addition to the * Call this function to display "step NNN" in addition to the
* line number and file name if a test fails. Typically the "step * line number and file name if a test fails. Typically the "step
* number" is the index of a for loop but it can be whatever you * number" is the index of a for loop but it can be whatever you
* want. * want.
@ -102,9 +115,6 @@ void mbedtls_test_set_step( unsigned long step );
/** /**
* \brief Reset mbedtls_test_info to a ready/starting state. * \brief Reset mbedtls_test_info to a ready/starting state.
*
* \note Clears the test, line_no, filename, step and result from any
* previously stored values and initialises them ready to be used.
*/ */
void mbedtls_test_info_reset( void ); void mbedtls_test_info_reset( void );