mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
conform: Add unit for properties holding objects
Exercise the definition of GObjects for properties defined using GParamSpecObject.
This commit is contained in:
parent
7279afd28c
commit
f1ed8be066
1
.gitignore
vendored
1
.gitignore
vendored
@ -222,6 +222,7 @@ TAGS
|
|||||||
/tests/conform/test-script-single
|
/tests/conform/test-script-single
|
||||||
/tests/conform/test-script-child
|
/tests/conform/test-script-child
|
||||||
/tests/conform/test-script-implicit-alpha
|
/tests/conform/test-script-implicit-alpha
|
||||||
|
/tests/conform/test-script-object-property
|
||||||
/tests/micro-bench/test-text-perf
|
/tests/micro-bench/test-text-perf
|
||||||
/tests/micro-bench/test-text
|
/tests/micro-bench/test-text
|
||||||
/tests/micro-bench/test-picking
|
/tests/micro-bench/test-picking
|
||||||
|
@ -188,6 +188,7 @@ main (int argc, char **argv)
|
|||||||
TEST_CONFORM_SIMPLE ("/script", test_script_single);
|
TEST_CONFORM_SIMPLE ("/script", test_script_single);
|
||||||
TEST_CONFORM_SIMPLE ("/script", test_script_child);
|
TEST_CONFORM_SIMPLE ("/script", test_script_child);
|
||||||
TEST_CONFORM_SIMPLE ("/script", test_script_implicit_alpha);
|
TEST_CONFORM_SIMPLE ("/script", test_script_implicit_alpha);
|
||||||
|
TEST_CONFORM_SIMPLE ("/script", test_script_object_property);
|
||||||
|
|
||||||
return g_test_run ();
|
return g_test_run ();
|
||||||
}
|
}
|
||||||
|
@ -225,3 +225,28 @@ test_script_implicit_alpha (TestConformSimpleFixture *fixture,
|
|||||||
g_object_unref (script);
|
g_object_unref (script);
|
||||||
g_free (test_file);
|
g_free (test_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
test_script_object_property (TestConformSimpleFixture *fixture,
|
||||||
|
gconstpointer dummy)
|
||||||
|
{
|
||||||
|
ClutterScript *script = clutter_script_new ();
|
||||||
|
ClutterLayoutManager *manager;
|
||||||
|
GObject *actor = NULL;
|
||||||
|
GError *error = NULL;
|
||||||
|
gchar *test_file;
|
||||||
|
|
||||||
|
test_file = clutter_test_get_data_file ("test-script-object-property.json");
|
||||||
|
clutter_script_load_from_file (script, test_file, &error);
|
||||||
|
g_assert (error == NULL);
|
||||||
|
|
||||||
|
actor = clutter_script_get_object (script, "test");
|
||||||
|
g_assert (CLUTTER_IS_BOX (actor));
|
||||||
|
|
||||||
|
manager = clutter_box_get_layout_manager (CLUTTER_BOX (actor));
|
||||||
|
g_assert (CLUTTER_IS_BIN_LAYOUT (manager));
|
||||||
|
|
||||||
|
g_object_unref (script);
|
||||||
|
clutter_actor_destroy (CLUTTER_ACTOR (actor));
|
||||||
|
g_free (test_file);
|
||||||
|
}
|
||||||
|
13
tests/data/test-script-object-property.json
Normal file
13
tests/data/test-script-object-property.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"id" : "test",
|
||||||
|
"type" : "ClutterBox",
|
||||||
|
"layout-manager" : { "id" : "layout", "type" : "ClutterBinLayout" },
|
||||||
|
"children" : [
|
||||||
|
{
|
||||||
|
"id" : "child-1",
|
||||||
|
"type" : "ClutterRectangle",
|
||||||
|
"width" : "3 em",
|
||||||
|
"height" : "3 em"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user