From 7dd7c04148dac716ce2eb7df72056d739efa3c30 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 16 Jan 2015 09:10:46 +0000 Subject: [PATCH] gtestutils: Clarify that test fixtures are allocated by GLib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make it a little clearer that the user’s fixture setup and teardown functions don’t have to do the allocation or freeing. --- glib/gtestutils.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/glib/gtestutils.c b/glib/gtestutils.c index ada924be6..056afbd0d 100644 --- a/glib/gtestutils.c +++ b/glib/gtestutils.c @@ -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 **/