[ CCode ( cname = "g_test_create_case" ) ]
public TestCase (string test_name, TestFixtureFunc data_setup, TestFixtureFunc data_func, TestFixtureFunc data_teardown, size_t data_size = 0)
Create a new TestCase, named
This API is fairly low level, and calling add or add_func is preferable.
When this test is executed, a fixture structure of size
data_size will be automatically allocated and filled with zeros. Then
data_setup is called to initialize the fixture. After fixture setup, the actual test function
data_test is called.
Once the test run completes, the fixture structure is torn down by calling
data_teardown and after that the memory is automatically
released by the test framework.
Splitting up a test run into fixture setup, test function and fixture teardown is most useful if the same fixture type is used for multiple
tests. In this cases, TestCase will be called with the same type of fixture (the
argument), but varying
the name for the test case
the function to set up the fixture data
the function to teardown the fixture data
the size of the fixture data structure
the actual test function
test data argument for the test functions
a newly allocated TestCase.