Add pixels test suite; add a test to pixel suite; minor updates to test code to make VisualStudio happy
authorAndreas Schiffler <aschiffler@ferzkopp.net>
Wed, 01 May 2013 22:14:29 -0700
changeset 713409ee216e6a25
parent 7133 87d4cb9bb66c
child 7135 20db445af8c7
Add pixels test suite; add a test to pixel suite; minor updates to test code to make VisualStudio happy
VisualC/tests/testautomation/testautomation_vs2010.vcxproj
VisualC/tests/testautomation/testautomation_vs2012.vcxproj
test/Makefile.in
test/testautomation_audio.c
test/testautomation_pixels.c
test/testautomation_suites.h
test/testautomation_video.c
     1.1 --- a/VisualC/tests/testautomation/testautomation_vs2010.vcxproj	Wed May 01 11:59:54 2013 +0200
     1.2 +++ b/VisualC/tests/testautomation/testautomation_vs2010.vcxproj	Wed May 01 22:14:29 2013 -0700
     1.3 @@ -1,4 +1,4 @@
     1.4 -<?xml version="1.0" encoding="utf-8"?>
     1.5 +<?xml version="1.0" encoding="utf-8"?>
     1.6  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
     1.7    <ItemGroup Label="ProjectConfigurations">
     1.8      <ProjectConfiguration Include="Debug|Win32">
     1.9 @@ -192,6 +192,7 @@
    1.10      <ClCompile Include="..\..\..\test\testautomation_sdltest.c" />
    1.11      <ClCompile Include="..\..\..\test\testautomation_mouse.c" />
    1.12      <ClCompile Include="..\..\..\test\testautomation_timer.c" />
    1.13 +    <ClCompile Include="..\..\..\test\testautomation_pixels.c" />
    1.14    </ItemGroup>
    1.15    <ItemGroup>
    1.16      <ClInclude Include="..\..\..\test\testautomation_suites.h" />
     2.1 --- a/VisualC/tests/testautomation/testautomation_vs2012.vcxproj	Wed May 01 11:59:54 2013 +0200
     2.2 +++ b/VisualC/tests/testautomation/testautomation_vs2012.vcxproj	Wed May 01 22:14:29 2013 -0700
     2.3 @@ -1,4 +1,4 @@
     2.4 -<?xml version="1.0" encoding="utf-8"?>
     2.5 +<?xml version="1.0" encoding="utf-8"?>
     2.6  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
     2.7    <ItemGroup Label="ProjectConfigurations">
     2.8      <ProjectConfiguration Include="Debug|Win32">
     2.9 @@ -196,6 +196,7 @@
    2.10      <ClCompile Include="..\..\..\test\testautomation_sdltest.c" />
    2.11      <ClCompile Include="..\..\..\test\testautomation_mouse.c" />
    2.12      <ClCompile Include="..\..\..\test\testautomation_timer.c" />
    2.13 +    <ClCompile Include="..\..\..\test\testautomation_pixels.c" />
    2.14    </ItemGroup>
    2.15    <ItemGroup>
    2.16      <ClInclude Include="..\..\..\test\testautomation_suites.h" />
     3.1 --- a/test/Makefile.in	Wed May 01 11:59:54 2013 +0200
     3.2 +++ b/test/Makefile.in	Wed May 01 22:14:29 2013 -0700
     3.3 @@ -83,7 +83,8 @@
     3.4  		      $(srcdir)/testautomation_syswm.c \
     3.5  		      $(srcdir)/testautomation_sdltest.c \
     3.6  		      $(srcdir)/testautomation_mouse.c \
     3.7 -		      $(srcdir)/testautomation_timer.c
     3.8 +		      $(srcdir)/testautomation_timer.c \
     3.9 +		      $(srcdir)/testautomation_pixels.c		      
    3.10  	$(CC) -o $@ $^ $(CFLAGS) -lSDL2_test $(LIBS) 
    3.11  
    3.12  testmultiaudio$(EXE): $(srcdir)/testmultiaudio.c
     4.1 --- a/test/testautomation_audio.c	Wed May 01 11:59:54 2013 +0200
     4.2 +++ b/test/testautomation_audio.c	Wed May 01 22:14:29 2013 -0700
     4.3 @@ -117,11 +117,10 @@
     4.4   */
     4.5  int audio_initOpenCloseQuitAudio()
     4.6  {
     4.7 -        int result;
     4.8 +    int result;
     4.9  	int i, iMax, j;
    4.10  	const char* audioDriver;
    4.11  	SDL_AudioSpec desired;
    4.12 -	SDL_AudioSpec obtained;
    4.13  	
    4.14  	/* Stop SDL audio subsystem */
    4.15  	SDL_QuitSubSystem( SDL_INIT_AUDIO );
    4.16 @@ -347,17 +346,17 @@
    4.17  }
    4.18  
    4.19  /* Definition of all formats, channels, and frequencies used to test audio conversions */
    4.20 -const int _numFormats = 18;
    4.21 -SDL_AudioFormat _formats[] = { AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_S16SYS, AUDIO_S16, AUDIO_U16LSB, 
    4.22 +const int _numAudioFormats = 18;
    4.23 +SDL_AudioFormat _audioFormats[] = { AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_S16SYS, AUDIO_S16, AUDIO_U16LSB, 
    4.24  				AUDIO_U16MSB, AUDIO_U16SYS, AUDIO_U16, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_S32SYS, AUDIO_S32, 
    4.25                                  AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_F32SYS, AUDIO_F32 };
    4.26 -char *_formatsVerbose[] = { "AUDIO_S8", "AUDIO_U8", "AUDIO_S16LSB", "AUDIO_S16MSB", "AUDIO_S16SYS", "AUDIO_S16", "AUDIO_U16LSB", 
    4.27 +char *_audioFormatsVerbose[] = { "AUDIO_S8", "AUDIO_U8", "AUDIO_S16LSB", "AUDIO_S16MSB", "AUDIO_S16SYS", "AUDIO_S16", "AUDIO_U16LSB", 
    4.28  				"AUDIO_U16MSB", "AUDIO_U16SYS", "AUDIO_U16", "AUDIO_S32LSB", "AUDIO_S32MSB", "AUDIO_S32SYS", "AUDIO_S32", 
    4.29                                  "AUDIO_F32LSB", "AUDIO_F32MSB", "AUDIO_F32SYS", "AUDIO_F32" };
    4.30 -const int _numChannels = 4;
    4.31 -Uint8 _channels[] = { 1, 2, 4, 6 };
    4.32 -const int _numFrequencies = 4;
    4.33 -int _frequencies[] = { 11025, 22050, 44100, 48000 };
    4.34 +const int _numAudioChannels = 4;
    4.35 +Uint8 _audioChannels[] = { 1, 2, 4, 6 };
    4.36 +const int _numAudioFrequencies = 4;
    4.37 +int _audioFrequencies[] = { 11025, 22050, 44100, 48000 };
    4.38  
    4.39  
    4.40  /**
    4.41 @@ -395,22 +394,22 @@
    4.42    SDLTest_AssertCheck(result == 1, "Verify result value; expected: 1, got: %i", result);
    4.43  
    4.44    /* All source conversions with random conversion targets, allow 'null' conversions */
    4.45 -  for (i = 0; i < _numFormats; i++) {
    4.46 -    for (j = 0; j < _numChannels; j++) {
    4.47 -      for (k = 0; k < _numFrequencies; k++) {
    4.48 -        spec1.format = _formats[i];
    4.49 -        spec1.channels = _channels[j];
    4.50 -        spec1.freq = _frequencies[k];
    4.51 -        ii = SDLTest_RandomIntegerInRange(0, _numFormats - 1);
    4.52 -        jj = SDLTest_RandomIntegerInRange(0, _numChannels - 1);
    4.53 -        kk = SDLTest_RandomIntegerInRange(0, _numFrequencies - 1);
    4.54 -        spec2.format = _formats[ii];
    4.55 -        spec2.channels = _channels[jj];
    4.56 -        spec2.freq = _frequencies[kk];
    4.57 +  for (i = 0; i < _numAudioFormats; i++) {
    4.58 +    for (j = 0; j < _numAudioChannels; j++) {
    4.59 +      for (k = 0; k < _numAudioFrequencies; k++) {
    4.60 +        spec1.format = _audioFormats[i];
    4.61 +        spec1.channels = _audioChannels[j];
    4.62 +        spec1.freq = _audioFrequencies[k];
    4.63 +        ii = SDLTest_RandomIntegerInRange(0, _numAudioFormats - 1);
    4.64 +        jj = SDLTest_RandomIntegerInRange(0, _numAudioChannels - 1);
    4.65 +        kk = SDLTest_RandomIntegerInRange(0, _numAudioFrequencies - 1);
    4.66 +        spec2.format = _audioFormats[ii];
    4.67 +        spec2.channels = _audioChannels[jj];
    4.68 +        spec2.freq = _audioFrequencies[kk];
    4.69          result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq,
    4.70                                           spec2.format, spec2.channels, spec2.freq);
    4.71          SDLTest_AssertPass("Call to SDL_BuildAudioCVT(format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i ==> format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i)", 
    4.72 -            i, _formatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _formatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq);
    4.73 +            i, _audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq);
    4.74          SDLTest_AssertCheck(result == 0 || result == 1, "Verify result value; expected: 0 or 1, got: %i", result);
    4.75          if (result<0) {
    4.76            SDLTest_LogError(SDL_GetError());
    4.77 @@ -691,39 +690,39 @@
    4.78      }
    4.79      SDLTest_Log(message);
    4.80      /* All source conversions with random conversion targets */
    4.81 -    for (i = 0; i < _numFormats; i++) {
    4.82 -      for (j = 0; j < _numChannels; j++) {
    4.83 -        for (k = 0; k < _numFrequencies; k++) {        
    4.84 -          spec1.format = _formats[i];
    4.85 -          spec1.channels = _channels[j];
    4.86 -          spec1.freq = _frequencies[k];
    4.87 +    for (i = 0; i < _numAudioFormats; i++) {
    4.88 +      for (j = 0; j < _numAudioChannels; j++) {
    4.89 +        for (k = 0; k < _numAudioFrequencies; k++) {        
    4.90 +          spec1.format = _audioFormats[i];
    4.91 +          spec1.channels = _audioChannels[j];
    4.92 +          spec1.freq = _audioFrequencies[k];
    4.93          
    4.94            /* Ensure we have a different target format */
    4.95            do {
    4.96              if (c & 1) {
    4.97 -              ii = SDLTest_RandomIntegerInRange(0, _numFormats - 1);
    4.98 +              ii = SDLTest_RandomIntegerInRange(0, _numAudioFormats - 1);
    4.99              } else {
   4.100                ii = 1;
   4.101              }
   4.102              if (c & 2) {
   4.103 -              jj = SDLTest_RandomIntegerInRange(0, _numChannels - 1);
   4.104 +              jj = SDLTest_RandomIntegerInRange(0, _numAudioChannels - 1);
   4.105              } else {
   4.106                jj= j;
   4.107              }
   4.108              if (c & 4) {
   4.109 -              kk = SDLTest_RandomIntegerInRange(0, _numFrequencies - 1);
   4.110 +              kk = SDLTest_RandomIntegerInRange(0, _numAudioFrequencies - 1);
   4.111              } else {
   4.112                kk = k;
   4.113              }
   4.114            } while ((i == ii) && (j == jj) && (k == kk));
   4.115 -          spec2.format = _formats[ii];
   4.116 -          spec2.channels = _channels[jj];
   4.117 -          spec2.freq = _frequencies[kk];
   4.118 +          spec2.format = _audioFormats[ii];
   4.119 +          spec2.channels = _audioChannels[jj];
   4.120 +          spec2.freq = _audioFrequencies[kk];
   4.121          
   4.122            result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq,
   4.123                                             spec2.format, spec2.channels, spec2.freq);
   4.124            SDLTest_AssertPass("Call to SDL_BuildAudioCVT(format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i ==> format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i)", 
   4.125 -            i, _formatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _formatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq);
   4.126 +            i, _audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq);
   4.127            SDLTest_AssertCheck(result == 1, "Verify result value; expected: 1, got: %i", result);
   4.128            if (result != 1) {
   4.129              SDLTest_LogError(SDL_GetError());
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/test/testautomation_pixels.c	Wed May 01 22:14:29 2013 -0700
     5.3 @@ -0,0 +1,168 @@
     5.4 +/**
     5.5 + * Pixels test suite
     5.6 + */
     5.7 +
     5.8 +#include <stdio.h>
     5.9 +
    5.10 +#include "SDL.h"
    5.11 +#include "SDL_test.h"
    5.12 +
    5.13 +/* Test case functions */
    5.14 +
    5.15 +/* Definition of all RGB formats used to test pixel conversions */
    5.16 +const int _numRGBPixelFormats = 30;
    5.17 +Uint32 _RGBPixelFormats[] = 
    5.18 +  {
    5.19 +    SDL_PIXELFORMAT_INDEX1LSB,
    5.20 +    SDL_PIXELFORMAT_INDEX1MSB,
    5.21 +    SDL_PIXELFORMAT_INDEX4LSB,
    5.22 +    SDL_PIXELFORMAT_INDEX4MSB,
    5.23 +    SDL_PIXELFORMAT_INDEX8,
    5.24 +    SDL_PIXELFORMAT_RGB332,
    5.25 +    SDL_PIXELFORMAT_RGB444,
    5.26 +    SDL_PIXELFORMAT_RGB555,
    5.27 +    SDL_PIXELFORMAT_BGR555,
    5.28 +    SDL_PIXELFORMAT_ARGB4444,
    5.29 +    SDL_PIXELFORMAT_RGBA4444,
    5.30 +    SDL_PIXELFORMAT_ABGR4444,
    5.31 +    SDL_PIXELFORMAT_BGRA4444,
    5.32 +    SDL_PIXELFORMAT_ARGB1555,
    5.33 +    SDL_PIXELFORMAT_RGBA5551,
    5.34 +    SDL_PIXELFORMAT_ABGR1555,
    5.35 +    SDL_PIXELFORMAT_BGRA5551,
    5.36 +    SDL_PIXELFORMAT_RGB565,
    5.37 +    SDL_PIXELFORMAT_BGR565,
    5.38 +    SDL_PIXELFORMAT_RGB24,
    5.39 +    SDL_PIXELFORMAT_BGR24,
    5.40 +    SDL_PIXELFORMAT_RGB888,
    5.41 +    SDL_PIXELFORMAT_RGBX8888,
    5.42 +    SDL_PIXELFORMAT_BGR888,
    5.43 +    SDL_PIXELFORMAT_BGRX8888,
    5.44 +    SDL_PIXELFORMAT_ARGB8888,
    5.45 +    SDL_PIXELFORMAT_RGBA8888,
    5.46 +    SDL_PIXELFORMAT_ABGR8888,
    5.47 +    SDL_PIXELFORMAT_BGRA8888,
    5.48 +    SDL_PIXELFORMAT_ARGB2101010
    5.49 +  };
    5.50 +char* _RGBPixelFormatsVerbose[] = 
    5.51 +  {
    5.52 +    "SDL_PIXELFORMAT_INDEX1LSB",
    5.53 +    "SDL_PIXELFORMAT_INDEX1MSB",
    5.54 +    "SDL_PIXELFORMAT_INDEX4LSB",
    5.55 +    "SDL_PIXELFORMAT_INDEX4MSB",
    5.56 +    "SDL_PIXELFORMAT_INDEX8",
    5.57 +    "SDL_PIXELFORMAT_RGB332",
    5.58 +    "SDL_PIXELFORMAT_RGB444",
    5.59 +    "SDL_PIXELFORMAT_RGB555",
    5.60 +    "SDL_PIXELFORMAT_BGR555",
    5.61 +    "SDL_PIXELFORMAT_ARGB4444",
    5.62 +    "SDL_PIXELFORMAT_RGBA4444",
    5.63 +    "SDL_PIXELFORMAT_ABGR4444",
    5.64 +    "SDL_PIXELFORMAT_BGRA4444",
    5.65 +    "SDL_PIXELFORMAT_ARGB1555",
    5.66 +    "SDL_PIXELFORMAT_RGBA5551",
    5.67 +    "SDL_PIXELFORMAT_ABGR1555",
    5.68 +    "SDL_PIXELFORMAT_BGRA5551",
    5.69 +    "SDL_PIXELFORMAT_RGB565",
    5.70 +    "SDL_PIXELFORMAT_BGR565",
    5.71 +    "SDL_PIXELFORMAT_RGB24",
    5.72 +    "SDL_PIXELFORMAT_BGR24",
    5.73 +    "SDL_PIXELFORMAT_RGB888",
    5.74 +    "SDL_PIXELFORMAT_RGBX8888",
    5.75 +    "SDL_PIXELFORMAT_BGR888",
    5.76 +    "SDL_PIXELFORMAT_BGRX8888",
    5.77 +    "SDL_PIXELFORMAT_ARGB8888",
    5.78 +    "SDL_PIXELFORMAT_RGBA8888",
    5.79 +    "SDL_PIXELFORMAT_ABGR8888",
    5.80 +    "SDL_PIXELFORMAT_BGRA8888",
    5.81 +    "SDL_PIXELFORMAT_ARGB2101010"
    5.82 +  };
    5.83 +
    5.84 +/* Definition of all Non-RGB formats used to test pixel conversions */
    5.85 +const int _numNonRGBPixelFormats = 5;
    5.86 +Uint32 _nonRGBPixelFormats[] = 
    5.87 +  {
    5.88 +    SDL_PIXELFORMAT_YV12,
    5.89 +    SDL_PIXELFORMAT_IYUV,
    5.90 +    SDL_PIXELFORMAT_YUY2,
    5.91 +    SDL_PIXELFORMAT_UYVY,
    5.92 +    SDL_PIXELFORMAT_YVYU 
    5.93 +  };
    5.94 +char* _nonRGBPixelFormatsVerbose[] = 
    5.95 +  {
    5.96 +    "SDL_PIXELFORMAT_YV12",
    5.97 +    "SDL_PIXELFORMAT_IYUV",
    5.98 +    "SDL_PIXELFORMAT_YUY2",
    5.99 +    "SDL_PIXELFORMAT_UYVY",
   5.100 +    "SDL_PIXELFORMAT_YVYU" 
   5.101 +  };
   5.102 +
   5.103 +/* Test case functions */
   5.104 +
   5.105 +/**
   5.106 + * @brief Call to SDL_AllocFormat and SDL_FreeFormat
   5.107 + */
   5.108 +int
   5.109 +pixels_allocFreeFormat(void *arg)
   5.110 +{
   5.111 +  int i;
   5.112 +  Uint32 format;
   5.113 +  Uint32 masks;
   5.114 +  SDL_PixelFormat* result;
   5.115 +
   5.116 +  /* RGB formats */
   5.117 +  for (i = 0; i < _numRGBPixelFormats; i++) {
   5.118 +    format = _RGBPixelFormats[i];
   5.119 +    SDLTest_Log("RGB Format: %s (%u)", _RGBPixelFormatsVerbose[i], format);
   5.120 +  
   5.121 +    /* Allocate format */
   5.122 +    result = SDL_AllocFormat(format);
   5.123 +    SDLTest_AssertPass("Call to SDL_AllocFormat()");
   5.124 +    SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");  
   5.125 +    if (result != NULL) {
   5.126 +      SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %u, got %u", format, result->format);  
   5.127 +      SDLTest_AssertCheck(result->BitsPerPixel > 0, "Verify value of result.BitsPerPixel; expected: >0, got %u", result->BitsPerPixel);  
   5.128 +      SDLTest_AssertCheck(result->BytesPerPixel > 0, "Verify value of result.BytesPerPixel; expected: >0, got %u", result->BytesPerPixel);  
   5.129 +      if (result->palette != NULL) {      
   5.130 +         masks = result->Rmask | result->Gmask | result->Bmask | result->Amask;
   5.131 +         SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %u", masks);
   5.132 +      }
   5.133 +      
   5.134 +      /* Deallocate again */
   5.135 +      SDL_FreeFormat(result);
   5.136 +      SDLTest_AssertPass("Call to SDL_FreeFormat()");          
   5.137 +    }
   5.138 +  }
   5.139 +
   5.140 +  /* Non-RGB formats */
   5.141 +  for (i = 0; i < _numNonRGBPixelFormats; i++) {
   5.142 +    format = _nonRGBPixelFormats[i];
   5.143 +    SDLTest_Log("non-RGB Format: %s (%u)", _nonRGBPixelFormatsVerbose[i], format);
   5.144 +  
   5.145 +    /* Try to allocate format */
   5.146 +    result = SDL_AllocFormat(format);
   5.147 +    SDLTest_AssertPass("Call to SDL_AllocFormat()");
   5.148 +    SDLTest_AssertCheck(result == NULL, "Verify result is NULL");  
   5.149 +  }
   5.150 +  
   5.151 +  return TEST_COMPLETED;
   5.152 +}
   5.153 +
   5.154 +/* ================= Test References ================== */
   5.155 +
   5.156 +/* SysWM test cases */
   5.157 +static const SDLTest_TestCaseReference pixelsTest1 =
   5.158 +		{ (SDLTest_TestCaseFp)pixels_allocFreeFormat, "pixels_allocFreeFormat", "Call to SDL_AllocFormat and SDL_FreeFormat", TEST_ENABLED };
   5.159 +
   5.160 +/* Sequence of Pixels test cases */
   5.161 +static const SDLTest_TestCaseReference *pixelsTests[] =  {
   5.162 +	&pixelsTest1, NULL
   5.163 +};
   5.164 +
   5.165 +/* Pixels test suite (global) */
   5.166 +SDLTest_TestSuiteReference pixelsTestSuite = {
   5.167 +	"Pixels",
   5.168 +	NULL,
   5.169 +	pixelsTests,
   5.170 +	NULL
   5.171 +};
     6.1 --- a/test/testautomation_suites.h	Wed May 01 11:59:54 2013 +0200
     6.2 +++ b/test/testautomation_suites.h	Wed May 01 22:14:29 2013 -0700
     6.3 @@ -24,6 +24,7 @@
     6.4  extern SDLTest_TestSuiteReference videoTestSuite;
     6.5  extern SDLTest_TestSuiteReference mouseTestSuite;
     6.6  extern SDLTest_TestSuiteReference timerTestSuite;
     6.7 +extern SDLTest_TestSuiteReference pixelsTestSuite;
     6.8  
     6.9  // All test suites
    6.10  SDLTest_TestSuiteReference *testSuites[] =  {
    6.11 @@ -42,6 +43,7 @@
    6.12  	&videoTestSuite,
    6.13  	&mouseTestSuite,
    6.14  	&timerTestSuite,
    6.15 +	&pixelsTestSuite,
    6.16  	NULL
    6.17  };
    6.18  
     7.1 --- a/test/testautomation_video.c	Wed May 01 11:59:54 2013 +0200
     7.2 +++ b/test/testautomation_video.c	Wed May 01 22:14:29 2013 -0700
     7.3 @@ -1534,7 +1534,7 @@
     7.4    	returnValue = TEST_ABORTED; 
     7.5    	goto cleanup; 
     7.6    }
     7.7 -  userdata2 = (char *)strdup(referenceUserdata2);
     7.8 +  userdata2 = (char *)SDL_strdup(referenceUserdata2);
     7.9    if (userdata2 == NULL) {
    7.10    	returnValue = TEST_ABORTED;
    7.11    	goto cleanup;
    7.12 @@ -1547,7 +1547,7 @@
    7.13    SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
    7.14    
    7.15    /* Set data */
    7.16 -  result = SDL_SetWindowData(window, name, userdata);
    7.17 +  result = (char *)SDL_SetWindowData(window, name, userdata);
    7.18    SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s)", name, userdata);
    7.19    SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
    7.20    SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
    7.21 @@ -1563,7 +1563,7 @@
    7.22    
    7.23    /* Set data again twice */
    7.24    for (iteration = 1; iteration <= 2; iteration++) {
    7.25 -    result = SDL_SetWindowData(window, name, userdata);
    7.26 +    result = (char *)SDL_SetWindowData(window, name, userdata);
    7.27      SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [iteration %d]", name, userdata, iteration);
    7.28      SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result);
    7.29      SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
    7.30 @@ -1577,7 +1577,7 @@
    7.31    SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
    7.32  
    7.33    /* Set data with new data */
    7.34 -  result = SDL_SetWindowData(window, name, userdata2);
    7.35 +  result = (char *)SDL_SetWindowData(window, name, userdata2);
    7.36    SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata]", name, userdata2);
    7.37    SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result);
    7.38    SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
    7.39 @@ -1585,7 +1585,7 @@
    7.40    SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2);
    7.41  
    7.42    /* Set data with new data again */
    7.43 -  result = SDL_SetWindowData(window, name, userdata2);
    7.44 +  result = (char *)SDL_SetWindowData(window, name, userdata2);
    7.45    SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata again]", name, userdata2);
    7.46    SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result);
    7.47    SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
    7.48 @@ -1599,7 +1599,7 @@
    7.49    SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
    7.50  
    7.51    /* Set data with NULL to clear */
    7.52 -  result = SDL_SetWindowData(window, name, NULL);
    7.53 +  result = (char *)SDL_SetWindowData(window, name, NULL);
    7.54    SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL)", name, userdata);
    7.55    SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result);
    7.56    SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
    7.57 @@ -1607,7 +1607,7 @@
    7.58    SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2);
    7.59  
    7.60    /* Set data with NULL to clear again */
    7.61 -  result = SDL_SetWindowData(window, name, NULL);
    7.62 +  result = (char *)SDL_SetWindowData(window, name, NULL);
    7.63    SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL) [again]", name, userdata);
    7.64    SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
    7.65    SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
    7.66 @@ -1627,7 +1627,7 @@
    7.67    SDLTest_AssertCheck(SDL_strcmp(referenceName2, name2) == 0, "Validate that name2 was not changed, expected: %s, got: %s", referenceName2, name2);
    7.68  
    7.69    /* Set data (again) */
    7.70 -  result = SDL_SetWindowData(window, name, userdata);
    7.71 +  result = (char *)SDL_SetWindowData(window, name, userdata);
    7.72    SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [again, after clear]", name, userdata);
    7.73    SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
    7.74    SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
    7.75 @@ -1644,49 +1644,49 @@
    7.76    SDLTest_AssertPass("Call to SDL_ClearError()");
    7.77  
    7.78    /* Set with invalid window */ 
    7.79 -  result = SDL_SetWindowData(NULL, name, userdata);
    7.80 +  result = (char *)SDL_SetWindowData(NULL, name, userdata);
    7.81    SDLTest_AssertPass("Call to SDL_SetWindowData(window=NULL)");
    7.82    SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
    7.83    _checkInvalidWindowError();
    7.84    
    7.85    /* Set data with NULL name, valid userdata */
    7.86 -  result = SDL_SetWindowData(window, NULL, userdata);
    7.87 +  result = (char *)SDL_SetWindowData(window, NULL, userdata);
    7.88    SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL)");
    7.89    SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
    7.90    _checkInvalidParameterError();
    7.91  
    7.92    /* Set data with empty name, valid userdata */
    7.93 -  result = SDL_SetWindowData(window, "", userdata);
    7.94 +  result = (char *)SDL_SetWindowData(window, "", userdata);
    7.95    SDLTest_AssertPass("Call to SDL_SetWindowData(name='')");
    7.96    SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
    7.97    _checkInvalidParameterError();
    7.98  
    7.99    /* Set data with NULL name, NULL userdata */
   7.100 -  result = SDL_SetWindowData(window, NULL, NULL);
   7.101 +  result = (char *)SDL_SetWindowData(window, NULL, NULL);
   7.102    SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL,userdata=NULL)");
   7.103    SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   7.104    _checkInvalidParameterError();
   7.105  
   7.106    /* Set data with empty name, NULL userdata */
   7.107 -  result = SDL_SetWindowData(window, "", NULL);
   7.108 +  result = (char *)SDL_SetWindowData(window, "", NULL);
   7.109    SDLTest_AssertPass("Call to SDL_SetWindowData(name='',userdata=NULL)");
   7.110    SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   7.111    _checkInvalidParameterError();
   7.112  
   7.113    /* Get with invalid window */
   7.114 -  result = SDL_GetWindowData(NULL, name);
   7.115 +  result = (char *)SDL_GetWindowData(NULL, name);
   7.116    SDLTest_AssertPass("Call to SDL_GetWindowData(window=NULL)");
   7.117    SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   7.118    _checkInvalidWindowError();
   7.119    
   7.120    /* Get data with NULL name */
   7.121 -  result = SDL_GetWindowData(window, NULL);
   7.122 +  result = (char *)SDL_GetWindowData(window, NULL);
   7.123    SDLTest_AssertPass("Call to SDL_GetWindowData(name=NULL)");
   7.124    SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   7.125    _checkInvalidParameterError();
   7.126  
   7.127    /* Get data with empty name */
   7.128 -  result = SDL_GetWindowData(window, "");
   7.129 +  result = (char *)SDL_GetWindowData(window, "");
   7.130    SDLTest_AssertPass("Call to SDL_GetWindowData(name='')");
   7.131    SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   7.132    _checkInvalidParameterError();