1
1
#include <clutter/clutter.h>
3
#include "test-conform-common.h"
6
interval_initial_state (TestConformSimpleFixture *fixture G_GNUC_UNUSED,
7
gconstpointer dummy G_GNUC_UNUSED)
4
interval_initial_state (void)
9
6
ClutterInterval *interval;
38
35
g_object_unref (interval);
42
interval_transform (TestConformSimpleFixture *fixture G_GNUC_UNUSED,
43
gconstpointer dummy G_GNUC_UNUSED)
39
interval_transform (void)
45
41
ClutterInterval *interval;
46
42
GValue value = G_VALUE_INIT;
69
65
g_object_unref (interval);
69
interval_from_script (void)
71
ClutterScript *script = clutter_script_new ();
72
ClutterInterval *interval;
75
GValue *initial, *final;
77
test_file = g_test_build_filename (G_TEST_DIST,
79
"test-script-interval.json",
81
clutter_script_load_from_file (script, test_file, &error);
82
if (g_test_verbose () && error)
83
g_printerr ("\tError: %s", error->message);
85
g_assert_no_error (error);
87
interval = CLUTTER_INTERVAL (clutter_script_get_object (script, "int-1"));
88
initial = clutter_interval_peek_initial_value (interval);
89
if (g_test_verbose ())
90
g_test_message ("\tinitial ['%s'] = '%.2f'",
91
g_type_name (G_VALUE_TYPE (initial)),
92
g_value_get_float (initial));
93
g_assert (G_VALUE_HOLDS (initial, G_TYPE_FLOAT));
94
g_assert_cmpfloat (g_value_get_float (initial), ==, 23.3f);
95
final = clutter_interval_peek_final_value (interval);
96
if (g_test_verbose ())
97
g_test_message ("\tfinal ['%s'] = '%.2f'",
98
g_type_name (G_VALUE_TYPE (final)),
99
g_value_get_float (final));
100
g_assert (G_VALUE_HOLDS (final, G_TYPE_FLOAT));
101
g_assert_cmpfloat (g_value_get_float (final), ==, 42.2f);
103
interval = CLUTTER_INTERVAL (clutter_script_get_object (script, "int-2"));
104
initial = clutter_interval_peek_initial_value (interval);
105
g_assert (G_VALUE_HOLDS (initial, CLUTTER_TYPE_COLOR));
106
final = clutter_interval_peek_final_value (interval);
107
g_assert (G_VALUE_HOLDS (final, CLUTTER_TYPE_COLOR));
109
g_object_unref (script);
114
CLUTTER_TEST_UNIT ("/interval/initial-state", interval_initial_state)
115
CLUTTER_TEST_UNIT ("/interval/transform", interval_transform)
116
CLUTTER_TEST_UNIT ("/interval/from-script", interval_from_script)