336
336
g_object_unref (test_data.model);
340
test_list_model_from_script (TestConformSimpleFixture *fixture,
343
ClutterScript *script = clutter_script_new ();
345
GError *error = NULL;
350
test_file = clutter_test_get_data_file ("test-script-model.json");
351
clutter_script_load_from_file (script, test_file, &error);
352
if (g_test_verbose () && error)
353
g_print ("Error: %s", error->message);
355
#if GLIB_CHECK_VERSION (2, 20, 0)
356
g_assert_no_error (error);
358
g_assert (error == NULL);
359
#endif /* GLIB_CHECK_VERSION (2, 20, 0) */
361
model = clutter_script_get_object (script, "test-model");
363
g_assert (CLUTTER_IS_MODEL (model));
364
g_assert (clutter_model_get_n_columns (CLUTTER_MODEL (model)) == 3);
366
name = clutter_model_get_column_name (CLUTTER_MODEL (model), 0);
367
type = clutter_model_get_column_type (CLUTTER_MODEL (model), 0);
369
if (g_test_verbose ())
370
g_print ("column[0]: %s, type: %s\n", name, g_type_name (type));
372
g_assert (strcmp (name, "text-column") == 0);
373
g_assert (type == G_TYPE_STRING);
375
name = clutter_model_get_column_name (CLUTTER_MODEL (model), 2);
376
type = clutter_model_get_column_type (CLUTTER_MODEL (model), 2);
378
if (g_test_verbose ())
379
g_print ("column[2]: %s, type: %s\n", name, g_type_name (type));
381
g_assert (strcmp (name, "actor-column") == 0);
382
g_assert (type == CLUTTER_TYPE_RECTANGLE);