From 95b55588ad6c57cbeb7cda50886e709aa1ae1c00 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 13 Nov 2009 14:07:25 +0000 Subject: [PATCH] tests: Print out parser errors if present If the conformance test for the Script parser throws an error and we've enabled verbosity then we should print out the error message before aborting. --- tests/conform/test-script-parser.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/conform/test-script-parser.c b/tests/conform/test-script-parser.c index 6ea0a1b5a..7fe5ae0a2 100644 --- a/tests/conform/test-script-parser.c +++ b/tests/conform/test-script-parser.c @@ -127,8 +127,8 @@ test_script_child (TestConformSimpleFixture *fixture, test_file = clutter_test_get_data_file ("test-script-child.json"); clutter_script_load_from_file (script, test_file, &error); - if (g_test_verbose () && (error != NULL)) - g_warning ("Unable to load '%s': %s", test_file, error->message); + if (g_test_verbose () && error) + g_print ("Error: %s", error->message); g_assert (error == NULL); container = actor = NULL; @@ -174,6 +174,8 @@ test_script_single (TestConformSimpleFixture *fixture, test_file = clutter_test_get_data_file ("test-script-single.json"); clutter_script_load_from_file (script, test_file, &error); + if (g_test_verbose () && error) + g_print ("Error: %s", error->message); g_assert (error == NULL); actor = clutter_script_get_object (script, "test"); @@ -207,6 +209,8 @@ test_script_implicit_alpha (TestConformSimpleFixture *fixture, test_file = clutter_test_get_data_file ("test-script-implicit-alpha.json"); clutter_script_load_from_file (script, test_file, &error); + if (g_test_verbose () && error) + g_print ("Error: %s", error->message); g_assert (error == NULL); behaviour = clutter_script_get_object (script, "test"); @@ -238,6 +242,8 @@ test_script_object_property (TestConformSimpleFixture *fixture, test_file = clutter_test_get_data_file ("test-script-object-property.json"); clutter_script_load_from_file (script, test_file, &error); + if (g_test_verbose () && error) + g_print ("Error: %s", error->message); g_assert (error == NULL); actor = clutter_script_get_object (script, "test");