glib/tests: Drop debug build of slice test

This commit is contained in:
Natanael Copa 2022-10-05 13:49:31 +02:00 committed by Philip Withnall
parent 45b5a6c1e5
commit 7e4b8dfb82

View File

@ -4,66 +4,6 @@
/* We test deprecated functionality here */
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
#ifdef G_ENABLE_DEBUG
static void
test_slice_nodebug (void)
{
const gchar *oldval;
oldval = g_getenv ("G_SLICE");
g_unsetenv ("G_SLICE");
if (g_test_subprocess ())
{
gpointer p, q;
p = g_slice_alloc (237);
q = g_slice_alloc (259);
g_slice_free1 (237, p);
g_slice_free1 (259, q);
g_slice_debug_tree_statistics ();
return;
}
g_test_trap_subprocess (NULL, 1000000, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("*GSlice: MemChecker: root=NULL*");
if (oldval)
g_setenv ("G_SLICE", oldval, TRUE);
}
static void
test_slice_debug (void)
{
const gchar *oldval;
oldval = g_getenv ("G_SLICE");
g_setenv ("G_SLICE", "debug-blocks:always-malloc", TRUE);
if (g_test_subprocess ())
{
gpointer p, q;
p = g_slice_alloc (237);
q = g_slice_alloc (259);
g_slice_free1 (237, p);
g_slice_free1 (259, q);
g_slice_debug_tree_statistics ();
return;
}
g_test_trap_subprocess (NULL, 1000000, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("*GSlice: MemChecker: * trunks, * branches, * old branches*");
if (oldval)
g_setenv ("G_SLICE", oldval, TRUE);
else
g_unsetenv ("G_SLICE");
}
#endif
static void
test_slice_copy (void)
{
@ -155,10 +95,6 @@ main (int argc, char **argv)
{
g_test_init (&argc, &argv, NULL);
#ifdef G_ENABLE_DEBUG
g_test_add_func ("/slice/nodebug", test_slice_nodebug);
g_test_add_func ("/slice/debug", test_slice_debug);
#endif
g_test_add_func ("/slice/copy", test_slice_copy);
g_test_add_func ("/slice/chain", test_chain);
g_test_add_func ("/slice/allocate", test_allocate);