Merge remote-tracking branch 'origin/master'
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Jan 2013 22:59:19 +0000 (23:59 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Jan 2013 22:59:19 +0000 (23:59 +0100)
1  2 
gtest_sdl_main.cpp

diff --combined gtest_sdl_main.cpp
@@@ -1,11 -1,12 +1,14 @@@
 +#define GTEST_HAS_EXCEPTIONS 0
 +
  #include <SDL/SDL.h>
  #include "gtest/gtest.h"
  
  int main(int argc, char **argv) {
        // Set up an OpenGL context using SDL.
-       SDL_Init(SDL_INIT_VIDEO);
+       if (SDL_Init(SDL_INIT_VIDEO) == -1) {
+               fprintf(stderr, "SDL_Init failed: %s\n", SDL_GetError());
+               exit(1);
+       }
        SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0);
        SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 0);
        SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);