diff options
Diffstat (limited to 'test/libtest/examples/simple_example.c')
-rw-r--r-- | test/libtest/examples/simple_example.c | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/test/libtest/examples/simple_example.c b/test/libtest/examples/simple_example.c index 6a4f6697eb51..6d72f65dd451 100644 --- a/test/libtest/examples/simple_example.c +++ b/test/libtest/examples/simple_example.c @@ -31,6 +31,14 @@ #include "test.h" /* + * Function prototypes. + */ +enum test_case_status tc_setup_helloworld(test_case_state *); +enum test_case_status tc_teardown_helloworld(test_case_state); +enum test_result tf_helloworld_sayhello(test_case_state); +enum test_result tf_helloworld_saygoodbye(test_case_state); + +/* * This source defines a single test case named 'helloworld' containing a * single test function named 'sayhello' contained in that test case. At * test execution time the test case would be selectable using the tags @@ -64,35 +72,37 @@ /* * A symbol name prefixed with 'tc_description_' contains a - * test case description. The TESTCASE_DESCRIPTION macro offers + * test case description. The TEST_CASE_DESCRIPTION macro offers * a convenient way to define such symbols. In the case of the * symbol below, the test case named is 'helloworld'. */ -TESTCASE_DESCRIPTION(helloworld) = "A description for a test case."; +TEST_CASE_DESCRIPTION(helloworld) = "A description for a test case."; /* * Function names prefixed with 'tc_setup_' are assumed to be test * case set up functions. */ -enum testcase_status -tc_setup_helloworld(testcase_state *state) +enum test_case_status +tc_setup_helloworld(test_case_state *state) { - return (TESTCASE_OK); + (void) state; + return (TEST_CASE_OK); } /* * Function names prefixed with 'tc_teardown_' are assumed to be test * case tear down functions. */ -enum testcase_status -tc_teardown_helloworld(testcase_state state) +enum test_case_status +tc_teardown_helloworld(test_case_state state) { - return (TESTCASE_OK); + (void) state; + return (TEST_CASE_OK); } /* * Names prefixed with 'tc_tags_' denote the tags associated with test - * cases. The TESTCASE_TAGS macro offers a convenient way to define such + * cases. The TESTC_ASE_TAGS macro offers a convenient way to define such * symbols. * * In the example below, all test functions belonging to the test case @@ -100,7 +110,7 @@ tc_teardown_helloworld(testcase_state state) * * Tags lists are terminated by a NULL entry. */ -TESTCASE_TAGS(helloworld) = { +TEST_CASE_TAGS(helloworld) = { "tag1", "tag2", NULL @@ -110,8 +120,16 @@ TESTCASE_TAGS(helloworld) = { * Function names prefixed with 'tf_' name test functions. */ enum test_result -tf_helloworld_sayhello(testcase_state state) +tf_helloworld_sayhello(test_case_state state) +{ + (void) state; + return (TEST_PASS); +} + +enum test_result +tf_helloworld_saygoodbye(test_case_state state) { + (void) state; return (TEST_PASS); } @@ -126,6 +144,9 @@ tf_helloworld_sayhello(testcase_state state) TEST_DESCRIPTION(helloworld_sayhello) = "A description for the test function 'tf_helloworld_sayhello'."; +TEST_DESCRIPTION(helloworld_saygoodbye) = + "A description for the test function 'tf_helloworld_saygoodbye'."; + /* * Names prefixed by 'tf_tags_' contain the tags associated with * test functions. @@ -143,3 +164,8 @@ test_tags tf_tags_helloworld_sayhello = { "tag4", NULL }; + +test_tags tf_tags_helloworld_saygoodbye = { + "tag5", + NULL +}; |