summaryrefslogtreecommitdiff
path: root/test/libtest/lib/test.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/libtest/lib/test.h')
-rw-r--r--test/libtest/lib/test.h54
1 files changed, 27 insertions, 27 deletions
diff --git a/test/libtest/lib/test.h b/test/libtest/lib/test.h
index 86f91463993b..6928f867a6f4 100644
--- a/test/libtest/lib/test.h
+++ b/test/libtest/lib/test.h
@@ -44,60 +44,59 @@ enum test_result {
/*
* The return values from test case set up and tear down functions.
*
- * - TESTCASE_OK : The set up or tear down function was successful.
- * - TESTCASE_ERROR : Set up or tear down actions could not be completed.
+ * - TEST_CASE_OK : The set up or tear down function was successful.
+ * - TEST_CASE_ERROR : Set up or tear down actions could not be completed.
*
- * If a test case set up function returns TESTCASE_ERROR then:
+ * If a test case set up function returns TEST_CASE_ERROR then:
* - The test functions in the test case will not be run.
* - The test case's tear down function will not be invoked.
* - The test run as a whole will be treated as being in error.
*
- * If a test case tear down function returns a TESTCASE_ERROR, then
+ * If a test case tear down function returns a TEST_CASE_ERROR, then
* the test run as a whole be treated as being in error.
*/
-enum testcase_status {
- TESTCASE_OK = 0,
- TESTCASE_ERROR = 1
+enum test_case_status {
+ TEST_CASE_OK = 0,
+ TEST_CASE_ERROR = 1
};
/*
- * A testcase_state denotes resources that are shared by the test
- * functions that are part of a test case. A testcase_state is allocated
- * by the set up function for a test case. Conversely the test case's
- * tear down function is responsible for deallocating the resources
- * allocated by the set up function.
+ * A 'test_case_state' is a handle to resources shared by the test functions
+ * that make up a test case. A test_case_state is allocated by the test case
+ * set up function and is deallocated by the test case tear down function.
*
- * The test(3) framework treats a testcase_state as an opaque value.
+ * The test(3) framework treats a 'test_case_state' as an opaque value.
*/
-typedef void *testcase_state;
+typedef void *test_case_state;
/*
* Test case and test function descriptions, and convenience macros
* to define these.
*/
-typedef const char testcase_description[];
+typedef const char test_case_description[];
-#if !defined(TEST_DESCRIPTION)
-#define TEST_DESCRIPTION(NAME) test_description tf_description_##NAME
+#if !defined(TEST_CASE_DESCRIPTION)
+#define TEST_CASE_DESCRIPTION(NAME) test_case_description tc_description_##NAME
#endif
typedef const char test_description[];
-#if !defined(TESTCASE_DESCRIPTION)
-#define TESTCASE_DESCRIPTION(NAME) testcase_description tc_description_##NAME
+#if !defined(TEST_DESCRIPTION)
+#define TEST_DESCRIPTION(NAME) test_description tf_description_##NAME
#endif
/*
* Test case and test function tags, and convenience macros to define
* these.
*/
-typedef const char *testcase_tags[];
+typedef const char *test_case_tags[];
-#if !defined(TESTCASE_TAGS)
-#define TESTCASE_TAGS(NAME) testcase_tags tc_tags_##NAME
+#if !defined(TEST_CASE_TAGS)
+#define TEST_CASE_TAGS(NAME) test_case_tags tc_tags_##NAME
#endif
typedef const char *test_tags[];
+
#if !defined(TEST_TAGS)
#define TEST_TAGS(NAME) test_tags tf_tags_##NAME
#endif
@@ -108,7 +107,7 @@ typedef const char *test_tags[];
* If defined for a test case, this function will be called prior to
* the execution of an of the test functions within the test cae. Test
* case execution will be aborted if the function returns any value other
- * than TESTCASE_OK.
+ * than TEST_CASE_OK.
*
* The function can set '*state' to a memory area holding test state to be
* passed to test functions.
@@ -116,8 +115,8 @@ typedef const char *test_tags[];
* If the test case does not define a set up function, then a default
* no-op set up function will be used.
*/
-typedef enum testcase_status (test_case_setup_function)
- (testcase_state *state);
+typedef enum test_case_status test_case_setup_function(
+ test_case_state *state);
/*
* A test function.
@@ -127,7 +126,7 @@ typedef enum testcase_status (test_case_setup_function)
* its test succeeded or TEST_FAIL otherwise. In the event the test could
* not be executed, it can return TEST_UNRESOLVED.
*/
-typedef enum test_result (test_function)(testcase_state state);
+typedef enum test_result test_function(test_case_state state);
/*
* A test case tear down function.
@@ -138,7 +137,8 @@ typedef enum test_result (test_function)(testcase_state state);
* responsible for deallocating the resources that the set up function
* had allocated.
*/
-typedef enum testcase_status (test_case_teardown_function)(testcase_state state);
+typedef enum test_case_status test_case_teardown_function(
+ test_case_state state);
#ifdef __cplusplus
extern "C" {