~ubuntu-branches/ubuntu/vivid/clutter-1.0/vivid-proposed

« back to all changes in this revision

Viewing changes to tests/conform/interval.c

  • Committer: Package Import Robot
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2014-03-26 11:51:28 UTC
  • mfrom: (1.5.1) (4.1.30 experimental)
  • Revision ID: package-import@ubuntu.com-20140326115128-timmbsde8734o6wz
Tags: 1.18.0-1
* New upstream release.
* debian/control.in:
  + Bump gtk-doc-tools build dependency.
  + Also break libcogl15.
  + Standards-Version is 3.9.5, no changes needed.
* debian/libclutter-1.0-0.symbols:
  + Drop a few symbols that were accidentally exported in the DSO because
    they had a clutter_ prefix but were not in the public headers.
  + Add one new symbol.
  + Drop unnecessary debian revisions from some symbols.
* debian/control.in,
  debian/rules,
  debian/libclutter-1.0-0.symbols:
  + Temporarily disable evdev input support. It was only enabled in 1.17.6-1
    in experimental and there is nothing using it yet, and I would like to
    wait a bit before uploading libinput to unstable as the ABI isn't stable
    yet.
* d/p/0001-wayland-Add-missing-CLUTTER_AVAILABLE-annotations.patch:
  + Add missing annotations so that a few symbols are exported in the DSO.

* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <clutter/clutter.h>
2
2
 
3
 
#include "test-conform-common.h"
4
 
 
5
 
void
6
 
interval_initial_state (TestConformSimpleFixture *fixture G_GNUC_UNUSED,
7
 
                        gconstpointer dummy G_GNUC_UNUSED)
 
3
static void
 
4
interval_initial_state (void)
8
5
{
9
6
  ClutterInterval *interval;
10
7
  int initial, final;
38
35
  g_object_unref (interval);
39
36
}
40
37
 
41
 
void
42
 
interval_transform (TestConformSimpleFixture *fixture G_GNUC_UNUSED,
43
 
                    gconstpointer dummy G_GNUC_UNUSED)
 
38
static void
 
39
interval_transform (void)
44
40
{
45
41
  ClutterInterval *interval;
46
42
  GValue value = G_VALUE_INIT;
68
64
 
69
65
  g_object_unref (interval);
70
66
}
 
67
 
 
68
static void
 
69
interval_from_script (void)
 
70
{
 
71
  ClutterScript *script = clutter_script_new ();
 
72
  ClutterInterval *interval;
 
73
  gchar *test_file;
 
74
  GError *error = NULL;
 
75
  GValue *initial, *final;
 
76
 
 
77
  test_file = g_test_build_filename (G_TEST_DIST,
 
78
                                     "scripts",
 
79
                                     "test-script-interval.json",
 
80
                                     NULL);
 
81
  clutter_script_load_from_file (script, test_file, &error);
 
82
  if (g_test_verbose () && error)
 
83
    g_printerr ("\tError: %s", error->message);
 
84
 
 
85
  g_assert_no_error (error);
 
86
 
 
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);
 
102
 
 
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));
 
108
 
 
109
  g_object_unref (script);
 
110
  g_free (test_file);
 
111
}
 
112
 
 
113
CLUTTER_TEST_SUITE (
 
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)
 
117
)