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

« back to all changes in this revision

Viewing changes to tests/conform/model.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:
2
2
#include <string.h>
3
3
#include <clutter/clutter.h>
4
4
 
5
 
#include "test-conform-common.h"
6
 
 
7
5
typedef struct _ModelData
8
6
{
9
7
  ClutterModel *model;
171
169
  return FALSE;
172
170
}
173
171
 
174
 
void
175
 
list_model_filter (TestConformSimpleFixture *fixture,
176
 
                   gconstpointer             data)
 
172
static void
 
173
list_model_filter (void)
177
174
{
178
175
  ModelData test_data = { NULL, 0 };
179
176
  ClutterModelIter *iter;
259
256
  g_object_unref (test_data.model);
260
257
}
261
258
 
262
 
void
263
 
list_model_iterate (TestConformSimpleFixture *fixture,
264
 
                    gconstpointer             data)
 
259
static void
 
260
list_model_iterate (void)
265
261
{
266
262
  ModelData test_data = { NULL, 0 };
267
263
  ClutterModelIter *iter;
334
330
  g_object_unref (test_data.model);
335
331
}
336
332
 
337
 
void
338
 
list_model_populate (TestConformSimpleFixture *fixture,
339
 
                     gconstpointer             data)
 
333
static void
 
334
list_model_populate (void)
340
335
{
341
336
  ModelData test_data = { NULL, 0 };
342
337
  gint i;
365
360
  g_object_unref (test_data.model);
366
361
}
367
362
 
368
 
void
369
 
list_model_from_script (TestConformSimpleFixture *fixture,
370
 
                        gconstpointer dummy)
 
363
static void
 
364
list_model_from_script (void)
371
365
{
372
366
  ClutterScript *script = clutter_script_new ();
373
367
  GObject *model;
378
372
  ClutterModelIter *iter;
379
373
  GValue value = { 0, };
380
374
 
381
 
  test_file = clutter_test_get_data_file ("test-script-model.json");
 
375
  test_file = g_test_build_filename (G_TEST_DIST, "scripts", "test-script-model.json", NULL);
382
376
  clutter_script_load_from_file (script, test_file, &error);
383
377
  if (g_test_verbose () && error)
384
378
    g_print ("Error: %s", error->message);
406
400
    g_print ("column[2]: %s, type: %s\n", name, g_type_name (type));
407
401
 
408
402
  g_assert (strcmp (name, "actor-column") == 0);
409
 
  g_assert (type == CLUTTER_TYPE_RECTANGLE);
 
403
  g_assert (g_type_is_a (type, CLUTTER_TYPE_ACTOR));
410
404
 
411
405
  g_assert (clutter_model_get_n_rows (CLUTTER_MODEL (model)) == 3);
412
406
 
429
423
  iter = clutter_model_iter_next (iter);
430
424
  clutter_model_iter_get_value (iter, 2, &value);
431
425
  g_assert (G_VALUE_HOLDS_OBJECT (&value));
432
 
  g_assert (CLUTTER_IS_RECTANGLE (g_value_get_object (&value)));
 
426
  g_assert (CLUTTER_IS_ACTOR (g_value_get_object (&value)));
433
427
  g_value_unset (&value);
434
428
 
435
429
  iter = clutter_model_iter_next (iter);
436
430
  clutter_model_iter_get_value (iter, 2, &value);
437
431
  g_assert (G_VALUE_HOLDS_OBJECT (&value));
438
 
  g_assert (CLUTTER_IS_RECTANGLE (g_value_get_object (&value)));
 
432
  g_assert (CLUTTER_IS_ACTOR (g_value_get_object (&value)));
439
433
  g_assert (strcmp (clutter_actor_get_name (g_value_get_object (&value)),
440
434
                    "actor-row-3") == 0);
441
435
  g_value_unset (&value);
460
454
  data->n_emissions += 1;
461
455
}
462
456
 
463
 
void
464
 
list_model_row_changed (TestConformSimpleFixture *fixture,
465
 
                        gconstpointer             data)
 
457
static void
 
458
list_model_row_changed (void)
466
459
{
467
460
  ChangedData test_data = { NULL, NULL, 0, 0 };
468
461
  GValue value = { 0, };
524
517
  g_object_unref (test_data.iter);
525
518
  g_object_unref (test_data.model);
526
519
}
 
520
 
 
521
CLUTTER_TEST_SUITE (
 
522
  CLUTTER_TEST_UNIT ("/list-model/populate", list_model_populate)
 
523
  CLUTTER_TEST_UNIT ("/list-model/iterate", list_model_iterate)
 
524
  CLUTTER_TEST_UNIT ("/list-model/filter", list_model_filter)
 
525
  CLUTTER_TEST_UNIT ("/list-model/row-changed", list_model_row_changed)
 
526
  CLUTTER_TEST_UNIT ("/list-model/from-script", list_model_from_script)
 
527
)