glib/gtestutils: Introduce and use a g_test_case_free function

This commit is contained in:
GOUJON Évan 2021-07-23 22:10:08 +02:00
parent 0786031804
commit f0c0d8b67c
3 changed files with 19 additions and 0 deletions

View File

@ -3638,6 +3638,7 @@ g_test_get_root
g_test_suite_add
g_test_suite_add_suite
g_test_run_suite
g_test_case_free
<SUBSECTION Private>
g_test_trap_assertions

View File

@ -2994,6 +2994,21 @@ g_test_run_suite (GTestSuite *suite)
return n_bad;
}
/**
* g_test_case_free:
* @test_case: a #GTestCase
*
* Free the @test_case.
*
* Since: 2.70
*/
void
g_test_case_free (GTestCase *test_case)
{
g_free (test_case->name);
g_slice_free (GTestCase, test_case);
}
static void
gtest_default_log_handler (const gchar *log_domain,
GLogLevelFlags log_level,

View File

@ -506,6 +506,9 @@ void g_test_suite_add_suite (GTestSuite *suite,
GLIB_AVAILABLE_IN_ALL
int g_test_run_suite (GTestSuite *suite);
GLIB_AVAILABLE_IN_2_70
void g_test_case_free (GTestCase *test_case);
GLIB_AVAILABLE_IN_ALL
void g_test_trap_assertions (const char *domain,
const char *file,