1 /* testgdk -- validation program for GDK
2 * Copyright (C) 2000 Tor Lillqvist
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 /* This program is intended to be used to validate the correctness of
21 * the basic graphics operations in a GDK backend. The results of the
22 * operations are compared against those produced by a correctly
23 * functioning X11 backend (and X11 server).
25 * Obviously, only the most basic operations reasonably be expected to
26 * produce pixel-by-pixel identical results as the X11 backend. We
27 * don't even try to test the correctness of ellipses, tiles or
28 * stipples. Not to mention fonts.
30 * But, for those operations we do test, we should try to test quite
31 * many combinations of parameters.
33 * This is just a quick hack, and could be improved a lot. There are
34 * copy-pasted code snippets all over that need to be factored out
35 * into separate functions.
46 /* CQTESTF -- "Conditionally Quiet TEST with Fail message"
47 * macro that prints PASS or FAIL messages
48 * parms: quiet: if TRUE, only print FAIL messages
49 * expr: the expression to test
50 * failfmt:if expr is FALSE, print this message
51 * (both format and args)
54 #define CQTESTF(quiet, expr, failfmt) \
56 (tmpb ? (quiet ? 0 : printf ("PASS: %d %s\n", __LINE__, #expr)) \
57 : (printf ("FAIL: %d %s", __LINE__, #expr), \
65 /* Variations with less parms */
67 #define CQTEST(quiet, expr) \
68 CQTESTF (quiet, expr, (""))
76 #define TESTF(expr, failfmt) \
77 CQTESTF (FALSE, expr, failfmt)
79 #define QTESTF(expr, failfmt) \
80 CQTESTF (TRUE, expr, failfmt)
83 #define ASSERT(expr) \
86 printf ("That is fatal. Goodbye\n"), exit (1);\
94 #define ASSERT(expr) \
97 printf ("That is fatal. Goodbye\n"), my_break();\
101 #define N(a) (sizeof(a)/sizeof(*a))
103 static int return_value = 0;
105 static gboolean retval;
106 static gboolean tmpb;
108 static GdkVisual *system_visual;
109 static GdkVisual *best_visual;
112 static GdkColormap *system_colourmap;
114 static GdkColor white, black, red, green, blue, rand1_colour, rand2_colour;
116 static GdkGC *black_gc, *white_gc, *red_gc, *rand1_gc, *rand2_gc;
117 static GdkGC *gcs[5];
118 static GdkGC *black_bitmap_gc;
123 /* Place breakpoint here to catch failures */
128 test_visual_coherency (gboolean quiet,
131 gboolean retval = TRUE;
133 CQTEST (quiet, visual->type >= GDK_VISUAL_STATIC_GRAY &&
134 visual->type <= GDK_VISUAL_DIRECT_COLOR);
135 CQTEST (quiet, visual->depth >= 1 && visual->depth <= 32);
136 CQTEST (quiet, visual->byte_order == GDK_LSB_FIRST || visual->byte_order ==
150 system_visual = gdk_visual_get_system ();
151 ASSERT (system_visual != NULL);
152 TEST (test_visual_coherency (FALSE, system_visual));
154 best_visual = gdk_visual_get_best ();
155 if (best_visual != system_visual)
156 TEST (test_visual_coherency (TRUE, best_visual));
158 visuals = gdk_list_visuals ();
161 visual = visuals->data;
162 TEST (test_visual_coherency (TRUE, visual));
163 visuals = visuals->next;
167 /* Create a top-level window used by other tests
170 test_first_window (void)
176 wa.window_type = GDK_WINDOW_TOPLEVEL;
177 wa.wclass = GDK_INPUT_OUTPUT;
179 w = gdk_window_new (NULL, &wa, 0);
187 test_colourmaps (void)
189 system_colourmap = gdk_colormap_get_system ();
190 ASSERT (system_colourmap != NULL);
198 ASSERT (gdk_color_white (system_colourmap, &white));
199 ASSERT (gdk_color_black (system_colourmap, &black));
201 red.green = red.blue = 0;
202 TEST (gdk_colormap_alloc_color (system_colourmap, &red, FALSE, TRUE));
204 rand1_colour.red = rand () % 65536;
205 rand1_colour.green = rand () % 65536;
206 rand1_colour.blue = rand () % 65536;
207 TEST (gdk_colormap_alloc_color (system_colourmap, &rand1_colour, FALSE,
210 rand2_colour.red = rand () % 65536;
211 rand2_colour.green = rand () % 65536;
212 rand2_colour.blue = rand () % 65536;
213 TEST (gdk_colormap_alloc_color (system_colourmap, &rand2_colour, FALSE,
218 test_default_gc (GdkGCValues *gcvalues,
221 gboolean retval = TRUE;
223 CQTEST (quiet, gcvalues->foreground.pixel == 0);
224 CQTEST (quiet, gcvalues->background.pixel == 1);
225 CQTEST (quiet, gcvalues->function == GDK_COPY);
226 CQTEST (quiet, gcvalues->fill == GDK_SOLID);
227 CQTEST (quiet, gcvalues->tile == NULL);
228 CQTEST (quiet, gcvalues->stipple == NULL);
229 CQTEST (quiet, gcvalues->clip_mask == NULL);
230 CQTEST (quiet, gcvalues->subwindow_mode == GDK_CLIP_BY_CHILDREN);
231 CQTEST (quiet, gcvalues->line_width == 0);
232 CQTEST (quiet, gcvalues->line_style == GDK_LINE_SOLID);
233 CQTEST (quiet, gcvalues->cap_style == GDK_CAP_BUTT);
234 CQTEST (quiet, gcvalues->join_style == GDK_JOIN_MITER);
239 /* Create GdkGCs with various values,
240 * check that gdk_gc_get_values returns the same,
241 * or something reasonably close.
248 GdkGCValues gcvalues;
250 GdkFunction function;
255 gdk_gc_get_values (gc, &gcvalues);
256 test_default_gc (&gcvalues, FALSE);
259 gdk_gc_set_foreground (gc, &colour);
260 gdk_gc_get_values (gc, &gcvalues);
261 TEST (gcvalues.foreground.pixel == 1234);
264 gdk_gc_set_foreground (gc, &colour);
265 gdk_gc_get_values (gc, &gcvalues);
266 TEST (test_default_gc (&gcvalues, TRUE));
269 gdk_gc_set_background (gc, &colour);
270 gdk_gc_get_values (gc, &gcvalues);
271 TEST (gcvalues.background.pixel == 5678);
274 gdk_gc_set_background (gc, &colour);
275 gdk_gc_get_values (gc, &gcvalues);
276 TEST (test_default_gc (&gcvalues, TRUE));
279 for (function = GDK_COPY; function <= GDK_SET; function++)
281 gdk_gc_set_function (gc, function);
282 gdk_gc_get_values (gc, &gcvalues);
283 QTEST (gcvalues.function == function);
284 gdk_gc_set_function (gc, GDK_COPY);
285 gdk_gc_get_values (gc, &gcvalues);
286 QTEST (test_default_gc (&gcvalues, TRUE));
291 for (fill = GDK_SOLID; fill <= GDK_OPAQUE_STIPPLED; fill++)
293 gdk_gc_set_fill (gc, fill);
294 gdk_gc_get_values (gc, &gcvalues);
295 QTEST (gcvalues.fill == fill);
296 gdk_gc_set_fill (gc, GDK_SOLID);
297 gdk_gc_get_values (gc, &gcvalues);
298 QTEST (test_default_gc (&gcvalues, TRUE));
302 black_gc = gdk_gc_new (w);
303 gdk_gc_copy (black_gc, gc);
304 gdk_gc_get_values (black_gc, &gcvalues);
305 TEST (test_default_gc (&gcvalues, TRUE));
308 gdk_gc_set_foreground (black_gc, &black);
309 gdk_gc_get_values (black_gc, &gcvalues);
310 TEST (gcvalues.foreground.pixel == black.pixel);
312 white_gc = gdk_gc_new (w);
314 gdk_gc_set_foreground (white_gc, &white);
315 gdk_gc_get_values (white_gc, &gcvalues);
316 TEST (gcvalues.foreground.pixel == white.pixel);
318 red_gc = gdk_gc_new (w);
319 gdk_gc_set_foreground (red_gc, &red);
320 gdk_gc_get_values (red_gc, &gcvalues);
321 TEST (gcvalues.foreground.pixel == red.pixel);
323 rand1_gc = gdk_gc_new (w);
324 gdk_gc_set_foreground (rand1_gc, &rand1_colour);
325 gdk_gc_get_values (rand1_gc, &gcvalues);
326 TESTF (gcvalues.foreground.pixel == rand1_colour.pixel,
327 (" %#06x != %#06x", gcvalues.foreground.pixel, rand1_colour.pixel));
329 rand2_gc = gdk_gc_new (w);
330 gdk_gc_set_foreground (rand2_gc, &rand2_colour);
331 gdk_gc_get_values (rand2_gc, &gcvalues);
332 TESTF (gcvalues.foreground.pixel == rand2_colour.pixel,
333 (" %#06x != %#06x", gcvalues.foreground.pixel, rand2_colour.pixel));
341 pixmap = gdk_pixmap_new (NULL, 1, 1, 1);
342 black_bitmap_gc = gdk_gc_new (pixmap);
343 gdk_pixmap_unref (pixmap);
346 /* Create pixmaps, check that properties are as expected.
347 * No graphic operations tested yet.
350 test_pixmaps (gint depth)
357 gboolean retval = TRUE;
359 for (width = 1; width <= 64; width += 2)
360 for (height = 1; height <= 32; height += 3)
362 pixmap = gdk_pixmap_new (NULL, width, height, depth);
363 ASSERT (pixmap != NULL);
364 gdk_window_get_size (pixmap, &w, &h);
365 QTESTF (w == width, (" w:%d", w));
366 QTESTF (h == height, (" h:%d", h));
367 image = gdk_image_get (pixmap, 0, 0, w, h);
368 QTEST (image != NULL);
369 QTEST (image->width == width);
370 QTEST (image->height == height);
371 QTEST (image->depth == depth);
372 gdk_image_destroy (image);
373 gdk_pixmap_unref (pixmap);
384 GdkImageType image_type;
386 gboolean retval = TRUE;
388 for (width = 1; width <= 64; width += 3)
389 for (height = 1; height <= 32; height += 7)
390 for (image_type = GDK_IMAGE_NORMAL;
391 image_type <= GDK_IMAGE_FASTEST;
394 image = gdk_image_new (image_type, system_visual, width, height);
395 if (image == NULL && image_type == GDK_IMAGE_SHARED)
396 /* Ignore failure to create shared image,
397 * display might not be local.
402 ASSERT (image != NULL);
403 QTEST (image->width == width);
404 QTEST (image->height == height);
405 QTEST (image->depth == system_visual->depth);
406 QTEST (image->bpp >= (image->depth-1)/8 + 1);
407 QTEST (image->mem != NULL);
408 gdk_image_destroy (image);
414 /* Test creating temp windows.
417 test_temp_windows (void)
424 gboolean retval = TRUE;
426 wa.window_type = GDK_WINDOW_TEMP;
427 wa.wclass = GDK_INPUT_OUTPUT;
429 for (width = 1; width <= 64; width += 4)
430 for (height = 1; height <= 32; height += 7)
434 window = gdk_window_new (NULL, &wa, 0);
435 ASSERT (window != NULL);
436 gdk_window_get_geometry (window, &x, &y, &w, &h, &d);
437 QTESTF (w == width, ("w:%d", w));
438 QTESTF (h == height, ("h:%d", h));
439 gdk_window_show (window);
440 gdk_window_get_geometry (window, &x, &y, &w, &h, &d);
441 QTESTF (w == width, ("w:%d", w));
442 QTESTF (h == height, ("h:%d", h));
443 gdk_window_resize (window, 37, 19);
444 gdk_window_get_geometry (window, &x, &y, &w, &h, &d);
445 QTESTF (w == 37, ("w:%d", w));
446 QTESTF (h == 19, ("h:%d", h));
447 visual = gdk_window_get_visual (window);
448 QTEST (visual == system_visual);
449 gdk_window_hide (window);
450 gdk_window_unref (window);
456 test_gc_function (GdkFunction function,
465 QTEST (newpixel == (foreground & mask)); break;
467 QTEST (newpixel == ((~oldpixel) & mask)); break;
469 QTEST (newpixel == ((oldpixel ^ foreground) & mask)); break;
471 QTEST (newpixel == 0); break;
473 QTEST (newpixel == ((oldpixel & foreground) & mask)); break;
474 case GDK_AND_REVERSE:
475 QTEST (newpixel == (((~oldpixel) & foreground) & mask)); break;
477 QTEST (newpixel == ((oldpixel & (~foreground)) & mask)); break;
479 QTEST (newpixel == (oldpixel & mask)); break;
481 QTEST (newpixel == ((oldpixel | foreground) & mask)); break;
483 QTEST (newpixel == ((oldpixel ^ (~foreground)) & mask)); break;
485 QTEST (newpixel == (((~oldpixel) | foreground) & mask)); break;
486 case GDK_COPY_INVERT:
487 QTEST (newpixel == ((~foreground) & mask)); break;
489 QTEST (newpixel == ((oldpixel | (~foreground)) & mask)); break;
491 QTEST (newpixel == (((~oldpixel) | (~foreground)) & mask)); break;
493 QTEST (newpixel == (~oldpixel & ~mask)); break;
495 QTEST (newpixel == ((~0) & mask)); break;
502 test_one_point_on_drawable (GdkDrawable *drawable,
507 GdkGCValues gcvalues;
509 guint32 oldpixels[3][3], newpixel, mask;
513 gdk_gc_get_values (gc, &gcvalues);
515 image = gdk_image_get (drawable, x+-1, y+-1, 3, 3);
516 QTEST (image != NULL);
517 for (xoff = -1; xoff <= 1; xoff++)
518 for (yoff = -1; yoff <= 1; yoff++)
520 oldpixels[xoff+1][yoff+1] = gdk_image_get_pixel (image, xoff+1, yoff+1);
522 gdk_image_destroy (image);
527 mask = (1 << depth) - 1;
529 gdk_draw_point (drawable, gc, x, y);
531 image = gdk_image_get (drawable, x-1, y-1, 3, 3);
532 QTEST (image != NULL);
533 for (xoff = -1; xoff <= 1; xoff++)
534 for (yoff = -1; yoff <= 1; yoff++)
536 newpixel = gdk_image_get_pixel (image, xoff+1, yoff+1);
537 if (xoff == 0 && yoff == 0)
538 test_gc_function (gcvalues.function, oldpixels[1][1], newpixel,
539 gcvalues.foreground.pixel, mask);
541 QTEST (newpixel == oldpixels[xoff+1][yoff+1]);
543 gdk_image_destroy (image);
547 /* Test drawing points.
554 GdkFunction function;
560 pixmap = gdk_pixmap_new (w, width, height, -1);
562 for (i = 0; i < N(gcs); i++)
563 for (j = 0; j < N(gcs); j++)
564 for (function = GDK_COPY; function <= GDK_SET; function++)
566 gdk_draw_rectangle (pixmap, gcs[i], TRUE, 0, 0, width, height);
567 gdk_gc_set_function (gcs[j], function);
568 test_one_point_on_drawable (pixmap, gcs[j], system_visual->depth);
569 gdk_gc_set_function (gcs[j], GDK_COPY);
572 gdk_pixmap_unref (pixmap);
574 pixmap = gdk_pixmap_new (w, width, height, 1);
575 test_one_point_on_drawable (pixmap, black_bitmap_gc, 1);
576 for (function = GDK_COPY; function <= GDK_SET; function++)
578 gdk_gc_set_function (black_bitmap_gc, function);
579 test_one_point_on_drawable (pixmap, black_bitmap_gc, 1);
582 gdk_pixmap_unref (pixmap);
586 test_one_line_on_drawable (GdkDrawable *drawable,
591 GdkImage *oldimage, *newimage;
592 GdkGCValues gcvalues;
595 gint w_up, w_down, w_left, w_right;
597 guint32 oldpixel, newpixel, mask;
599 gdk_gc_get_values (gc, &gcvalues);
600 line_width = gcvalues.line_width > 0 ? gcvalues.line_width : 1;
601 w_up = w_left = line_width/2;
602 w_down = w_right = (line_width & 1) ? line_width/2 : line_width/2-1;
603 gdk_window_get_size (drawable, &w, &h);
604 oldimage = gdk_image_get (drawable, 0, 0, w, h);
609 mask = (1 << depth) - 1;
618 gdk_draw_line (drawable, gc, x1, y1, x2, y2);
619 newimage = gdk_image_get (drawable, 0, 0, w, h);
620 for (x = x1-1; x <= x2+1; x++)
621 for (y = y1-w_up-1; y <= y1+w_down+1; y++)
623 oldpixel = gdk_image_get_pixel (oldimage, x, y);
624 newpixel = gdk_image_get_pixel (newimage, x, y);
625 if (x >= x1 && x < x2 && y >= y1-w_up && y <= y1+w_down)
626 test_gc_function (gcvalues.function, oldpixel, newpixel,
627 gcvalues.foreground.pixel, mask);
629 QTEST (oldpixel == newpixel);
639 gdk_draw_line (drawable, gc, x1, y1, x2, y2);
640 newimage = gdk_image_get (drawable, 0, 0, w, h);
641 for (x = x1-w_left-1; x <= x1+w_right+1; x++)
642 for (y = y1-1; y <= y2+1; y++)
644 oldpixel = gdk_image_get_pixel (oldimage, x, y);
645 newpixel = gdk_image_get_pixel (newimage, x, y);
646 if (x >= x1-w_left && x <= x1+w_right && y >= y1 && y < y2)
647 test_gc_function (gcvalues.function, oldpixel, newpixel,
648 gcvalues.foreground.pixel, mask);
650 QTEST (oldpixel == newpixel);
654 gdk_image_destroy (oldimage);
655 gdk_image_destroy (newimage);
658 /* Test drawing lines.
664 GdkFunction function;
667 gboolean horisontal = TRUE;
669 pixmap = gdk_pixmap_new (w, 30, 30, -1);
671 for (i = 0; i < N(gcs); i++)
672 for (j = 0; j < N(gcs); j++)
673 for (function = GDK_COPY; function <= GDK_SET; function++)
674 for (width = 1; width <= 4; width++)
676 gdk_draw_rectangle (pixmap, gcs[i], TRUE, 0, 0, 30, 30);
677 gdk_gc_set_function (gcs[j], function);
678 gdk_gc_set_line_attributes (gcs[j], width,
679 GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
680 test_one_line_on_drawable (pixmap, gcs[j], system_visual->depth,
682 /* Toggle between horisontal and vertical... */
683 horisontal = !horisontal;
684 gdk_gc_set_function (gcs[j], GDK_COPY);
687 gdk_pixmap_unref (pixmap);
691 test_one_rectangle_on_drawable (GdkDrawable *drawable,
696 GdkImage *oldimage, *newimage;
697 GdkGCValues gcvalues;
700 gint w_up, w_down, w_left, w_right;
702 guint32 oldpixel, newpixel, mask;
705 const gint width = 7;
706 const gint height = 9;
708 gdk_gc_get_values (gc, &gcvalues);
712 line_width = gcvalues.line_width > 0 ? gcvalues.line_width : 1;
713 w_up = w_left = line_width/2;
714 w_down = w_right = (line_width & 1) ? line_width/2 : line_width/2-1;
717 gdk_window_get_size (drawable, &w, &h);
718 oldimage = gdk_image_get (drawable, 0, 0, w, h);
723 mask = (1 << depth) - 1;
725 gdk_draw_rectangle (drawable, gc, filled, x0, y0, width, height);
726 newimage = gdk_image_get (drawable, 0, 0, w, h);
728 for (x = x0 - 1; x <= x0 + width + 1; x++)
729 for (y = y0 - 1; y < y0 + height + 1; y++)
731 oldpixel = gdk_image_get_pixel (oldimage, x, y);
732 newpixel = gdk_image_get_pixel (newimage, x, y);
736 if (x >= x0 && x < x0+width &&
737 y >= y0 && y < y0+height)
738 test_gc_function (gcvalues.function, oldpixel, newpixel,
739 gcvalues.foreground.pixel, mask);
741 QTEST (oldpixel == newpixel);
745 if ((x >= x0-w_left && x <= x0+width+w_right &&
746 y >= y0-w_up && y <= y0+w_down) ||
747 (x >= x0-w_left && x <= x0+width+w_right &&
748 y >= y0+height-w_up && y <= y0+height+w_down) ||
749 (x >= x0-w_left && x <= x0+w_right &&
750 y >= y0-w_up && y <= y0+height+w_down) ||
751 (x >= x0+width-w_left && x <= x0+width+w_right &&
752 y >= y0-w_up && y <= y0+height+w_down))
753 test_gc_function (gcvalues.function, oldpixel, newpixel,
754 gcvalues.foreground.pixel, mask);
756 QTEST (oldpixel == newpixel);
760 gdk_image_destroy (oldimage);
761 gdk_image_destroy (newimage);
764 /* Test drawing rectangles.
767 test_rectangles (void)
770 GdkFunction function;
773 gboolean filled = FALSE;
775 pixmap = gdk_pixmap_new (w, 30, 30, -1);
777 for (i = 0; i < N(gcs); i++)
778 for (j = 0; j < N(gcs); j++)
779 for (function = GDK_COPY; function <= GDK_SET; function++)
780 for (width = 1; width <= 4; width++)
782 gdk_draw_rectangle (pixmap, gcs[i], TRUE, 0, 0, 30, 30);
783 gdk_gc_set_function (gcs[j], function);
784 gdk_gc_set_line_attributes (gcs[j], width,
785 GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
786 test_one_rectangle_on_drawable (pixmap, gcs[j],
787 system_visual->depth, filled);
789 gdk_gc_set_function (gcs[j], GDK_COPY);
792 gdk_pixmap_unref (pixmap);
796 test_some_arcs_on_drawable (GdkDrawable *drawable,
801 GdkImage *oldimage, *newimage;
802 GdkGCValues gcvalues;
805 gint w_up, w_down, w_left, w_right;
807 guint32 oldpixel, newpixel, mask;
811 const gint width = 7;
812 const gint height = 9;
814 gdk_gc_get_values (gc, &gcvalues);
818 line_width = gcvalues.line_width > 0 ? gcvalues.line_width : 1;
819 w_up = w_left = line_width/2;
820 w_down = w_right = (line_width & 1) ? line_width/2 : line_width/2-1;
823 gdk_window_get_size (drawable, &w, &h);
824 oldimage = gdk_image_get (drawable, 0, 0, w, h);
829 mask = (1 << depth) - 1;
832 newimage = gdk_image_get (drawable, 0, 0, w, h);
834 for (x = x0 - 1; x <= x0 + width + 1; x++)
835 for (y = y0 - 1; y < y0 + height + 1; y++)
837 oldpixel = gdk_image_get_pixel (oldimage, x, y);
838 newpixel = gdk_image_get_pixel (newimage, x, y);
850 gdk_image_destroy (oldimage);
851 gdk_image_destroy (newimage);
854 /* Test drawing arcs. Results don't have to be exactly as on X11,
861 GdkFunction function;
864 gboolean filled = FALSE;
866 pixmap = gdk_pixmap_new (w, 30, 30, -1);
868 for (i = 0; i < N(gcs); i++)
869 for (j = 0; j < N(gcs); j++)
870 for (function = GDK_COPY; function <= GDK_SET; function++)
871 for (width = 1; width <= 4; width++)
873 gdk_draw_rectangle (pixmap, gcs[i], TRUE, 0, 0, 30, 30);
874 gdk_gc_set_function (gcs[j], function);
875 gdk_gc_set_line_attributes (gcs[j], width,
876 GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
877 test_some_arcs_on_drawable (pixmap, gcs[j], system_visual->depth,
880 gdk_gc_set_function (gcs[j], GDK_COPY);
883 gdk_pixmap_unref (pixmap);
886 /* Test region operations.
899 test_first_window ();
904 test_pixmaps (system_visual->depth);
905 if (best_visual->depth != system_visual->depth)
906 test_pixmaps (best_visual->depth);
908 test_temp_windows ();
917 main (int argc, char **argv)
919 GLogLevelFlags fatal_mask;
921 gdk_init (&argc, &argv);
923 fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
924 fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
925 g_log_set_always_fatal (fatal_mask);