From 26ec3efbff6da99bd443cd5b587a980bb7a3a75a Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 22 Feb 2011 12:53:15 +0000 Subject: [PATCH] tests: Check return value of clutter_init_with_args instead of error Some of the tests were ignoring the return value of clutter_init_with_args and instead they would recognise an error by seeing whether the GError parameter was set. This patch changes it to check the return value so that it won't give a warning now that G_GNUC_WARN_UNUSED_RESULT is on that function. http://bugzilla.clutter-project.org/show_bug.cgi?id=2574 --- tests/interactive/test-actor-clone.c | 11 +++++------ tests/interactive/test-actors.c | 11 +++++------ tests/interactive/test-drag.c | 11 +++++------ tests/interactive/test-flow-layout.c | 11 +++++------ tests/interactive/test-paint-wrapper.c | 11 +++++------ tests/micro-bench/test-cogl-perf.c | 11 +++++------ 6 files changed, 30 insertions(+), 36 deletions(-) diff --git a/tests/interactive/test-actor-clone.c b/tests/interactive/test-actor-clone.c index f9ea64a00..6e191a954 100644 --- a/tests/interactive/test-actor-clone.c +++ b/tests/interactive/test-actor-clone.c @@ -143,12 +143,11 @@ test_actor_clone_main (int argc, char *argv[]) error = NULL; - clutter_init_with_args (&argc, &argv, - NULL, - super_oh_entries, - NULL, - &error); - if (error) + if (clutter_init_with_args (&argc, &argv, + NULL, + super_oh_entries, + NULL, + &error) != CLUTTER_INIT_SUCCESS) { g_warning ("Unable to initialise Clutter:\n%s", error->message); diff --git a/tests/interactive/test-actors.c b/tests/interactive/test-actors.c index f742c729e..3143494c0 100644 --- a/tests/interactive/test-actors.c +++ b/tests/interactive/test-actors.c @@ -167,12 +167,11 @@ test_actors_main (int argc, char *argv[]) error = NULL; - clutter_init_with_args (&argc, &argv, - NULL, - super_oh_entries, - NULL, - &error); - if (error) + if (clutter_init_with_args (&argc, &argv, + NULL, + super_oh_entries, + NULL, + &error) != CLUTTER_INIT_SUCCESS) { g_warning ("Unable to initialise Clutter:\n%s", error->message); diff --git a/tests/interactive/test-drag.c b/tests/interactive/test-drag.c index 0af149bc0..05bc5cdb0 100644 --- a/tests/interactive/test-drag.c +++ b/tests/interactive/test-drag.c @@ -156,12 +156,11 @@ test_drag_main (int argc, char *argv[]) GError *error; error = NULL; - clutter_init_with_args (&argc, &argv, - "test-drag", - entries, - NULL, - &error); - if (error != NULL) + if (clutter_init_with_args (&argc, &argv, + "test-drag", + entries, + NULL, + &error) != CLUTTER_INIT_SUCCESS) { g_print ("Unable to run test-drag: %s\n", error->message); g_error_free (error); diff --git a/tests/interactive/test-flow-layout.c b/tests/interactive/test-flow-layout.c index 9f323080c..e0d602485 100644 --- a/tests/interactive/test-flow-layout.c +++ b/tests/interactive/test-flow-layout.c @@ -78,12 +78,11 @@ test_flow_layout_main (int argc, char *argv[]) gint i; error = NULL; - clutter_init_with_args (&argc, &argv, - NULL, - entries, - NULL, - &error); - if (error) + if (clutter_init_with_args (&argc, &argv, + NULL, + entries, + NULL, + &error) != CLUTTER_INIT_SUCCESS) { g_print ("Unable to run test-flow: %s", error->message); g_error_free (error); diff --git a/tests/interactive/test-paint-wrapper.c b/tests/interactive/test-paint-wrapper.c index 45a52efb9..bbc8fa490 100644 --- a/tests/interactive/test-paint-wrapper.c +++ b/tests/interactive/test-paint-wrapper.c @@ -205,12 +205,11 @@ test_paint_wrapper_main (int argc, char *argv[]) clutter_x11_set_use_argb_visual (TRUE); #endif - clutter_init_with_args (&argc, &argv, - NULL, - super_oh_entries, - NULL, - &error); - if (error) + if (clutter_init_with_args (&argc, &argv, + NULL, + super_oh_entries, + NULL, + &error) != CLUTTER_INIT_SUCCESS) { g_warning ("Unable to initialise Clutter:\n%s", error->message); diff --git a/tests/micro-bench/test-cogl-perf.c b/tests/micro-bench/test-cogl-perf.c index b467f3719..0f97a95df 100644 --- a/tests/micro-bench/test-cogl-perf.c +++ b/tests/micro-bench/test-cogl-perf.c @@ -124,12 +124,11 @@ main (int argc, char *argv[]) g_setenv ("CLUTTER_VBLANK", "none", FALSE); g_setenv ("CLUTTER_SHOW_FPS", "1", FALSE); - clutter_init_with_args (&argc, &argv, - NULL, - entries, - NULL, - &error); - if (error) + if (clutter_init_with_args (&argc, &argv, + NULL, + entries, + NULL, + &error) != CLUTTER_INIT_SUCCESS) { g_warning ("Unable to initialise Clutter:\n%s", error->message);