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
This commit is contained in:
parent
3d34d9fea1
commit
26ec3efbff
@ -143,12 +143,11 @@ test_actor_clone_main (int argc, char *argv[])
|
|||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
|
|
||||||
clutter_init_with_args (&argc, &argv,
|
if (clutter_init_with_args (&argc, &argv,
|
||||||
NULL,
|
NULL,
|
||||||
super_oh_entries,
|
super_oh_entries,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error) != CLUTTER_INIT_SUCCESS)
|
||||||
if (error)
|
|
||||||
{
|
{
|
||||||
g_warning ("Unable to initialise Clutter:\n%s",
|
g_warning ("Unable to initialise Clutter:\n%s",
|
||||||
error->message);
|
error->message);
|
||||||
|
@ -167,12 +167,11 @@ test_actors_main (int argc, char *argv[])
|
|||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
|
|
||||||
clutter_init_with_args (&argc, &argv,
|
if (clutter_init_with_args (&argc, &argv,
|
||||||
NULL,
|
NULL,
|
||||||
super_oh_entries,
|
super_oh_entries,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error) != CLUTTER_INIT_SUCCESS)
|
||||||
if (error)
|
|
||||||
{
|
{
|
||||||
g_warning ("Unable to initialise Clutter:\n%s",
|
g_warning ("Unable to initialise Clutter:\n%s",
|
||||||
error->message);
|
error->message);
|
||||||
|
@ -156,12 +156,11 @@ test_drag_main (int argc, char *argv[])
|
|||||||
GError *error;
|
GError *error;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
clutter_init_with_args (&argc, &argv,
|
if (clutter_init_with_args (&argc, &argv,
|
||||||
"test-drag",
|
"test-drag",
|
||||||
entries,
|
entries,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error) != CLUTTER_INIT_SUCCESS)
|
||||||
if (error != NULL)
|
|
||||||
{
|
{
|
||||||
g_print ("Unable to run test-drag: %s\n", error->message);
|
g_print ("Unable to run test-drag: %s\n", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
@ -78,12 +78,11 @@ test_flow_layout_main (int argc, char *argv[])
|
|||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
clutter_init_with_args (&argc, &argv,
|
if (clutter_init_with_args (&argc, &argv,
|
||||||
NULL,
|
NULL,
|
||||||
entries,
|
entries,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error) != CLUTTER_INIT_SUCCESS)
|
||||||
if (error)
|
|
||||||
{
|
{
|
||||||
g_print ("Unable to run test-flow: %s", error->message);
|
g_print ("Unable to run test-flow: %s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
@ -205,12 +205,11 @@ test_paint_wrapper_main (int argc, char *argv[])
|
|||||||
clutter_x11_set_use_argb_visual (TRUE);
|
clutter_x11_set_use_argb_visual (TRUE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
clutter_init_with_args (&argc, &argv,
|
if (clutter_init_with_args (&argc, &argv,
|
||||||
NULL,
|
NULL,
|
||||||
super_oh_entries,
|
super_oh_entries,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error) != CLUTTER_INIT_SUCCESS)
|
||||||
if (error)
|
|
||||||
{
|
{
|
||||||
g_warning ("Unable to initialise Clutter:\n%s",
|
g_warning ("Unable to initialise Clutter:\n%s",
|
||||||
error->message);
|
error->message);
|
||||||
|
@ -124,12 +124,11 @@ main (int argc, char *argv[])
|
|||||||
g_setenv ("CLUTTER_VBLANK", "none", FALSE);
|
g_setenv ("CLUTTER_VBLANK", "none", FALSE);
|
||||||
g_setenv ("CLUTTER_SHOW_FPS", "1", FALSE);
|
g_setenv ("CLUTTER_SHOW_FPS", "1", FALSE);
|
||||||
|
|
||||||
clutter_init_with_args (&argc, &argv,
|
if (clutter_init_with_args (&argc, &argv,
|
||||||
NULL,
|
NULL,
|
||||||
entries,
|
entries,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error) != CLUTTER_INIT_SUCCESS)
|
||||||
if (error)
|
|
||||||
{
|
{
|
||||||
g_warning ("Unable to initialise Clutter:\n%s",
|
g_warning ("Unable to initialise Clutter:\n%s",
|
||||||
error->message);
|
error->message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user