comparison test/automated/render/render.c @ 3743:848b5263ab05 gsoc2009_unit_tests

* Added some verbosity output.
author Edgar Simo <bobbens@gmail.com>
date Mon, 03 Aug 2009 17:48:56 +0000
parents 808fad5fb593
children f7a3a47e6b50
comparison
equal deleted inserted replaced
3742:2b000dd830e8 3743:848b5263ab05
918 int ret; 918 int ret;
919 919
920 /* No error. */ 920 /* No error. */
921 ret = 0; 921 ret = 0;
922 922
923 /* Test functionality first. */
924 if (render_hasDrawColor())
925 SDL_ATprintVerbose( 1, " Draw Color supported\n" );
926 if (render_hasBlendModes())
927 SDL_ATprintVerbose( 1, " Blend Modes supported\n" );
928 if (render_hasTexColor())
929 SDL_ATprintVerbose( 1, " Texture Color Mod supported\n" );
930 if (render_hasTexAlpha())
931 SDL_ATprintVerbose( 1, " Texture Alpha Mod supported\n" );
932
923 /* Software surface blitting. */ 933 /* Software surface blitting. */
924 ret = render_testPrimitives(); 934 ret = render_testPrimitives();
925 if (ret) 935 if (ret)
926 return -1; 936 return -1;
927 ret = render_testPrimitivesBlend(); 937 ret = render_testPrimitivesBlend();
972 if (ret != 0) 982 if (ret != 0)
973 return -1; 983 return -1;
974 984
975 /* Get number of drivers. */ 985 /* Get number of drivers. */
976 nd = SDL_GetNumVideoDrivers(); 986 nd = SDL_GetNumVideoDrivers();
977 if (ret < 0) 987 if (nd < 0)
978 goto err; 988 goto err;
989 SDL_ATprintVerbose( 1, "%d Video Drivers found\n", nd );
979 990
980 /* Now run on the video mode. */ 991 /* Now run on the video mode. */
981 ret = SDL_InitSubSystem( SDL_INIT_VIDEO ); 992 ret = SDL_InitSubSystem( SDL_INIT_VIDEO );
982 if (ret != 0) 993 if (ret != 0)
983 goto err; 994 goto err;
989 for (i=0; i<nd; i++) { 1000 for (i=0; i<nd; i++) {
990 /* Get video mode. */ 1001 /* Get video mode. */
991 driver = SDL_GetVideoDriver(i); 1002 driver = SDL_GetVideoDriver(i);
992 if (driver == NULL) 1003 if (driver == NULL)
993 goto err; 1004 goto err;
1005 SDL_ATprintVerbose( 1, " %d) %s\n", i+1, driver );
994 /* Hack to avoid dummy driver. */ 1006 /* Hack to avoid dummy driver. */
995 if (strcmp(driver,"dummy")==0) 1007 if (strcmp(driver,"dummy")==0)
996 continue; 1008 continue;
997 1009
998 /* 1010 /*
1024 goto err; 1036 goto err;
1025 /* Get renderers. */ 1037 /* Get renderers. */
1026 nr = SDL_GetNumRenderDrivers(); 1038 nr = SDL_GetNumRenderDrivers();
1027 if (SDL_ATassert("SDL_GetNumRenderDrivers", nr>=0)) 1039 if (SDL_ATassert("SDL_GetNumRenderDrivers", nr>=0))
1028 goto err; 1040 goto err;
1041 SDL_ATprintVerbose( 1, " %d Render Drivers\n", nr );
1029 SDL_ATend(); 1042 SDL_ATend();
1030 for (j=0; j<nr; j++) { 1043 for (j=0; j<nr; j++) {
1031 1044
1032 /* Get renderer info. */ 1045 /* Get renderer info. */
1033 ret = SDL_GetRenderDriverInfo( j, &renderer ); 1046 ret = SDL_GetRenderDriverInfo( j, &renderer );
1034 if (ret != 0) 1047 if (ret != 0)
1035 goto err; 1048 goto err;
1036 /* Set testcase name. */ 1049 /* Set testcase name. */
1037 snprintf( msg, sizeof(msg), "Renderer %s", renderer.name ); 1050 snprintf( msg, sizeof(msg), "Renderer %s", renderer.name );
1051 SDL_ATprintVerbose( 1, " %d) %s\n", j+1, renderer.name );
1038 SDL_ATbegin( msg ); 1052 SDL_ATbegin( msg );
1039 /* Set renderer. */ 1053 /* Set renderer. */
1040 ret = SDL_CreateRenderer( wid, j, 0 ); 1054 ret = SDL_CreateRenderer( wid, j, 0 );
1041 if (SDL_ATassert( "SDL_CreateRenderer", ret==0 )) 1055 if (SDL_ATassert( "SDL_CreateRenderer", ret==0 ))
1042 goto err; 1056 goto err;