tests: abort if clutter_init fails
authornobled <nobled@dreamwidth.org>
Tue, 22 Feb 2011 00:19:35 +0000 (00:19 +0000)
committerNeil Roberts <neil@linux.intel.com>
Mon, 28 Feb 2011 14:10:04 +0000 (14:10 +0000)
This fixes segfaults when something goes wrong during
init, but the test keeps going anyway.

Except for test-easing and test-picking, these were fixed by
sed magic:

sed -i -s -e "s/clutter_init \?(&argc, &argv)/\
if (clutter_init (\&argc, \&argv) != CLUTTER_INIT_SUCCESS)\n\
    return 1/" tests/*/*.c

http://bugzilla.clutter-project.org/show_bug.cgi?id=2574

61 files changed:
tests/accessibility/cally-atkcomponent-example.c
tests/accessibility/cally-atkeditabletext-example.c
tests/accessibility/cally-atkevents-example.c
tests/accessibility/cally-atktext-example.c
tests/accessibility/cally-clone-example.c
tests/interactive/test-animation.c
tests/interactive/test-animator.c
tests/interactive/test-behave.c
tests/interactive/test-bin-layout.c
tests/interactive/test-binding-pool.c
tests/interactive/test-box-layout.c
tests/interactive/test-cairo-flowers.c
tests/interactive/test-clip.c
tests/interactive/test-cogl-multitexture.c
tests/interactive/test-cogl-offscreen.c
tests/interactive/test-cogl-point-sprites.c
tests/interactive/test-cogl-primitives.c
tests/interactive/test-cogl-shader-arbfp.c
tests/interactive/test-cogl-shader-glsl.c
tests/interactive/test-cogl-tex-convert.c
tests/interactive/test-cogl-tex-foreign.c
tests/interactive/test-cogl-tex-getset.c
tests/interactive/test-cogl-tex-polygon.c
tests/interactive/test-cogl-tex-tile.c
tests/interactive/test-cogl-vertex-buffer.c
tests/interactive/test-constraints.c
tests/interactive/test-depth.c
tests/interactive/test-devices.c
tests/interactive/test-easing.c
tests/interactive/test-events.c
tests/interactive/test-fbo.c
tests/interactive/test-fullscreen.c
tests/interactive/test-grab.c
tests/interactive/test-layout.c
tests/interactive/test-model.c
tests/interactive/test-multistage.c
tests/interactive/test-path-constraint.c
tests/interactive/test-pixmap.c
tests/interactive/test-scale.c
tests/interactive/test-script.c
tests/interactive/test-scrolling.c
tests/interactive/test-shader-effects.c
tests/interactive/test-shader.c
tests/interactive/test-snap-constraint.c
tests/interactive/test-stage-read-pixels.c
tests/interactive/test-stage-sizing.c
tests/interactive/test-state-animator.c
tests/interactive/test-state.c
tests/interactive/test-table-layout.c
tests/interactive/test-text-field.c
tests/interactive/test-text.c
tests/interactive/test-texture-async.c
tests/interactive/test-texture-material.c
tests/interactive/test-texture-quality.c
tests/interactive/test-textures.c
tests/interactive/test-threads.c
tests/interactive/test-unproject.c
tests/micro-bench/test-picking.c
tests/micro-bench/test-random-text.c
tests/micro-bench/test-text-perf.c
tests/micro-bench/test-text.c

index c50a1ab..6698d97 100644 (file)
@@ -47,7 +47,8 @@ main (int argc, char *argv[])
   ClutterGeometry geom = {0, 0, SIZE, SIZE};
   gint i = 0;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   cally_util_a11y_init (&argc, &argv);
 
index 93ccc7b..4546302 100644 (file)
@@ -251,7 +251,8 @@ main (int argc, char *argv[])
 
   g_set_application_name ("AtkEditableText");
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   cally_util_a11y_init (&argc, &argv);
 
index 422e55a..fabfc6f 100644 (file)
@@ -141,7 +141,8 @@ main (int argc, char *argv[])
 
   g_set_application_name ("AtkText");
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   cally_util_a11y_init (&argc, &argv);
 
index c456ec1..0543ed8 100644 (file)
@@ -193,7 +193,8 @@ main (int argc, char *argv[])
 
   g_set_application_name ("AtkText");
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   cally_util_a11y_init (&argc, &argv);
 
index efb62fa..72d3b06 100644 (file)
@@ -97,7 +97,8 @@ main (int argc, char *argv[])
 
   g_set_application_name ("Clone Example");
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   cally_util_a11y_init (&argc, &argv);
 
index 7a83efd..85b7213 100644 (file)
@@ -88,7 +88,8 @@ test_animation_main (int argc, char *argv[])
   ClutterColor rect_color = { 0x44, 0xdd, 0x44, 0xff };
   ClutterAction *action;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
index 7ece869..d158655 100644 (file)
@@ -52,7 +52,8 @@ test_animator_main (gint    argc,
   ClutterActor *stage;
   ClutterActor *rects[COUNT];
   gint i;
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
 
index a37cd5b..0ec4e1e 100644 (file)
@@ -100,7 +100,8 @@ test_behave_main (int argc, char *argv[])
        }
     }
   
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Behaviours");
index 2f68b83..bc461ba 100644 (file)
@@ -136,7 +136,8 @@ test_bin_layout_main (int argc, char *argv[])
   ClutterColor *color;
   ClutterAction *action;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Box test");
index b683ae8..b73b18c 100644 (file)
@@ -247,7 +247,8 @@ test_binding_pool_main (int argc, char *argv[])
   ClutterActor *stage, *key_group;
   gint group_x, group_y;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   g_signal_connect (stage,
index f44544d..5e46b28 100644 (file)
@@ -239,7 +239,8 @@ test_box_layout_main (int argc, char *argv[])
   ClutterLayoutManager *layout;
   gint i;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Box Layout");
index 540805f..32eb650 100644 (file)
@@ -179,7 +179,8 @@ test_cairo_flowers_main (int argc, char **argv)
 
   srand (time (NULL));
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
 
index 95ede02..b2f2a8a 100644 (file)
@@ -319,7 +319,8 @@ test_clip_main (int argc, char **argv)
   ClutterActor *stub_actor, *label;
   gchar *file;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   data.current_clip.type = CLIP_NONE;
   data.clips = NULL;
index fb6cee8..1e23b09 100644 (file)
@@ -112,7 +112,8 @@ test_cogl_multitexture_main (int argc, char *argv[])
          0,   0,   1,   1
     };
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   clutter_actor_get_geometry (stage, &geom);
index 76338a7..e6a1bb7 100644 (file)
@@ -298,7 +298,8 @@ test_cogl_offscreen_main (int argc, char *argv[])
   ClutterActor     *stage;
   ClutterActor     *coglbox;
 
-  clutter_init(&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   /* Stage */
   stage = clutter_stage_get_default ();
index 67dd066..c457aa3 100644 (file)
@@ -226,7 +226,8 @@ test_cogl_point_sprites_main (int argc, char *argv[])
   GError *error = NULL;
   int i;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   data.material = cogl_material_new ();
   data.last_spark_time = g_timer_new ();
index e9ecf98..9069fc2 100644 (file)
@@ -107,7 +107,8 @@ test_cogl_primitives_main (int argc, char *argv[])
   ClutterActor *coglbox;
   ClutterTimeline *tl;
 
-  clutter_init(&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   tl = clutter_timeline_new (G_N_ELEMENTS (paint_func) * 1000);
   clutter_timeline_set_loop (tl, TRUE);
index 7399f25..62dbc70 100644 (file)
@@ -364,7 +364,8 @@ test_cogl_shader_arbfp_main (int argc, char *argv[])
   GError *error;
   ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff };
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_new ();
 
index 21ebe31..0cc00e8 100644 (file)
@@ -319,7 +319,8 @@ test_cogl_shader_glsl_main (int argc, char *argv[])
   GError *error;
   ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff };
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_new ();
 
index fe6ad79..f1e8016 100644 (file)
@@ -198,7 +198,8 @@ test_cogl_tex_convert_main (int argc, char *argv[])
   ClutterActor     *stage;
   ClutterActor     *coglbox;
   
-  clutter_init(&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
   
   /* Stage */
   stage = clutter_stage_get_default ();
index 3f059b9..f282635 100644 (file)
@@ -195,7 +195,8 @@ test_cogl_tex_foreign_main (int argc, char *argv[])
   ClutterActor     *stage;
   ClutterActor     *coglbox;
   
-  clutter_init(&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
   
   /* Stage */
   stage = clutter_stage_get_default ();
index 20cf081..a9d01eb 100644 (file)
@@ -245,7 +245,8 @@ test_cogl_tex_getset_main (int argc, char *argv[])
   ClutterActor     *stage;
   ClutterActor     *coglbox;
   
-  clutter_init(&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
   
   /* Stage */
   stage = clutter_stage_get_default ();
index 05c8b8b..00e881a 100644 (file)
@@ -361,7 +361,8 @@ test_cogl_tex_polygon_main (int argc, char *argv[])
   ClutterTimeline  *timeline;
   ClutterColor      blue = { 0x30, 0x30, 0xff, 0xff };
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   /* Stage */
   stage = clutter_stage_get_default ();
index 37eb864..7682831 100644 (file)
@@ -186,7 +186,8 @@ test_cogl_tex_tile_main (int argc, char *argv[])
   ClutterActor     *coglbox;
   ClutterTimeline  *timeline;
 
-  clutter_init(&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   /* Stage */
   stage = clutter_stage_get_default ();
index c1fa1b5..606c5be 100644 (file)
@@ -333,7 +333,8 @@ test_cogl_vertex_buffer_main (int argc, char *argv[])
   ClutterGeometry stage_geom;
   gint            dummy_width, dummy_height;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
 
index 9ebbea4..4474784 100644 (file)
@@ -117,7 +117,8 @@ test_constraints_main (int argc, char *argv[])
   ClutterColor rect_color;
   gint i;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_new ();
   g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
index ca386bd..0f2ed76 100644 (file)
@@ -118,7 +118,8 @@ test_depth_main (int argc, char *argv[])
   ClutterActor     *group, *hand, *label, *rect, *janus, *box;
   GError           *error;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Depth Test");
index fe060db..1d252dc 100644 (file)
@@ -221,7 +221,8 @@ test_devices_main (int argc, char **argv)
   /* force enabling X11 support */
   clutter_x11_enable_xinput ();
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   app = g_new0 (TestDevicesApp, 1);
   app->devices = g_hash_table_new (g_direct_hash, g_direct_equal) ;
index 396d636..09b934f 100644 (file)
@@ -203,12 +203,14 @@ test_easing_main (int argc, char *argv[])
   gchar *text;
   gfloat stage_width, stage_height;
   gfloat label_width, label_height;
-
-  clutter_init_with_args (&argc, &argv,
-                          NULL,
-                          test_easing_entries,
-                          NULL,
-                          NULL);
+  GError *error = NULL;
+
+  if (clutter_init_with_args (&argc, &argv,
+                              NULL,
+                              test_easing_entries,
+                              NULL,
+                              &error) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
index 3781c0d..0213c71 100644 (file)
@@ -268,7 +268,8 @@ test_events_main (int argc, char *argv[])
                  ncol = { 0,    0,    0,    0xff },
                   xcol = { 0xff, 0,    0xff, 0xff };
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
 
 
index 48df005..9d496f9 100644 (file)
@@ -50,7 +50,8 @@ test_fbo_main (int argc, char *argv[])
   int               x_pos = 200;
   int               y_pos = 100;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   if (clutter_feature_available (CLUTTER_FEATURE_OFFSCREEN) == FALSE)
     g_error("This test requires CLUTTER_FEATURE_OFFSCREEN");
index 7cba279..6dbe2a2 100644 (file)
@@ -72,7 +72,8 @@ test_fullscreen_main (int argc, char *argv[])
 {
   ClutterActor *stage;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   g_signal_connect (stage,
index 8dbd38c..946cf72 100644 (file)
@@ -155,7 +155,8 @@ test_grab_main (int argc, char *argv[])
                  ccol = { 0, 0xff, 0xff, 0xff },
                  ycol = { 0xff, 0xff, 0, 0xff };
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   g_print ("Red box:    aquire grab on press, releases it on next button release\n");
   g_print ("Blue box:   aquire grab on press, destroys the blue box actor on release\n");
index d941cf3..ee8649d 100644 (file)
@@ -748,7 +748,8 @@ test_layout_main (int argc, char *argv[])
   gint i, size;
   GError *error = NULL;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   clutter_actor_set_size (stage, 800, 600);
index d7b6457..f54021b 100644 (file)
@@ -211,7 +211,8 @@ test_model_main (int argc, char *argv[])
 {
   ClutterModel    *model;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   model = clutter_list_model_new (N_COLUMNS,
                                   G_TYPE_INT,    "Foo",
index d0a87d9..f9130cc 100644 (file)
@@ -116,7 +116,8 @@ test_multistage_main (int argc, char *argv[])
   ClutterActor *label;
   gint width, height;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
   
   stage_default = clutter_stage_get_default ();
   clutter_stage_set_title (CLUTTER_STAGE (stage_default), "Default Stage");
index d84a207..bded798 100644 (file)
@@ -102,7 +102,8 @@ test_path_constraint_main (int   argc,
   ClutterPath *path;
   ClutterColor rect_color = { 0xcc, 0x00, 0x00, 0xff };
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Path Constraint");
index 3e3ea96..a67df4b 100644 (file)
@@ -259,7 +259,8 @@ test_pixmap_main (int argc, char **argv)
   int                 i;
   int                  row_height;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   xdpy = clutter_x11_get_default_display ();
   XSynchronize (xdpy, True);
index 4b10160..af82034 100644 (file)
@@ -58,7 +58,8 @@ test_scale_main (int argc, char *argv[])
   ClutterAlpha    *alpha;
   ClutterBehaviour *behave;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
 
index 8ebb391..e980196 100644 (file)
@@ -140,7 +140,8 @@ test_script_main (int argc, char *argv[])
   gchar *file;
   gint res;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   script = clutter_script_new ();
   g_assert (CLUTTER_IS_SCRIPT (script));
index da48ddc..73ba63a 100644 (file)
@@ -73,7 +73,8 @@ test_scrolling_main (int argc, char *argv[])
   ClutterAction *action;
   gint i;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Scrolling");
index 11fba5b..6c7d8a6 100644 (file)
@@ -14,7 +14,8 @@ test_shader_effects_main (int argc, char *argv[])
   ClutterActor *stage, *hand, *label, *rect;
   gchar *file;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   /* Make a timeline */
   timeline = clutter_timeline_new (7692);
index 46c5522..4b95d5c 100644 (file)
@@ -308,7 +308,8 @@ test_shader_main (gint argc, gchar *argv[])
   GError        *error;
   gchar         *file;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Shaders");
index a5cf5e7..6ca4e33 100644 (file)
@@ -9,7 +9,8 @@ test_snap_constraint_main (int   argc,
 {
   ClutterActor *stage, *layer_a, *layer_b, *layer_c;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   /* the main container */
   stage = clutter_stage_new ();
index 2b5ec78..783b226 100644 (file)
@@ -132,7 +132,8 @@ test_stage_read_pixels_main (int argc, char **argv)
 {
   CallbackData data;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   data.idle_source = 0;
   data.stage = clutter_stage_get_default ();
index a32000d..f4bd686 100644 (file)
@@ -41,7 +41,8 @@ test_stage_sizing_main (int argc, char *argv[])
   gfloat width;
   ClutterActor *stage, *rect, *label;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
 
index 15aeb42..6a77d7b 100644 (file)
@@ -52,7 +52,8 @@ test_state_animator_main (gint    argc,
   ClutterActor *stage;
   ClutterActor *rects[40];
   gint i;
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
 
index 630c4d4..650d3c4 100644 (file)
@@ -96,7 +96,8 @@ test_state_main (gint    argc,
   ClutterActor *stage;
   ClutterState *layout_state;
   gint i;
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   layout_state = clutter_state_new ();
index c321b8c..c3c1877 100644 (file)
@@ -168,7 +168,8 @@ test_table_layout_main (int argc, char *argv[])
   ClutterActor *box;
   gchar *file;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Table Layout");
index 948cd7b..76e2cf4 100644 (file)
@@ -272,7 +272,8 @@ test_text_field_main (gint    argc,
   ClutterActor *box, *entry;
   ClutterLayoutManager *table;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Text Fields");
index e868eba..a981e0d 100644 (file)
@@ -20,7 +20,8 @@ test_text_main (gint    argc,
   ClutterColor  cursor_color     = { 0xff, 0x33, 0x33, 0xff };
   ClutterColor  background_color = { 0x00, 0x00, 0x00, 0xff };
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   clutter_stage_set_color (CLUTTER_STAGE (stage), &background_color);
index 9ea0a20..f88f382 100644 (file)
@@ -125,7 +125,8 @@ test_texture_async_main (int argc, char *argv[])
   ClutterColor  stage_color = { 0x12, 0x34, 0x56, 0xff };
   gchar        *path;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   g_thread_init (NULL);
   stage = clutter_stage_get_default ();
index da3214c..867711f 100644 (file)
@@ -12,7 +12,8 @@ test_texture_material_main (int argc, char *argv[])
 
   g_thread_init (NULL);
   clutter_threads_init ();
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Texture Material");
index 18d5c20..eb04630 100644 (file)
@@ -54,7 +54,8 @@ test_texture_quality_main (int argc, char *argv[])
   GError           *error;
   gchar            *file;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
index fba4736..d8094e9 100644 (file)
@@ -57,7 +57,8 @@ test_textures_main (int argc, char *argv[])
   ClutterActor    *stage;
   gint             i, j;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   clutter_actor_show_all (CLUTTER_ACTOR (stage));
index 18175bb..dd7a2f8 100644 (file)
@@ -190,7 +190,8 @@ test_threads_main (int argc, char *argv[])
 
   g_thread_init (NULL);
   clutter_threads_init ();
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Threading");
index 6c1e857..5b5f481 100644 (file)
@@ -101,7 +101,8 @@ test_unproject_main (int argc, char *argv[])
        }
     }
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
 
index 8e2c00c..f661729 100644 (file)
@@ -75,16 +75,18 @@ main (int argc, char **argv)
   const ClutterColor black = { 0x00, 0x00, 0x00, 0xff };
   ClutterColor color = { 0x00, 0x00, 0x00, 0xff };
   ClutterActor *stage, *rect;
+  GError *error = NULL;
 
   g_setenv ("CLUTTER_VBLANK", "none", FALSE);
   g_setenv ("CLUTTER_DEFAULT_FPS", "1000", FALSE);
   g_setenv ("CLUTTER_SHOW_FPS", "1", FALSE);
 
-  clutter_init_with_args (&argc, &argv,
-                          NULL,
-                          entries,
-                          NULL,
-                          NULL);
+  if (clutter_init_with_args (&argc, &argv,
+                              NULL,
+                              entries,
+                              NULL,
+                              &error) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   clutter_actor_set_size (stage, 512, 512);
index 656448b..b1f710d 100644 (file)
@@ -87,7 +87,8 @@ main (int argc, char *argv[])
 {
   ClutterActor *stage;
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
 
index b10c569..e21939c 100644 (file)
@@ -114,7 +114,8 @@ main (int argc, char *argv[])
   g_setenv ("CLUTTER_VBLANK", "none", FALSE);
   g_setenv ("CLUTTER_DEFAULT_FPS", "1000", FALSE);
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   if (argc != 3)
     {
index da86b2b..93a8f55 100644 (file)
@@ -50,7 +50,8 @@ main (int argc, char *argv[])
   g_setenv ("CLUTTER_VBLANK", "none", FALSE);
   g_setenv ("CLUTTER_DEFAULT_FPS", "1000", FALSE);
 
-  clutter_init (&argc, &argv);
+  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   stage = clutter_stage_get_default ();
   clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);