mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-10 12:38:54 +02:00
tests: Fix two small leaks in the actions test
These are known leaks, as they were being done in tests which were checking precondition failures. However, since we know what happens when the failures occur, we can still free the input data reliably, so do that. This improves the valgrind output for `actions` to show zero definite leaks. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
@ -275,10 +275,12 @@ test_stateful (void)
|
||||
|
||||
if (g_test_undefined ())
|
||||
{
|
||||
GVariant *new_state = g_variant_ref_sink (g_variant_new_int32 (123));
|
||||
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
|
||||
"*assertion*g_variant_is_of_type*failed*");
|
||||
g_simple_action_set_state (action, g_variant_new_int32 (123));
|
||||
g_simple_action_set_state (action, new_state);
|
||||
g_test_assert_expected_messages ();
|
||||
g_variant_unref (new_state);
|
||||
}
|
||||
|
||||
g_simple_action_set_state (action, g_variant_new_string ("hello"));
|
||||
@ -292,10 +294,12 @@ test_stateful (void)
|
||||
|
||||
if (g_test_undefined ())
|
||||
{
|
||||
GVariant *new_state = g_variant_ref_sink (g_variant_new_int32 (123));
|
||||
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
|
||||
"*assertion*!= NULL*failed*");
|
||||
g_simple_action_set_state (action, g_variant_new_int32 (123));
|
||||
g_simple_action_set_state (action, new_state);
|
||||
g_test_assert_expected_messages ();
|
||||
g_variant_unref (new_state);
|
||||
}
|
||||
|
||||
g_object_unref (action);
|
||||
|
Reference in New Issue
Block a user