gtestutils: Clarify the docs for g_test_create_case()

Improve formatting, and clarify that the same *type* of test fixture can
be reused, not the same specific instance of a test fixture.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #250
This commit is contained in:
Philip Withnall 2020-07-27 02:09:37 +01:00
parent a84f241dd7
commit 07278e73d4

View File

@ -2089,8 +2089,11 @@ g_test_run (void)
* @data_test: (scope async): the actual test function * @data_test: (scope async): the actual test function
* @data_teardown: (scope async): the function to teardown the fixture data * @data_teardown: (scope async): the function to teardown the fixture data
* *
* Create a new #GTestCase, named @test_name, this API is fairly * Create a new #GTestCase, named @test_name.
* low level, calling g_test_add() or g_test_add_func() is preferable. *
* This API is fairly low level, and calling g_test_add() or g_test_add_func()
* is preferable.
*
* When this test is executed, a fixture structure of size @data_size * When this test is executed, a fixture structure of size @data_size
* will be automatically allocated and filled with zeros. Then @data_setup is * will be automatically allocated and filled with zeros. Then @data_setup is
* called to initialize the fixture. After fixture setup, the actual test * called to initialize the fixture. After fixture setup, the actual test
@ -2099,10 +2102,10 @@ g_test_run (void)
* after that the memory is automatically released by the test framework. * after that the memory is automatically released by the test framework.
* *
* Splitting up a test run into fixture setup, test function and * Splitting up a test run into fixture setup, test function and
* fixture teardown is most useful if the same fixture is used for * fixture teardown is most useful if the same fixture type is used for
* multiple tests. In this cases, g_test_create_case() will be * multiple tests. In this cases, g_test_create_case() will be
* called with the same fixture, but varying @test_name and * called with the same type of fixture (the @data_size argument), but varying
* @data_test arguments. * @test_name and @data_test arguments.
* *
* Returns: a newly allocated #GTestCase. * Returns: a newly allocated #GTestCase.
* *