summaryrefslogtreecommitdiffstats
path: root/src/gallium/tests/graw/gs-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/tests/graw/gs-test.c')
-rw-r--r--src/gallium/tests/graw/gs-test.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gallium/tests/graw/gs-test.c b/src/gallium/tests/graw/gs-test.c
index 812666a8c84..0c65390e109 100644
--- a/src/gallium/tests/graw/gs-test.c
+++ b/src/gallium/tests/graw/gs-test.c
@@ -497,15 +497,18 @@ static void init( void )
* Also, no easy way of querying supported formats if the screen
* cannot be created first.
*/
- for (i = 0;
- window == NULL && formats[i] != PIPE_FORMAT_NONE;
- i++) {
-
- screen = graw_create_window_and_screen(0,0,WIDTH,HEIGHT,
+ for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) {
+ screen = graw_create_window_and_screen(0, 0, 300, 300,
formats[i],
&window);
+ if (window && screen)
+ break;
}
-
+ if (!screen || !window) {
+ fprintf(stderr, "Unable to create window\n");
+ exit(1);
+ }
+
ctx = screen->context_create(screen, NULL);
if (ctx == NULL)
exit(3);