mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 04:22:05 +00:00
test-animator: Do not use mid-function blocks
The test_animator_properties unit is so small that declaring a mid-function block for two variables is not that clever.
This commit is contained in:
parent
4d9327bbe1
commit
a139bf9c40
@ -11,6 +11,8 @@ test_animator_properties (TestConformSimpleFixture *fixture,
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
gchar *test_file;
|
gchar *test_file;
|
||||||
GList *keys;
|
GList *keys;
|
||||||
|
ClutterAnimatorKey *key;
|
||||||
|
GValue value = { 0, };
|
||||||
|
|
||||||
test_file = clutter_test_get_data_file ("test-animator-2.json");
|
test_file = clutter_test_get_data_file ("test-animator-2.json");
|
||||||
clutter_script_load_from_file (script, test_file, &error);
|
clutter_script_load_from_file (script, test_file, &error);
|
||||||
@ -26,10 +28,7 @@ test_animator_properties (TestConformSimpleFixture *fixture,
|
|||||||
NULL, NULL, -1.0);
|
NULL, NULL, -1.0);
|
||||||
g_assert_cmpint (g_list_length (keys), ==, 3);
|
g_assert_cmpint (g_list_length (keys), ==, 3);
|
||||||
|
|
||||||
{
|
key = g_list_nth_data (keys, 1);
|
||||||
const ClutterAnimatorKey *key = g_list_nth_data (keys, 1);
|
|
||||||
GValue value = { 0, };
|
|
||||||
|
|
||||||
g_assert (key != NULL);
|
g_assert (key != NULL);
|
||||||
|
|
||||||
if (g_test_verbose ())
|
if (g_test_verbose ())
|
||||||
@ -54,7 +53,7 @@ test_animator_properties (TestConformSimpleFixture *fixture,
|
|||||||
g_value_init (&value, G_TYPE_FLOAT);
|
g_value_init (&value, G_TYPE_FLOAT);
|
||||||
g_assert (clutter_animator_key_get_value (key, &value));
|
g_assert (clutter_animator_key_get_value (key, &value));
|
||||||
g_assert_cmpfloat (g_value_get_float (&value), ==, 150.0);
|
g_assert_cmpfloat (g_value_get_float (&value), ==, 150.0);
|
||||||
}
|
g_value_unset (&value);
|
||||||
|
|
||||||
g_list_free (keys);
|
g_list_free (keys);
|
||||||
g_object_unref (script);
|
g_object_unref (script);
|
||||||
|
Loading…
Reference in New Issue
Block a user