code documentation cleaned
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file tester.h
|
||||
*
|
||||
* @brief Test module for automatic testing
|
||||
* @brief Interface of tester_t.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -28,86 +28,101 @@
|
||||
#include <types.h>
|
||||
|
||||
|
||||
|
||||
typedef struct test_t test_t;
|
||||
|
||||
typedef struct tester_t tester_t;
|
||||
|
||||
/**
|
||||
* @brief Specifies a test
|
||||
* @brief Representing a specified test.
|
||||
*
|
||||
* @ingroup utils
|
||||
*/
|
||||
struct test_t {
|
||||
/**
|
||||
* Testfunction called for this test.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
*/
|
||||
void (*test_function) (tester_t * tester);
|
||||
/**
|
||||
* Name of the test.
|
||||
*/
|
||||
char * test_name;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A tester object to perform tests with
|
||||
* A tester class to perform tests.
|
||||
*
|
||||
* @ingroup utils
|
||||
*/
|
||||
struct tester_t {
|
||||
|
||||
/**
|
||||
* @brief Tests all testcases in array tests with specific tester object
|
||||
* @brief Tests all testcases in array tests with specific tester_t object.
|
||||
*
|
||||
* @param tester tester object
|
||||
* @param pointer to a array of test_t-pointers.
|
||||
* the last item has to be NULL.
|
||||
* @return SUCCESSFUL if succeeded, FAILED otherwise
|
||||
* @param tester tester_t object
|
||||
* @param tests pointer to an array of test_t-pointers.
|
||||
* The last item has to be NULL.
|
||||
* @return SUCCESS in any case
|
||||
*/
|
||||
status_t (*perform_tests) (tester_t *tester,test_t **tests);
|
||||
|
||||
/**
|
||||
* @brief run a specific test case
|
||||
* @brief Run a specific test case.
|
||||
*
|
||||
* @param this tester object
|
||||
* @param test pointer to a test_t object which will be performed
|
||||
* @param Name of the Test
|
||||
* @param this tester_t object
|
||||
* @param test pointer to a test_t object which will be performed
|
||||
* @return SUCCESS in any case
|
||||
*/
|
||||
status_t (*perform_test) (tester_t *tester, test_t *test);
|
||||
|
||||
/**
|
||||
* @brief is called in a testcase to check a specific situation for TRUE
|
||||
* Is called in a testcase to check a specific situation for TRUE.
|
||||
*
|
||||
* Log-Values to the tester output are protected from multiple access
|
||||
* Log-Values to the tester output are protected from multiple access.
|
||||
*
|
||||
* @warning this function should only be called in a test_function
|
||||
* @warning This function should only be called in a test_function.
|
||||
*
|
||||
* @param this tester object
|
||||
* @param to_be_true assert which has to be TRUE
|
||||
* @param Name of the assertion
|
||||
* @param this tester_t object
|
||||
* @param to_be_true assert which has to be TRUE
|
||||
* @param assert_name name of the assertion
|
||||
*/
|
||||
void (*assert_true) (tester_t *tester, bool to_be_true, char *assert_name);
|
||||
|
||||
/**
|
||||
* @brief is called in a testcase to check a specific situation for FALSE
|
||||
* Is called in a testcase to check a specific situation for FALSE.
|
||||
*
|
||||
* Log-Values to the tester output are protected from multiple access
|
||||
* Log-Values to the tester output are protected from multiple access.
|
||||
*
|
||||
* @warning this function should only be called in a test_function
|
||||
* @warning This function should only be called in a test_function.
|
||||
*
|
||||
* @param this tester object
|
||||
* @param to_be_false assert which has to be FALSE
|
||||
* @param Name of the assertion
|
||||
* @param this tester_t object
|
||||
* @param to_be_false assert which has to be FALSE
|
||||
* @param assert_name name of the assertion
|
||||
*/
|
||||
void (*assert_false) (tester_t *tester, bool to_be_false, char *assert_name);
|
||||
|
||||
/**
|
||||
* @brief Destroys a tester object
|
||||
* @brief Destroys a tester_t object
|
||||
*
|
||||
* @param tester tester object
|
||||
* @return SUCCESSFUL if succeeded, FAILED otherwise
|
||||
* @param tester tester_t object
|
||||
* @return SUCCESS in any case
|
||||
*/
|
||||
status_t (*destroy) (tester_t *tester);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief creates a tester object needed to perform tests
|
||||
* @brief Creates a tester_t object used to perform tests with.
|
||||
*
|
||||
* @param output test output is written to this output
|
||||
* @param output test output is written to this output.
|
||||
* @param display_succeeded_asserts has to be TRUE, if all asserts should be displayed,
|
||||
* else otherwise
|
||||
* FALSE otherwise
|
||||
*
|
||||
* @return tester object
|
||||
* @return
|
||||
* - tester_t object
|
||||
* - NULL if out of ressources
|
||||
*
|
||||
* @ingroup utils
|
||||
*/
|
||||
tester_t *tester_create(FILE *output, bool display_succeeded_asserts);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user