mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-03 16:03:40 +02:00
glib/gtestutils: Introduce and use a g_test_suite_free function
This commit is contained in:
@@ -3639,6 +3639,7 @@ g_test_suite_add
|
||||
g_test_suite_add_suite
|
||||
g_test_run_suite
|
||||
g_test_case_free
|
||||
g_test_suite_free
|
||||
|
||||
<SUBSECTION Private>
|
||||
g_test_trap_assertions
|
||||
|
@@ -2216,6 +2216,7 @@ g_test_run (void)
|
||||
}
|
||||
|
||||
out:
|
||||
g_test_suite_free (suite);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -3009,6 +3010,26 @@ g_test_case_free (GTestCase *test_case)
|
||||
g_slice_free (GTestCase, test_case);
|
||||
}
|
||||
|
||||
/**
|
||||
* g_test_suite_free:
|
||||
* @suite: a #GTestSuite
|
||||
*
|
||||
* Free the @suite and all nested #GTestSuites.
|
||||
*
|
||||
* Since: 2.70
|
||||
*/
|
||||
void
|
||||
g_test_suite_free (GTestSuite *suite)
|
||||
{
|
||||
g_slist_free_full (suite->cases, (GDestroyNotify)g_test_case_free);
|
||||
|
||||
g_free (suite->name);
|
||||
|
||||
g_slist_free_full (suite->suites, (GDestroyNotify)g_test_suite_free);
|
||||
|
||||
g_slice_free (GTestSuite, suite);
|
||||
}
|
||||
|
||||
static void
|
||||
gtest_default_log_handler (const gchar *log_domain,
|
||||
GLogLevelFlags log_level,
|
||||
|
@@ -509,6 +509,9 @@ int g_test_run_suite (GTestSuite *suite);
|
||||
GLIB_AVAILABLE_IN_2_70
|
||||
void g_test_case_free (GTestCase *test_case);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_70
|
||||
void g_test_suite_free (GTestSuite *suite);
|
||||
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
void g_test_trap_assertions (const char *domain,
|
||||
const char *file,
|
||||
|
Reference in New Issue
Block a user