Commit 7dd7c041 authored by Philip Withnall's avatar Philip Withnall

gtestutils: Clarify that test fixtures are allocated by GLib

Make it a little clearer that the user’s fixture setup and teardown
functions don’t have to do the allocation or freeing.
parent 123bd7ae
......@@ -1511,11 +1511,11 @@ g_test_run (void)
* Create a new #GTestCase, named @test_name, this API is fairly
* low level, calling g_test_add() or g_test_add_func() is preferable.
* When this test is executed, a fixture structure of size @data_size
* will be allocated and filled with 0s. Then @data_setup is called
* to initialize the fixture. After fixture setup, the actual test
* function @data_test is called. Once the test run completed, the
* fixture structure is torn down by calling @data_teardown and
* after that the memory is released.
* 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 is used for
......@@ -3342,11 +3342,12 @@ g_test_get_filename (GTestFileType file_type,
* @fteardown: The function to tear down the fixture data.
*
* Hook up a new test case at @testpath, similar to g_test_add_func().
* A fixture data structure with setup and teardown function may be provided
* though, similar to g_test_create_case().
* A fixture data structure with setup and teardown functions may be provided,
* similar to g_test_create_case().
*
* g_test_add() is implemented as a macro, so that the fsetup(), ftest() and
* fteardown() callbacks can expect a @Fixture pointer as first argument in
* a type safe manner.
* a type safe manner. They otherwise have type #GTestFixtureFunc.
*
* Since: 2.16
**/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment