Microchip® Advanced Software Framework

test_case Struct Reference

A test case.

This structure represents a test case which tests one specific feature or behavior.

#include <suite.h>

Data Fields

void(* cleanup )(const struct test_case *test)
 Clean up the environment after test has been run. More...
 
const char * name
 The name of the test case. More...
 
void(* run )(const struct test_case *test)
 Run the test. More...
 
void(* setup )(const struct test_case *test)
 Set up the environment in which test is to be run. More...
 

void(* test_case::cleanup)(const struct test_case *test)

Clean up the environment after test has been run.

This may free up any memory allocated by setup(), gracefully shutting down hardware, etc. If something goes wrong, this function may call test_fail(), normally with a negative status code.

Referenced by test_case_run().

const char* test_case::name

The name of the test case.

Referenced by test_case_fail(), test_case_run(), and test_report_failure().

void(* test_case::run)(const struct test_case *test)

Run the test.

Referenced by test_case_run().

void(* test_case::setup)(const struct test_case *test)

Set up the environment in which test is to be run.

This may involve allocating memory, initializing hardware, etc. If something goes wrong, this function may call test_fail(), normally with a negative status code.

Referenced by test_case_run().