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 7134 09ee216e6a25
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
--- a/VisualC/tests/testautomation/testautomation_vs2010.vcxproj	Wed May 01 11:59:54 2013 +0200
+++ b/VisualC/tests/testautomation/testautomation_vs2010.vcxproj	Wed May 01 22:14:29 2013 -0700
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -192,6 +192,7 @@
     <ClCompile Include="..\..\..\test\testautomation_sdltest.c" />
     <ClCompile Include="..\..\..\test\testautomation_mouse.c" />
     <ClCompile Include="..\..\..\test\testautomation_timer.c" />
+    <ClCompile Include="..\..\..\test\testautomation_pixels.c" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\test\testautomation_suites.h" />
--- a/VisualC/tests/testautomation/testautomation_vs2012.vcxproj	Wed May 01 11:59:54 2013 +0200
+++ b/VisualC/tests/testautomation/testautomation_vs2012.vcxproj	Wed May 01 22:14:29 2013 -0700
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -196,6 +196,7 @@
     <ClCompile Include="..\..\..\test\testautomation_sdltest.c" />
     <ClCompile Include="..\..\..\test\testautomation_mouse.c" />
     <ClCompile Include="..\..\..\test\testautomation_timer.c" />
+    <ClCompile Include="..\..\..\test\testautomation_pixels.c" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\test\testautomation_suites.h" />
--- a/test/Makefile.in	Wed May 01 11:59:54 2013 +0200
+++ b/test/Makefile.in	Wed May 01 22:14:29 2013 -0700
@@ -83,7 +83,8 @@
 		      $(srcdir)/testautomation_syswm.c \
 		      $(srcdir)/testautomation_sdltest.c \
 		      $(srcdir)/testautomation_mouse.c \
-		      $(srcdir)/testautomation_timer.c
+		      $(srcdir)/testautomation_timer.c \
+		      $(srcdir)/testautomation_pixels.c		      
 	$(CC) -o $@ $^ $(CFLAGS) -lSDL2_test $(LIBS) 
 
 testmultiaudio$(EXE): $(srcdir)/testmultiaudio.c
--- a/test/testautomation_audio.c	Wed May 01 11:59:54 2013 +0200
+++ b/test/testautomation_audio.c	Wed May 01 22:14:29 2013 -0700
@@ -117,11 +117,10 @@
  */
 int audio_initOpenCloseQuitAudio()
 {
-        int result;
+    int result;
 	int i, iMax, j;
 	const char* audioDriver;
 	SDL_AudioSpec desired;
-	SDL_AudioSpec obtained;
 	
 	/* Stop SDL audio subsystem */
 	SDL_QuitSubSystem( SDL_INIT_AUDIO );
@@ -347,17 +346,17 @@
 }
 
 /* Definition of all formats, channels, and frequencies used to test audio conversions */
-const int _numFormats = 18;
-SDL_AudioFormat _formats[] = { AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_S16SYS, AUDIO_S16, AUDIO_U16LSB, 
+const int _numAudioFormats = 18;
+SDL_AudioFormat _audioFormats[] = { AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_S16SYS, AUDIO_S16, AUDIO_U16LSB, 
 				AUDIO_U16MSB, AUDIO_U16SYS, AUDIO_U16, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_S32SYS, AUDIO_S32, 
                                 AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_F32SYS, AUDIO_F32 };
-char *_formatsVerbose[] = { "AUDIO_S8", "AUDIO_U8", "AUDIO_S16LSB", "AUDIO_S16MSB", "AUDIO_S16SYS", "AUDIO_S16", "AUDIO_U16LSB", 
+char *_audioFormatsVerbose[] = { "AUDIO_S8", "AUDIO_U8", "AUDIO_S16LSB", "AUDIO_S16MSB", "AUDIO_S16SYS", "AUDIO_S16", "AUDIO_U16LSB", 
 				"AUDIO_U16MSB", "AUDIO_U16SYS", "AUDIO_U16", "AUDIO_S32LSB", "AUDIO_S32MSB", "AUDIO_S32SYS", "AUDIO_S32", 
                                 "AUDIO_F32LSB", "AUDIO_F32MSB", "AUDIO_F32SYS", "AUDIO_F32" };
-const int _numChannels = 4;
-Uint8 _channels[] = { 1, 2, 4, 6 };
-const int _numFrequencies = 4;
-int _frequencies[] = { 11025, 22050, 44100, 48000 };
+const int _numAudioChannels = 4;
+Uint8 _audioChannels[] = { 1, 2, 4, 6 };
+const int _numAudioFrequencies = 4;
+int _audioFrequencies[] = { 11025, 22050, 44100, 48000 };
 
 
 /**
@@ -395,22 +394,22 @@
   SDLTest_AssertCheck(result == 1, "Verify result value; expected: 1, got: %i", result);
 
   /* All source conversions with random conversion targets, allow 'null' conversions */
-  for (i = 0; i < _numFormats; i++) {
-    for (j = 0; j < _numChannels; j++) {
-      for (k = 0; k < _numFrequencies; k++) {
-        spec1.format = _formats[i];
-        spec1.channels = _channels[j];
-        spec1.freq = _frequencies[k];
-        ii = SDLTest_RandomIntegerInRange(0, _numFormats - 1);
-        jj = SDLTest_RandomIntegerInRange(0, _numChannels - 1);
-        kk = SDLTest_RandomIntegerInRange(0, _numFrequencies - 1);
-        spec2.format = _formats[ii];
-        spec2.channels = _channels[jj];
-        spec2.freq = _frequencies[kk];
+  for (i = 0; i < _numAudioFormats; i++) {
+    for (j = 0; j < _numAudioChannels; j++) {
+      for (k = 0; k < _numAudioFrequencies; k++) {
+        spec1.format = _audioFormats[i];
+        spec1.channels = _audioChannels[j];
+        spec1.freq = _audioFrequencies[k];
+        ii = SDLTest_RandomIntegerInRange(0, _numAudioFormats - 1);
+        jj = SDLTest_RandomIntegerInRange(0, _numAudioChannels - 1);
+        kk = SDLTest_RandomIntegerInRange(0, _numAudioFrequencies - 1);
+        spec2.format = _audioFormats[ii];
+        spec2.channels = _audioChannels[jj];
+        spec2.freq = _audioFrequencies[kk];
         result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq,
                                          spec2.format, spec2.channels, spec2.freq);
         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)", 
-            i, _formatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _formatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq);
+            i, _audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq);
         SDLTest_AssertCheck(result == 0 || result == 1, "Verify result value; expected: 0 or 1, got: %i", result);
         if (result<0) {
           SDLTest_LogError(SDL_GetError());
@@ -691,39 +690,39 @@
     }
     SDLTest_Log(message);
     /* All source conversions with random conversion targets */
-    for (i = 0; i < _numFormats; i++) {
-      for (j = 0; j < _numChannels; j++) {
-        for (k = 0; k < _numFrequencies; k++) {        
-          spec1.format = _formats[i];
-          spec1.channels = _channels[j];
-          spec1.freq = _frequencies[k];
+    for (i = 0; i < _numAudioFormats; i++) {
+      for (j = 0; j < _numAudioChannels; j++) {
+        for (k = 0; k < _numAudioFrequencies; k++) {        
+          spec1.format = _audioFormats[i];
+          spec1.channels = _audioChannels[j];
+          spec1.freq = _audioFrequencies[k];
         
           /* Ensure we have a different target format */
           do {
             if (c & 1) {
-              ii = SDLTest_RandomIntegerInRange(0, _numFormats - 1);
+              ii = SDLTest_RandomIntegerInRange(0, _numAudioFormats - 1);
             } else {
               ii = 1;
             }
             if (c & 2) {
-              jj = SDLTest_RandomIntegerInRange(0, _numChannels - 1);
+              jj = SDLTest_RandomIntegerInRange(0, _numAudioChannels - 1);
             } else {
               jj= j;
             }
             if (c & 4) {
-              kk = SDLTest_RandomIntegerInRange(0, _numFrequencies - 1);
+              kk = SDLTest_RandomIntegerInRange(0, _numAudioFrequencies - 1);
             } else {
               kk = k;
             }
           } while ((i == ii) && (j == jj) && (k == kk));
-          spec2.format = _formats[ii];
-          spec2.channels = _channels[jj];
-          spec2.freq = _frequencies[kk];
+          spec2.format = _audioFormats[ii];
+          spec2.channels = _audioChannels[jj];
+          spec2.freq = _audioFrequencies[kk];
         
           result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq,
                                            spec2.format, spec2.channels, spec2.freq);
           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)", 
-            i, _formatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _formatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq);
+            i, _audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq);
           SDLTest_AssertCheck(result == 1, "Verify result value; expected: 1, got: %i", result);
           if (result != 1) {
             SDLTest_LogError(SDL_GetError());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/testautomation_pixels.c	Wed May 01 22:14:29 2013 -0700
@@ -0,0 +1,168 @@
+/**
+ * Pixels test suite
+ */
+
+#include <stdio.h>
+
+#include "SDL.h"
+#include "SDL_test.h"
+
+/* Test case functions */
+
+/* Definition of all RGB formats used to test pixel conversions */
+const int _numRGBPixelFormats = 30;
+Uint32 _RGBPixelFormats[] = 
+  {
+    SDL_PIXELFORMAT_INDEX1LSB,
+    SDL_PIXELFORMAT_INDEX1MSB,
+    SDL_PIXELFORMAT_INDEX4LSB,
+    SDL_PIXELFORMAT_INDEX4MSB,
+    SDL_PIXELFORMAT_INDEX8,
+    SDL_PIXELFORMAT_RGB332,
+    SDL_PIXELFORMAT_RGB444,
+    SDL_PIXELFORMAT_RGB555,
+    SDL_PIXELFORMAT_BGR555,
+    SDL_PIXELFORMAT_ARGB4444,
+    SDL_PIXELFORMAT_RGBA4444,
+    SDL_PIXELFORMAT_ABGR4444,
+    SDL_PIXELFORMAT_BGRA4444,
+    SDL_PIXELFORMAT_ARGB1555,
+    SDL_PIXELFORMAT_RGBA5551,
+    SDL_PIXELFORMAT_ABGR1555,
+    SDL_PIXELFORMAT_BGRA5551,
+    SDL_PIXELFORMAT_RGB565,
+    SDL_PIXELFORMAT_BGR565,
+    SDL_PIXELFORMAT_RGB24,
+    SDL_PIXELFORMAT_BGR24,
+    SDL_PIXELFORMAT_RGB888,
+    SDL_PIXELFORMAT_RGBX8888,
+    SDL_PIXELFORMAT_BGR888,
+    SDL_PIXELFORMAT_BGRX8888,
+    SDL_PIXELFORMAT_ARGB8888,
+    SDL_PIXELFORMAT_RGBA8888,
+    SDL_PIXELFORMAT_ABGR8888,
+    SDL_PIXELFORMAT_BGRA8888,
+    SDL_PIXELFORMAT_ARGB2101010
+  };
+char* _RGBPixelFormatsVerbose[] = 
+  {
+    "SDL_PIXELFORMAT_INDEX1LSB",
+    "SDL_PIXELFORMAT_INDEX1MSB",
+    "SDL_PIXELFORMAT_INDEX4LSB",
+    "SDL_PIXELFORMAT_INDEX4MSB",
+    "SDL_PIXELFORMAT_INDEX8",
+    "SDL_PIXELFORMAT_RGB332",
+    "SDL_PIXELFORMAT_RGB444",
+    "SDL_PIXELFORMAT_RGB555",
+    "SDL_PIXELFORMAT_BGR555",
+    "SDL_PIXELFORMAT_ARGB4444",
+    "SDL_PIXELFORMAT_RGBA4444",
+    "SDL_PIXELFORMAT_ABGR4444",
+    "SDL_PIXELFORMAT_BGRA4444",
+    "SDL_PIXELFORMAT_ARGB1555",
+    "SDL_PIXELFORMAT_RGBA5551",
+    "SDL_PIXELFORMAT_ABGR1555",
+    "SDL_PIXELFORMAT_BGRA5551",
+    "SDL_PIXELFORMAT_RGB565",
+    "SDL_PIXELFORMAT_BGR565",
+    "SDL_PIXELFORMAT_RGB24",
+    "SDL_PIXELFORMAT_BGR24",
+    "SDL_PIXELFORMAT_RGB888",
+    "SDL_PIXELFORMAT_RGBX8888",
+    "SDL_PIXELFORMAT_BGR888",
+    "SDL_PIXELFORMAT_BGRX8888",
+    "SDL_PIXELFORMAT_ARGB8888",
+    "SDL_PIXELFORMAT_RGBA8888",
+    "SDL_PIXELFORMAT_ABGR8888",
+    "SDL_PIXELFORMAT_BGRA8888",
+    "SDL_PIXELFORMAT_ARGB2101010"
+  };
+
+/* Definition of all Non-RGB formats used to test pixel conversions */
+const int _numNonRGBPixelFormats = 5;
+Uint32 _nonRGBPixelFormats[] = 
+  {
+    SDL_PIXELFORMAT_YV12,
+    SDL_PIXELFORMAT_IYUV,
+    SDL_PIXELFORMAT_YUY2,
+    SDL_PIXELFORMAT_UYVY,
+    SDL_PIXELFORMAT_YVYU 
+  };
+char* _nonRGBPixelFormatsVerbose[] = 
+  {
+    "SDL_PIXELFORMAT_YV12",
+    "SDL_PIXELFORMAT_IYUV",
+    "SDL_PIXELFORMAT_YUY2",
+    "SDL_PIXELFORMAT_UYVY",
+    "SDL_PIXELFORMAT_YVYU" 
+  };
+
+/* Test case functions */
+
+/**
+ * @brief Call to SDL_AllocFormat and SDL_FreeFormat
+ */
+int
+pixels_allocFreeFormat(void *arg)
+{
+  int i;
+  Uint32 format;
+  Uint32 masks;
+  SDL_PixelFormat* result;
+
+  /* RGB formats */
+  for (i = 0; i < _numRGBPixelFormats; i++) {
+    format = _RGBPixelFormats[i];
+    SDLTest_Log("RGB Format: %s (%u)", _RGBPixelFormatsVerbose[i], format);
+  
+    /* Allocate format */
+    result = SDL_AllocFormat(format);
+    SDLTest_AssertPass("Call to SDL_AllocFormat()");
+    SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");  
+    if (result != NULL) {
+      SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %u, got %u", format, result->format);  
+      SDLTest_AssertCheck(result->BitsPerPixel > 0, "Verify value of result.BitsPerPixel; expected: >0, got %u", result->BitsPerPixel);  
+      SDLTest_AssertCheck(result->BytesPerPixel > 0, "Verify value of result.BytesPerPixel; expected: >0, got %u", result->BytesPerPixel);  
+      if (result->palette != NULL) {      
+         masks = result->Rmask | result->Gmask | result->Bmask | result->Amask;
+         SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %u", masks);
+      }
+      
+      /* Deallocate again */
+      SDL_FreeFormat(result);
+      SDLTest_AssertPass("Call to SDL_FreeFormat()");          
+    }
+  }
+
+  /* Non-RGB formats */
+  for (i = 0; i < _numNonRGBPixelFormats; i++) {
+    format = _nonRGBPixelFormats[i];
+    SDLTest_Log("non-RGB Format: %s (%u)", _nonRGBPixelFormatsVerbose[i], format);
+  
+    /* Try to allocate format */
+    result = SDL_AllocFormat(format);
+    SDLTest_AssertPass("Call to SDL_AllocFormat()");
+    SDLTest_AssertCheck(result == NULL, "Verify result is NULL");  
+  }
+  
+  return TEST_COMPLETED;
+}
+
+/* ================= Test References ================== */
+
+/* SysWM test cases */
+static const SDLTest_TestCaseReference pixelsTest1 =
+		{ (SDLTest_TestCaseFp)pixels_allocFreeFormat, "pixels_allocFreeFormat", "Call to SDL_AllocFormat and SDL_FreeFormat", TEST_ENABLED };
+
+/* Sequence of Pixels test cases */
+static const SDLTest_TestCaseReference *pixelsTests[] =  {
+	&pixelsTest1, NULL
+};
+
+/* Pixels test suite (global) */
+SDLTest_TestSuiteReference pixelsTestSuite = {
+	"Pixels",
+	NULL,
+	pixelsTests,
+	NULL
+};
--- a/test/testautomation_suites.h	Wed May 01 11:59:54 2013 +0200
+++ b/test/testautomation_suites.h	Wed May 01 22:14:29 2013 -0700
@@ -24,6 +24,7 @@
 extern SDLTest_TestSuiteReference videoTestSuite;
 extern SDLTest_TestSuiteReference mouseTestSuite;
 extern SDLTest_TestSuiteReference timerTestSuite;
+extern SDLTest_TestSuiteReference pixelsTestSuite;
 
 // All test suites
 SDLTest_TestSuiteReference *testSuites[] =  {
@@ -42,6 +43,7 @@
 	&videoTestSuite,
 	&mouseTestSuite,
 	&timerTestSuite,
+	&pixelsTestSuite,
 	NULL
 };
 
--- a/test/testautomation_video.c	Wed May 01 11:59:54 2013 +0200
+++ b/test/testautomation_video.c	Wed May 01 22:14:29 2013 -0700
@@ -1534,7 +1534,7 @@
   	returnValue = TEST_ABORTED; 
   	goto cleanup; 
   }
-  userdata2 = (char *)strdup(referenceUserdata2);
+  userdata2 = (char *)SDL_strdup(referenceUserdata2);
   if (userdata2 == NULL) {
   	returnValue = TEST_ABORTED;
   	goto cleanup;
@@ -1547,7 +1547,7 @@
   SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
   
   /* Set data */
-  result = SDL_SetWindowData(window, name, userdata);
+  result = (char *)SDL_SetWindowData(window, name, userdata);
   SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s)", name, userdata);
   SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
@@ -1563,7 +1563,7 @@
   
   /* Set data again twice */
   for (iteration = 1; iteration <= 2; iteration++) {
-    result = SDL_SetWindowData(window, name, userdata);
+    result = (char *)SDL_SetWindowData(window, name, userdata);
     SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [iteration %d]", name, userdata, iteration);
     SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result);
     SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
@@ -1577,7 +1577,7 @@
   SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
 
   /* Set data with new data */
-  result = SDL_SetWindowData(window, name, userdata2);
+  result = (char *)SDL_SetWindowData(window, name, userdata2);
   SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata]", name, userdata2);
   SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result);
   SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
@@ -1585,7 +1585,7 @@
   SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2);
 
   /* Set data with new data again */
-  result = SDL_SetWindowData(window, name, userdata2);
+  result = (char *)SDL_SetWindowData(window, name, userdata2);
   SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata again]", name, userdata2);
   SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result);
   SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
@@ -1599,7 +1599,7 @@
   SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
 
   /* Set data with NULL to clear */
-  result = SDL_SetWindowData(window, name, NULL);
+  result = (char *)SDL_SetWindowData(window, name, NULL);
   SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL)", name, userdata);
   SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result);
   SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
@@ -1607,7 +1607,7 @@
   SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2);
 
   /* Set data with NULL to clear again */
-  result = SDL_SetWindowData(window, name, NULL);
+  result = (char *)SDL_SetWindowData(window, name, NULL);
   SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL) [again]", name, userdata);
   SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
@@ -1627,7 +1627,7 @@
   SDLTest_AssertCheck(SDL_strcmp(referenceName2, name2) == 0, "Validate that name2 was not changed, expected: %s, got: %s", referenceName2, name2);
 
   /* Set data (again) */
-  result = SDL_SetWindowData(window, name, userdata);
+  result = (char *)SDL_SetWindowData(window, name, userdata);
   SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [again, after clear]", name, userdata);
   SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
@@ -1644,49 +1644,49 @@
   SDLTest_AssertPass("Call to SDL_ClearError()");
 
   /* Set with invalid window */ 
-  result = SDL_SetWindowData(NULL, name, userdata);
+  result = (char *)SDL_SetWindowData(NULL, name, userdata);
   SDLTest_AssertPass("Call to SDL_SetWindowData(window=NULL)");
   SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   _checkInvalidWindowError();
   
   /* Set data with NULL name, valid userdata */
-  result = SDL_SetWindowData(window, NULL, userdata);
+  result = (char *)SDL_SetWindowData(window, NULL, userdata);
   SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL)");
   SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   _checkInvalidParameterError();
 
   /* Set data with empty name, valid userdata */
-  result = SDL_SetWindowData(window, "", userdata);
+  result = (char *)SDL_SetWindowData(window, "", userdata);
   SDLTest_AssertPass("Call to SDL_SetWindowData(name='')");
   SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   _checkInvalidParameterError();
 
   /* Set data with NULL name, NULL userdata */
-  result = SDL_SetWindowData(window, NULL, NULL);
+  result = (char *)SDL_SetWindowData(window, NULL, NULL);
   SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL,userdata=NULL)");
   SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   _checkInvalidParameterError();
 
   /* Set data with empty name, NULL userdata */
-  result = SDL_SetWindowData(window, "", NULL);
+  result = (char *)SDL_SetWindowData(window, "", NULL);
   SDLTest_AssertPass("Call to SDL_SetWindowData(name='',userdata=NULL)");
   SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   _checkInvalidParameterError();
 
   /* Get with invalid window */
-  result = SDL_GetWindowData(NULL, name);
+  result = (char *)SDL_GetWindowData(NULL, name);
   SDLTest_AssertPass("Call to SDL_GetWindowData(window=NULL)");
   SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   _checkInvalidWindowError();
   
   /* Get data with NULL name */
-  result = SDL_GetWindowData(window, NULL);
+  result = (char *)SDL_GetWindowData(window, NULL);
   SDLTest_AssertPass("Call to SDL_GetWindowData(name=NULL)");
   SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   _checkInvalidParameterError();
 
   /* Get data with empty name */
-  result = SDL_GetWindowData(window, "");
+  result = (char *)SDL_GetWindowData(window, "");
   SDLTest_AssertPass("Call to SDL_GetWindowData(name='')");
   SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
   _checkInvalidParameterError();