Test lib updates: updated harness to support filtering, added surface comparer, updated interface to test images; added Render test suite from GSOC project
authorAndreas Schiffler <aschiffler@ferzkopp.net>
Sat, 22 Dec 2012 16:06:55 -0800
changeset 6763 9cbd31a3450b
parent 6762 c680e085a5f2
child 6765 5448f332bfe6
Test lib updates: updated harness to support filtering, added surface comparer, updated interface to test images; added Render test suite from GSOC project
VisualC/SDLtest/SDLtest_VS2010.vcxproj
VisualC/SDLtest/SDLtest_VS2012.vcxproj
include/SDL_test.h
include/SDL_test_compare.h
include/SDL_test_harness.h
include/SDL_test_images.h
src/test/SDL_test_compare.c
src/test/SDL_test_fuzzer.c
src/test/SDL_test_harness.c
src/test/SDL_test_imageBlit.c
src/test/SDL_test_imageBlitBlend.c
src/test/SDL_test_imageFace.c
src/test/SDL_test_imagePrimitives.c
src/test/SDL_test_imagePrimitivesBlend.c
test/testautomation.c
test/tests/testrender.c
test/tests/testsuites.h
--- a/VisualC/SDLtest/SDLtest_VS2010.vcxproj	Thu Dec 20 08:50:36 2012 -0800
+++ b/VisualC/SDLtest/SDLtest_VS2010.vcxproj	Sat Dec 22 16:06:55 2012 -0800
@@ -162,6 +162,7 @@
     <ClInclude Include="..\..\include\SDL_test_md5.h" />
     <ClInclude Include="..\..\include\SDL_test_random.h" />
     <ClInclude Include="..\..\include\SDL_test_images.h" />
+    <ClInclude Include="..\..\include\SDL_test_compare.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\src\test\SDL_test_assert.c" />
@@ -178,6 +179,7 @@
     <ClCompile Include="..\..\src\test\SDL_test_imageFace.c" />
     <ClCompile Include="..\..\src\test\SDL_test_imagePrimitives.c" />
     <ClCompile Include="..\..\src\test\SDL_test_imagePrimitivesBlend.c" />
+    <ClCompile Include="..\..\src\test\SDL_test_compare.c" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
--- a/VisualC/SDLtest/SDLtest_VS2012.vcxproj	Thu Dec 20 08:50:36 2012 -0800
+++ b/VisualC/SDLtest/SDLtest_VS2012.vcxproj	Sat Dec 22 16:06:55 2012 -0800
@@ -166,6 +166,7 @@
     <ClInclude Include="..\..\include\SDL_test_md5.h" />
     <ClInclude Include="..\..\include\SDL_test_random.h" />
     <ClInclude Include="..\..\include\SDL_test_images.h" />
+    <ClInclude Include="..\..\include\SDL_test_compare.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\src\test\SDL_test_assert.c" />
@@ -182,6 +183,7 @@
     <ClCompile Include="..\..\src\test\SDL_test_imageFace.c" />
     <ClCompile Include="..\..\src\test\SDL_test_imagePrimitives.c" />
     <ClCompile Include="..\..\src\test\SDL_test_imagePrimitivesBlend.c" />
+    <ClCompile Include="..\..\src\test\SDL_test_compare.c" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
--- a/include/SDL_test.h	Thu Dec 20 08:50:36 2012 -0800
+++ b/include/SDL_test.h	Sat Dec 22 16:06:55 2012 -0800
@@ -41,6 +41,7 @@
 #include "SDL_test_assert.h"
 #include "SDL_test_harness.h"
 #include "SDL_test_images.h"
+#include "SDL_test_compare.h"
 
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/SDL_test_compare.h	Sat Dec 22 16:06:55 2012 -0800
@@ -0,0 +1,72 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+
+/**
+ *  \file SDL_test_compare.h
+ *  
+ *  Include file for SDL test framework.
+ *
+ *  This code is a part of the SDL2_test library, not the main SDL library.
+ */
+
+/* 
+
+ Defines comparison functions (i.e. for surfaces).
+  
+*/
+
+#ifndef _SDL_test_compare_h
+#define _SDL_test_compare_h
+
+#include "SDL.h"
+#include "SDL_test_images.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+/**
+ * \brief Compares a surface and with reference image data for equality
+ *
+ * \param sur Surface used in comparison
+ * \param img Test Surface used in comparison
+ * \param allowable_error Allowable difference in blending accuracy
+ *
+ * \returns 0 if comparison succeeded, >0 (=number of pixels where comparison failed) if comparison failed, <0 for any other error.
+ */
+int SDLTest_CompareSurfaces(SDL_Surface *sur, SDL_Surface *img, int allowable_error);
+      
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_test_compare_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/include/SDL_test_harness.h	Thu Dec 20 08:50:36 2012 -0800
+++ b/include/SDL_test_harness.h	Sat Dec 22 16:06:55 2012 -0800
@@ -105,11 +105,12 @@
  * \param testSuites Suites containing the test case.
  * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one.
  * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one.
+ * \param filter Filter specification. NULL disables. Case sensitive.
  * \param testIterations Number of iterations to run each test case.
  *
  * \returns Test run result; 0 when all tests passed, 1 if any tests failed.
  */
-int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], char *userRunSeed, Uint64 userExecKey, int testIterations);
+int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], char *userRunSeed, Uint64 userExecKey, char *filter, int testIterations);
          
 
 /* Ends C function definitions when using C++ */
--- a/include/SDL_test_images.h	Thu Dec 20 08:50:36 2012 -0800
+++ b/include/SDL_test_images.h	Sat Dec 22 16:06:55 2012 -0800
@@ -36,6 +36,8 @@
 #ifndef _SDL_test_images_h
 #define _SDL_test_images_h
 
+#include "SDL.h"
+
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
 #ifdef __cplusplus
@@ -44,29 +46,28 @@
 /* *INDENT-ON* */
 #endif
 
-
 /**
  *Type for test images.
  */
 typedef struct SDLTest_SurfaceImage_s {
   int width;
   int height;
-  unsigned int  bytes_per_pixel; /* 3:RGB, 4:RGBA */ 
+  unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ 
   const unsigned char pixel_data[];
 } SDLTest_SurfaceImage_t;
 
 /* Test images */
-const SDLTest_SurfaceImage_t SDLTest_imageBlit;
-const SDLTest_SurfaceImage_t SDLTest_imageBlitColor;
-const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha;
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd;
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend;
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendMod;
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendNone;
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAll;
-const SDLTest_SurfaceImage_t SDLTest_ImageFace;
-const SDLTest_SurfaceImage_t SDLTest_imagePrimitives;
-const SDLTest_SurfaceImage_t SDLTest_imagePrimitivesBlend;
+SDL_Surface *SDLTest_ImageBlit();
+SDL_Surface *SDLTest_ImageBlitColor();
+SDL_Surface *SDLTest_ImageBlitAlpha();
+SDL_Surface *SDLTest_ImageBlitBlendAdd();
+SDL_Surface *SDLTest_ImageBlitBlend();
+SDL_Surface *SDLTest_ImageBlitBlendMod();
+SDL_Surface *SDLTest_ImageBlitBlendNone();
+SDL_Surface *SDLTest_ImageBlitBlendAll();
+SDL_Surface *SDLTest_ImageFace();
+SDL_Surface *SDLTest_ImagePrimitives();
+SDL_Surface *SDLTest_ImagePrimitivesBlend();
 
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/test/SDL_test_compare.c	Sat Dec 22 16:06:55 2012 -0800
@@ -0,0 +1,83 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+
+/*
+
+ Based on automated SDL_Surface tests originally written by Edgar Simo 'bobbens'.
+ 
+ Rewritten for test lib by Andreas Schiffler.
+
+*/
+
+#include "SDL_config.h"
+
+#include "SDL_test.h"
+
+
+int SDLTest_CompareSurfaces( SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error )
+{
+   int ret;
+   int i,j;
+   int bpp, bpp_reference;
+   Uint8 *p, *p_reference;
+   int dist;
+   Uint8 R, G, B, A;
+   Uint8 Rd, Gd, Bd, Ad;
+
+   /* Make surfacee size is the same. */
+   if ((surface->w != referenceSurface->w) || (surface->h != referenceSurface->h))
+   {
+      return -1;
+   }
+
+   SDL_LockSurface( surface );
+   SDL_LockSurface( referenceSurface );
+
+   ret = 0;
+   bpp = surface->format->BytesPerPixel;
+   bpp_reference = referenceSurface->format->BytesPerPixel;
+
+   /* Compare image - should be same format. */
+   for (j=0; j<surface->h; j++) {
+      for (i=0; i<surface->w; i++) {
+         p  = (Uint8 *)surface->pixels + j * surface->pitch + i * bpp;
+         p_reference = (Uint8 *)referenceSurface->pixels + j * referenceSurface->pitch + i * bpp_reference;
+         dist = 0;
+
+         SDL_GetRGBA(*(Uint32*)p, surface->format, &R, &G, &B, &A);
+         SDL_GetRGBA(*(Uint32*)p_reference, referenceSurface->format, &Rd, &Gd, &Bd, &Ad);
+
+         dist += (R-Rd)*(R-Rd);
+         dist += (G-Gd)*(G-Gd);
+         dist += (B-Bd)*(B-Bd);
+                  
+         /* Allow some difference in blending accuracy */
+         if (dist > allowable_error) {
+            ret++;
+         }
+      }
+   }
+
+   SDL_UnlockSurface( surface );
+   SDL_UnlockSurface( referenceSurface );
+
+   return ret;
+}
--- a/src/test/SDL_test_fuzzer.c	Thu Dec 20 08:50:36 2012 -0800
+++ b/src/test/SDL_test_fuzzer.c	Sat Dec 22 16:06:55 2012 -0800
@@ -116,8 +116,8 @@
 Uint64
 SDLTest_RandomUint64()
 {
-	Uint64 value;
-	Uint32 *vp = (void*)&value;
+	Uint64 value = 0;
+	Uint32 *vp = (void *)&value;
 
 	fuzzerInvocationCounter++;
 
@@ -130,8 +130,8 @@
 Sint64
 SDLTest_RandomSint64()
 {
-	Uint64 value;
-	Uint32 *vp = (void*)&value;
+	Uint64 value = 0;
+	Uint32 *vp = (void *)&value;
 
 	fuzzerInvocationCounter++;
 
--- a/src/test/SDL_test_harness.c	Thu Dec 20 08:50:36 2012 -0800
+++ b/src/test/SDL_test_harness.c	Sat Dec 22 16:06:55 2012 -0800
@@ -1,22 +1,22 @@
 /*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
+Simple DirectMedia Layer
+Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
 
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
+This software is provided 'as-is', without any express or implied
+warranty.  In no event will the authors be held liable for any damages
+arising from the use of this software.
 
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
 
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
+1. The origin of this software must not be misrepresented; you must not
+claim that you wrote the original software. If you use this software
+in a product, an acknowledgment in the product documentation would be
+appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
 */
 
 #include "SDL_config.h"
@@ -41,17 +41,17 @@
 static Uint32 SDLTest_TestCaseTimeout = 3600;
 
 /**
- * Generates a random run seed string for the harness. The generated seed
- * will contain alphanumeric characters (0-9A-Z).
- *
- * Note: The returned string needs to be deallocated by the caller.
- *
- * \param length The length of the seed string to generate
- *
- * \returns The generated seed string
- */
+* Generates a random run seed string for the harness. The generated seed
+* will contain alphanumeric characters (0-9A-Z).
+*
+* Note: The returned string needs to be deallocated by the caller.
+*
+* \param length The length of the seed string to generate
+*
+* \returns The generated seed string
+*/
 char *
-SDLTest_GenerateRunSeed(const int length)
+	SDLTest_GenerateRunSeed(const int length)
 {
 	char *seed = NULL;
 	SDLTest_RandomContext randomContext;
@@ -86,18 +86,18 @@
 }
 
 /**
- * Generates an execution key for the fuzzer.
- *
- * \param runSeed		The run seed to use
- * \param suiteName		The name of the test suite
- * \param testName		The name of the test
- * \param iteration		The iteration count
- *
- * \returns The generated execution key to initialize the fuzzer with.
- *
- */
+* Generates an execution key for the fuzzer.
+*
+* \param runSeed		The run seed to use
+* \param suiteName		The name of the test suite
+* \param testName		The name of the test
+* \param iteration		The iteration count
+*
+* \returns The generated execution key to initialize the fuzzer with.
+*
+*/
 Uint64
-SDLTest_GenerateExecKey(char *runSeed, char *suiteName, char *testName, int iteration)
+	SDLTest_GenerateExecKey(char *runSeed, char *suiteName, char *testName, int iteration)
 {
 	SDLTest_Md5Context md5Context;
 	Uint64 *keys;
@@ -157,17 +157,17 @@
 }
 
 /**
- * \brief Set timeout handler for test.
- *
- * Note: SDL_Init(SDL_INIT_TIMER) will be called if it wasn't done so before.
- *
- * \param timeout Timeout interval in seconds.
- * \param callback Function that will be called after timeout has elapsed.
- * 
- * \return Timer id or -1 on failure.
- */
+* \brief Set timeout handler for test.
+*
+* Note: SDL_Init(SDL_INIT_TIMER) will be called if it wasn't done so before.
+*
+* \param timeout Timeout interval in seconds.
+* \param callback Function that will be called after timeout has elapsed.
+* 
+* \return Timer id or -1 on failure.
+*/
 SDL_TimerID
-SDLTest_SetTestTimeout(int timeout, void (*callback)())
+	SDLTest_SetTestTimeout(int timeout, void (*callback)())
 {
 	Uint32 timeoutInMilliseconds;
 	SDL_TimerID timerID;
@@ -201,24 +201,27 @@
 	return timerID;
 }
 
+/**
+* \brief Timeout handler. Aborts test run and exits harness process.
+*/
 void
-SDLTest_BailOut()
+	SDLTest_BailOut()
 {
 	SDLTest_LogError("TestCaseTimeout timer expired. Aborting test run.");
 	exit(TEST_ABORTED); // bail out from the test
 }
 
 /**
- * \brief Execute a test using the given execution key.
- *
- * \param testSuite Suite containing the test case.
- * \param testCase Case to execute.
- * \param execKey Execution key for the fuzzer.
- *
- * \returns Test case result.
- */
+* \brief Execute a test using the given execution key.
+*
+* \param testSuite Suite containing the test case.
+* \param testCase Case to execute.
+* \param execKey Execution key for the fuzzer.
+*
+* \returns Test case result.
+*/
 int
-SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, SDLTest_TestCaseReference *testCase, Uint64 execKey)
+	SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, SDLTest_TestCaseReference *testCase, Uint64 execKey)
 {
 	SDL_TimerID timer = 0;
 	int testResult = 0;
@@ -232,11 +235,12 @@
 
 	if (!testCase->enabled)
 	{
-		SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Skipped");
+		SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Skipped (Disabled)");
 		return TEST_RESULT_SKIPPED;
 	}
 
-        // Initialize fuzzer
+
+	// Initialize fuzzer
 	SDLTest_FuzzerInit(execKey);
 
 	// Reset assert tracker
@@ -315,17 +319,21 @@
 }
 
 /**
- * \brief Execute a test suite using the given run seend and execution key.
- *
- * \param testSuites Suites containing the test case.
- * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one.
- * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one.
- * \param testIterations Number of iterations to run each test case.
- *
- * \returns Test run result; 0 when all tests passed, 1 if any tests failed.
- */
+* \brief Execute a test suite using the given run seend and execution key.
+*
+* The filter string is matched to the suite name (full comparison) to select a single suite,
+* or if no suite matches, it is matched to the test names (full comparison) to select a single test.
+*
+* \param testSuites Suites containing the test case.
+* \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one.
+* \param userExecKey Custom execution key provided by user, or 0 to autogenerate one.
+* \param filter Filter specification. NULL disables. Case sensitive.
+* \param testIterations Number of iterations to run each test case.
+*
+* \returns Test run result; 0 when all tests passed, 1 if any tests failed.
+*/
 int
-SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], char *userRunSeed, Uint64 userExecKey, int testIterations)
+	SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], char *userRunSeed, Uint64 userExecKey, char *filter, int testIterations)
 {
 	int suiteCounter;
 	int testCounter;
@@ -343,6 +351,10 @@
 	float suiteEndSeconds;
 	float testEndSeconds;
 	float runtime;
+	int suiteFilter = 0;
+	char *suiteFilterName = NULL;
+	int testFilter = 0;
+	char *testFilterName = NULL;
 	int testResult = 0;
 	int runResult = 0;
 	Uint32 totalTestFailedCount = 0;
@@ -370,6 +382,7 @@
 		runSeed = userRunSeed;
 	}
 
+
 	// Reset per-run counters
 	totalTestFailedCount = 0;
 	totalTestPassedCount = 0;
@@ -381,121 +394,184 @@
 	// Log run with fuzzer parameters
 	SDLTest_Log("::::: Test Run /w seed '%s' started\n", runSeed);
 
+	// Initialize filtering
+	if (filter != NULL && SDL_strlen(filter) > 0) {
+		/* Loop over all suites to check if we have a filter match */
+		suiteCounter = 0;
+		while (testSuites[suiteCounter] && suiteFilter == 0) {
+			testSuite=(SDLTest_TestSuiteReference *)testSuites[suiteCounter];
+			suiteCounter++;
+			if (testSuite->name != NULL && SDL_strcmp(filter, testSuite->name) == 0) {
+				/* Matched a suite name */
+				suiteFilter = 1;
+				suiteFilterName = testSuite->name;
+				SDLTest_Log("Filtering: running only suite '%s'", suiteFilterName);
+				break;
+			}
+
+			/* Within each suite, loop over all test cases to check if we have a filter match */
+			testCounter = 0;
+			while (testSuite->testCases[testCounter] && testFilter == 0)
+			{
+				testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
+				testCounter++;
+				if (testCase->name != NULL && SDL_strcmp(filter, testCase->name) == 0) {
+					/* Matched a test name */
+					suiteFilter = 1;
+					suiteFilterName = testSuite->name;
+					testFilter = 1;
+					testFilterName = testCase->name;
+					SDLTest_Log("Filtering: running only test '%s' in suite '%s'", testFilterName, suiteFilterName);					
+					break;
+				}
+			}						
+		}
+		
+		if (suiteFilter == 0 && testFilter == 0) {
+			SDLTest_LogError("Filter '%s' did not match any test suite/case.", filter);
+			SDLTest_Log("Exit code: 2");	
+			return 2;
+		}		
+	}
+
 	// Loop over all suites
 	suiteCounter = 0;
 	while(testSuites[suiteCounter]) {
 		testSuite=(SDLTest_TestSuiteReference *)testSuites[suiteCounter];
+		currentSuiteName = (char *)((testSuite->name) ? testSuite->name : SDLTest_InvalidNameFormat);
 		suiteCounter++;
 
-		// Reset per-suite counters
-		testFailedCount = 0;
-		testPassedCount = 0;
-		testSkippedCount = 0;
+		// Filter suite if flag set and we have a name
+		if (suiteFilter == 1 && suiteFilterName != NULL && testSuite->name != NULL &&
+			SDL_strcmp(suiteFilterName, testSuite->name) != 0) {
+				// Skip suite
+				SDLTest_Log("===== Test Suite %i: '%s' skipped\n", 
+					suiteCounter, 
+					currentSuiteName);
+		} else {
 
-		// Take time - suite start
-		suiteStartSeconds = GetClock();
+			// Reset per-suite counters
+			testFailedCount = 0;
+			testPassedCount = 0;
+			testSkippedCount = 0;
+
+			// Take time - suite start
+			suiteStartSeconds = GetClock();
+
+			// Log suite started
+			SDLTest_Log("===== Test Suite %i: '%s' started\n", 
+				suiteCounter, 
+				currentSuiteName);
 
-		// Log suite started
-		currentSuiteName = (char *)((testSuite->name) ? testSuite->name : SDLTest_InvalidNameFormat);
-		SDLTest_Log("===== Test Suite %i: '%s' started\n", 
-			suiteCounter, 
-			currentSuiteName);
+			// Loop over all test cases
+			testCounter = 0;
+			while(testSuite->testCases[testCounter])
+			{
+				testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
+				currentTestName = (char *)((testCase->name) ? testCase->name : SDLTest_InvalidNameFormat);
+				testCounter++;
 
-		// Loop over all test cases
-		testCounter = 0;
-		while(testSuite->testCases[testCounter])
-		{
-			testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
-			testCounter++;
-			
-			// Take time - test start
-			testStartSeconds = GetClock();
+				// Filter tests if flag set and we have a name
+				if (testFilter == 1 && testFilterName != NULL && testCase->name != NULL &&
+					SDL_strcmp(testFilterName, testCase->name) != 0) {
+						// Skip test
+						SDLTest_Log("===== Test Case %i.%i: '%s' skipped\n", 
+							suiteCounter,
+							testCounter,
+							currentTestName);
+				} else {
+
+					// Take time - test start
+					testStartSeconds = GetClock();
+
+					// Log test started
+					SDLTest_Log("----- Test Case %i.%i: '%s' started",
+						suiteCounter,
+						testCounter, 
+						currentTestName);
+					if (testCase->description != NULL && strlen(testCase->description)>0) {
+						SDLTest_Log("Test Description: '%s'", 
+							(testCase->description) ? testCase->description : SDLTest_InvalidNameFormat);
+					}
 
-			// Log test started
-			currentTestName = (char *)((testCase->name) ? testCase->name : SDLTest_InvalidNameFormat);
-			SDLTest_Log("----- Test Case %i.%i: '%s' started",
-			        suiteCounter,
-				testCounter, 
-				currentTestName);
-			if (testCase->description != NULL && strlen(testCase->description)>0) {
-				SDLTest_Log("Test Description: '%s'", 
-					(testCase->description) ? testCase->description : SDLTest_InvalidNameFormat);
-			}
-			
-			// Loop over all iterations
-			iterationCounter = 0;
-			while(iterationCounter < testIterations)
-			{
-				iterationCounter++;
+					// Loop over all iterations
+					iterationCounter = 0;
+					while(iterationCounter < testIterations)
+					{
+						iterationCounter++;
+
+						if (userExecKey != 0) {
+							execKey = userExecKey;
+						} else {
+							execKey = SDLTest_GenerateExecKey(runSeed, testSuite->name, testCase->name, iterationCounter);
+						}
+
+						SDLTest_Log("Test Iteration %i: execKey %llu", iterationCounter, execKey);
+						testResult = SDLTest_RunTest(testSuite, testCase, execKey);
+
+						if (testResult == TEST_RESULT_PASSED) {
+							testPassedCount++;
+							totalTestPassedCount++;
+						} else if (testResult == TEST_RESULT_SKIPPED) {
+							testSkippedCount++;
+							totalTestSkippedCount++;
+						} else {
+							testFailedCount++;
+							totalTestFailedCount++;
+						}
+					}
 
-				if (userExecKey != 0) {
-					execKey = userExecKey;
-				} else {
-					execKey = SDLTest_GenerateExecKey(runSeed, testSuite->name, testCase->name, iterationCounter);
-				}
+					// Take time - test end
+					testEndSeconds = GetClock();
+					runtime = testEndSeconds - testStartSeconds;
+					if (runtime < 0.0f) runtime = 0.0f;
 
-				SDLTest_Log("Test Iteration %i: execKey %llu", iterationCounter, execKey);
-				testResult = SDLTest_RunTest(testSuite, testCase, execKey);
+					if (testIterations > 1) {
+						// Log test runtime
+						SDLTest_Log("Runtime of %i iterations: %.1f sec", testIterations, runtime);
+						SDLTest_Log("Average Test runtime: %.5f sec", runtime / (float)testIterations);
+					} else {
+						// Log test runtime
+						SDLTest_Log("Total Test runtime: %.1f sec", runtime);
+					}
 
-				if (testResult == TEST_RESULT_PASSED) {
-					testPassedCount++;
-					totalTestPassedCount++;
-				} else if (testResult == TEST_RESULT_SKIPPED) {
-					testSkippedCount++;
-					totalTestSkippedCount++;
-				} else {
-					testFailedCount++;
-					totalTestFailedCount++;
+					// Log final test result
+					switch (testResult) {
+					case TEST_RESULT_PASSED:
+						SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", currentTestName, "Passed");
+						break;
+					case TEST_RESULT_FAILED:
+						SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", currentTestName, "Failed");
+						break;
+					case TEST_RESULT_NO_ASSERT:
+						SDLTest_LogError((char *)SDLTest_FinalResultFormat,"Test", currentTestName, "No Asserts");
+						break;
+					}
+
 				}
 			}
 
-			// Take time - test end
-			testEndSeconds = GetClock();
-			runtime = testEndSeconds - testStartSeconds;
+			// Take time - suite end
+			suiteEndSeconds = GetClock();
+			runtime = suiteEndSeconds - suiteStartSeconds;
 			if (runtime < 0.0f) runtime = 0.0f;
 
-			if (testIterations > 1) {
-        			// Log test runtime
-	        		SDLTest_Log("Runtime of %i iterations: %.1f sec", testIterations, runtime);
-	        		SDLTest_Log("Test runtime: %.5f sec", runtime / (float)testIterations);
-                        } else {
-        			// Log test runtime
-	        		SDLTest_Log("Test runtime: %.1f sec", runtime);
-                        }
+			// Log suite runtime
+			SDLTest_Log("Total Suite runtime: %.1f sec", runtime);
 
-			// Log final test result
-			switch (testResult) {
-				case TEST_RESULT_PASSED:
-					SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", currentTestName, "Passed");
-					break;
-				case TEST_RESULT_FAILED:
-					SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", currentTestName, "Failed");
-					break;
-				case TEST_RESULT_NO_ASSERT:
-					SDLTest_LogError((char *)SDLTest_FinalResultFormat,"Test", currentTestName, "No Asserts");
-					break;
+			// Log summary and final Suite result
+			countSum = testPassedCount + testFailedCount + testSkippedCount;
+			if (testFailedCount == 0)
+			{
+				SDLTest_Log(logFormat, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount);
+				SDLTest_Log((char *)SDLTest_FinalResultFormat, "Suite", currentSuiteName, "Passed");
+			} 
+			else 
+			{
+				SDLTest_LogError(logFormat, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount);
+				SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Suite", currentSuiteName, "Failed");
 			}
-		}
 
-		// Take time - suite end
-		suiteEndSeconds = GetClock();
-		runtime = suiteEndSeconds - suiteStartSeconds;
-		if (runtime < 0.0f) runtime = 0.0f;
-
-		// Log suite runtime
-		SDLTest_Log("Suite runtime: %.1f sec", runtime);
-
-		// Log summary and final Suite result
-		countSum = testPassedCount + testFailedCount + testSkippedCount;
-		if (testFailedCount == 0)
-		{
-			SDLTest_Log(logFormat, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount);
-			SDLTest_Log((char *)SDLTest_FinalResultFormat, "Suite", currentSuiteName, "Passed");
-		} 
-		else 
-		{
-			SDLTest_LogError(logFormat, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount);
-			SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Suite", currentSuiteName, "Failed");
 		}
 	}
 
@@ -505,11 +581,11 @@
 	if (runtime < 0.0f) runtime = 0.0f;
 
 	// Log total runtime
-	SDLTest_Log("Total runtime: %.1f sec", runtime);
+	SDLTest_Log("Total Run runtime: %.1f sec", runtime);
 
 	// Log summary and final run result
 	countSum = totalTestPassedCount + totalTestFailedCount + totalTestSkippedCount;
-	if (testFailedCount == 0)
+	if (totalTestFailedCount == 0)
 	{
 		runResult = 0;
 		SDLTest_Log(logFormat, "Run", countSum, totalTestPassedCount, totalTestFailedCount, totalTestSkippedCount);
--- a/src/test/SDL_test_imageBlit.c	Thu Dec 20 08:50:36 2012 -0800
+++ b/src/test/SDL_test_imageBlit.c	Sat Dec 22 16:06:55 2012 -0800
@@ -535,6 +535,32 @@
   "\0\0",
 };
 
+/**
+ * \brief Returns the Blit test image as SDL_Surface.
+ */
+SDL_Surface *SDLTest_ImageBlit()
+{
+   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
+        (void*)SDLTest_imageBlit.pixel_data,
+        SDLTest_imageBlit.width, 
+        SDLTest_imageBlit.height, 
+        SDLTest_imageBlit.bytes_per_pixel * 8, 
+        SDLTest_imageBlit.width * SDLTest_imageBlit.bytes_per_pixel,
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+         0xff000000, /* Red bit mask. */
+         0x00ff0000, /* Green bit mask. */
+         0x0000ff00, /* Blue bit mask. */
+         0x000000ff  /* Alpha bit mask. */
+#else
+         0x000000ff, /* Red bit mask. */
+         0x0000ff00, /* Green bit mask. */
+         0x00ff0000, /* Blue bit mask. */
+         0xff000000  /* Alpha bit mask. */
+#endif
+         );
+   return surface;
+}
+
 const SDLTest_SurfaceImage_t SDLTest_imageBlitColor = {
   80, 60, 3,
   "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
@@ -992,6 +1018,32 @@
   "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
 };
 
+/**
+ * \brief Returns the BlitColor test image as SDL_Surface.
+ */
+SDL_Surface *SDLTest_ImageBlitColor()
+{
+   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
+        (void*)SDLTest_imageBlitColor.pixel_data,
+        SDLTest_imageBlitColor.width, 
+        SDLTest_imageBlitColor.height, 
+        SDLTest_imageBlitColor.bytes_per_pixel * 8, 
+        SDLTest_imageBlitColor.width * SDLTest_imageBlitColor.bytes_per_pixel,
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+         0xff000000, /* Red bit mask. */
+         0x00ff0000, /* Green bit mask. */
+         0x0000ff00, /* Blue bit mask. */
+         0x000000ff  /* Alpha bit mask. */
+#else
+         0x000000ff, /* Red bit mask. */
+         0x0000ff00, /* Green bit mask. */
+         0x00ff0000, /* Blue bit mask. */
+         0xff000000  /* Alpha bit mask. */
+#endif
+         );
+   return surface;
+}
+
 const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha = {
   80, 60, 3,
   "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
@@ -1478,3 +1530,28 @@
   "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
 };
 
+/**
+ * \brief Returns the BlitAlpha test image as SDL_Surface.
+ */
+SDL_Surface *SDLTest_ImageBlitAlpha()
+{
+   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
+        (void*)SDLTest_imageBlitAlpha.pixel_data,
+        SDLTest_imageBlitAlpha.width, 
+        SDLTest_imageBlitAlpha.height, 
+        SDLTest_imageBlitAlpha.bytes_per_pixel * 8,
+        SDLTest_imageBlitAlpha.width * SDLTest_imageBlitAlpha.bytes_per_pixel,
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+         0xff000000, /* Red bit mask. */
+         0x00ff0000, /* Green bit mask. */
+         0x0000ff00, /* Blue bit mask. */
+         0x000000ff  /* Alpha bit mask. */
+#else
+         0x000000ff, /* Red bit mask. */
+         0x0000ff00, /* Green bit mask. */
+         0x00ff0000, /* Blue bit mask. */
+         0xff000000  /* Alpha bit mask. */
+#endif
+         );
+   return surface;
+}
--- a/src/test/SDL_test_imageBlitBlend.c	Thu Dec 20 08:50:36 2012 -0800
+++ b/src/test/SDL_test_imageBlitBlend.c	Sat Dec 22 16:06:55 2012 -0800
@@ -575,6 +575,32 @@
   "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
 };
 
+/**
+ * \brief Returns the BlitBlendAdd test image as SDL_Surface.
+ */
+SDL_Surface *SDLTest_ImageBlitBlendAdd()
+{
+   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
+        (void*)SDLTest_imageBlitBlendAdd.pixel_data,
+        SDLTest_imageBlitBlendAdd.width, 
+        SDLTest_imageBlitBlendAdd.height, 
+        SDLTest_imageBlitBlendAdd.bytes_per_pixel * 8, 
+        SDLTest_imageBlitBlendAdd.width * SDLTest_imageBlitBlendAdd.bytes_per_pixel,
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+         0xff000000, /* Red bit mask. */
+         0x00ff0000, /* Green bit mask. */
+         0x0000ff00, /* Blue bit mask. */
+         0x000000ff  /* Alpha bit mask. */
+#else
+         0x000000ff, /* Red bit mask. */
+         0x0000ff00, /* Green bit mask. */
+         0x00ff0000, /* Blue bit mask. */
+         0xff000000  /* Alpha bit mask. */
+#endif
+         );
+   return surface;
+}
+
 const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = {
   80, 60, 3,
   "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
@@ -1079,6 +1105,32 @@
   "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
 };
 
+/**
+ * \brief Returns the BlitBlend test image as SDL_Surface.
+ */
+SDL_Surface *SDLTest_ImageBlitBlend()
+{
+   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
+        (void*)SDLTest_imageBlitBlend.pixel_data,
+        SDLTest_imageBlitBlend.width, 
+        SDLTest_imageBlitBlend.height, 
+        SDLTest_imageBlitBlend.bytes_per_pixel * 8, 
+        SDLTest_imageBlitBlend.width * SDLTest_imageBlitBlend.bytes_per_pixel,
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+         0xff000000, /* Red bit mask. */
+         0x00ff0000, /* Green bit mask. */
+         0x0000ff00, /* Blue bit mask. */
+         0x000000ff  /* Alpha bit mask. */
+#else
+         0x000000ff, /* Red bit mask. */
+         0x0000ff00, /* Green bit mask. */
+         0x00ff0000, /* Blue bit mask. */
+         0xff000000  /* Alpha bit mask. */
+#endif
+         );
+   return surface;
+}
+
 const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendMod = {
   80, 60, 3,
   "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
@@ -1483,6 +1535,32 @@
   "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
 };
 
+/**
+ * \brief Returns the BlitBlendMod test image as SDL_Surface.
+ */
+SDL_Surface *SDLTest_ImageBlitBlendMod()
+{
+   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
+        (void*)SDLTest_imageBlitBlendMod.pixel_data,
+        SDLTest_imageBlitBlendMod.width, 
+        SDLTest_imageBlitBlendMod.height, 
+        SDLTest_imageBlitBlendMod.bytes_per_pixel * 8, 
+        SDLTest_imageBlitBlendMod.width * SDLTest_imageBlitBlendMod.bytes_per_pixel,
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+         0xff000000, /* Red bit mask. */
+         0x00ff0000, /* Green bit mask. */
+         0x0000ff00, /* Blue bit mask. */
+         0x000000ff  /* Alpha bit mask. */
+#else
+         0x000000ff, /* Red bit mask. */
+         0x0000ff00, /* Green bit mask. */
+         0x00ff0000, /* Blue bit mask. */
+         0xff000000  /* Alpha bit mask. */
+#endif
+         );
+   return surface;
+}
+
 const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendNone = {
   80, 60, 3,
   "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
@@ -2270,6 +2348,32 @@
   "\377\377\377\377\377\377\377\377",
 };
 
+/**
+ * \brief Returns the BlitBlendNone test image as SDL_Surface.
+ */
+SDL_Surface *SDLTest_ImageBlitBlendNone()
+{
+   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
+        (void*)SDLTest_imageBlitBlendNone.pixel_data,
+        SDLTest_imageBlitBlendNone.width, 
+        SDLTest_imageBlitBlendNone.height, 
+        SDLTest_imageBlitBlendNone.bytes_per_pixel * 8, 
+        SDLTest_imageBlitBlendNone.width * SDLTest_imageBlitBlendNone.bytes_per_pixel,
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+         0xff000000, /* Red bit mask. */
+         0x00ff0000, /* Green bit mask. */
+         0x0000ff00, /* Blue bit mask. */
+         0x000000ff  /* Alpha bit mask. */
+#else
+         0x000000ff, /* Red bit mask. */
+         0x0000ff00, /* Green bit mask. */
+         0x00ff0000, /* Blue bit mask. */
+         0xff000000  /* Alpha bit mask. */
+#endif
+         );
+   return surface;
+}
+
 const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAll = {
   80, 60, 3,
   "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
@@ -2712,3 +2816,28 @@
   "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
 };
 
+/**
+ * \brief Returns the BlitBlendAll test image as SDL_Surface.
+ */
+SDL_Surface *SDLTest_ImageBlitBlendAll()
+{
+   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
+        (void*)SDLTest_imageBlitBlendAll.pixel_data,
+        SDLTest_imageBlitBlendAll.width, 
+        SDLTest_imageBlitBlendAll.height, 
+        SDLTest_imageBlitBlendAll.bytes_per_pixel * 8, 
+        SDLTest_imageBlitBlendAll.width * SDLTest_imageBlitBlendAll.bytes_per_pixel,
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+         0xff000000, /* Red bit mask. */
+         0x00ff0000, /* Green bit mask. */
+         0x0000ff00, /* Blue bit mask. */
+         0x000000ff  /* Alpha bit mask. */
+#else
+         0x000000ff, /* Red bit mask. */
+         0x0000ff00, /* Green bit mask. */
+         0x00ff0000, /* Blue bit mask. */
+         0xff000000  /* Alpha bit mask. */
+#endif
+         );
+   return surface;
+}
--- a/src/test/SDL_test_imageFace.c	Thu Dec 20 08:50:36 2012 -0800
+++ b/src/test/SDL_test_imageFace.c	Sat Dec 22 16:06:55 2012 -0800
@@ -24,7 +24,7 @@
 
 /* GIMP RGBA C-Source image dump (face.c) */
 
-const SDLTest_SurfaceImage_t SDLTest_ImageFace = {
+const SDLTest_SurfaceImage_t SDLTest_imageFace = {
   32, 32, 4,
   "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
   "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
@@ -218,3 +218,29 @@
   "\377\377\0\377\377\377\0",
 };
 
+/**
+ * \brief Returns the Face test image as SDL_Surface.
+ */
+SDL_Surface *SDLTest_ImageFace()
+{
+   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
+        (void*)SDLTest_imageFace.pixel_data,
+        SDLTest_imageFace.width, 
+        SDLTest_imageFace.height, 
+        SDLTest_imageFace.bytes_per_pixel * 8, 
+        SDLTest_imageFace.width * SDLTest_imageFace.bytes_per_pixel,
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+         0xff000000, /* Red bit mask. */
+         0x00ff0000, /* Green bit mask. */
+         0x0000ff00, /* Blue bit mask. */
+         0x000000ff  /* Alpha bit mask. */
+#else
+         0x000000ff, /* Red bit mask. */
+         0x0000ff00, /* Green bit mask. */
+         0x00ff0000, /* Blue bit mask. */
+         0xff000000  /* Alpha bit mask. */
+#endif
+         );
+   return surface;
+}
+
--- a/src/test/SDL_test_imagePrimitives.c	Thu Dec 20 08:50:36 2012 -0800
+++ b/src/test/SDL_test_imagePrimitives.c	Sat Dec 22 16:06:55 2012 -0800
@@ -485,3 +485,28 @@
   "\310\15I\310\15I\310\15I\310\15I\310\5ii",
 };
 
+/**
+ * \brief Returns the Primitives test image as SDL_Surface.
+ */
+SDL_Surface *SDLTest_ImagePrimitives()
+{
+   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
+        (void*)SDLTest_imagePrimitives.pixel_data,
+        SDLTest_imagePrimitives.width, 
+        SDLTest_imagePrimitives.height,
+        SDLTest_imagePrimitives.bytes_per_pixel * 8, 
+        SDLTest_imagePrimitives.width * SDLTest_imagePrimitives.bytes_per_pixel,
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+         0xff000000, /* Red bit mask. */
+         0x00ff0000, /* Green bit mask. */
+         0x0000ff00, /* Blue bit mask. */
+         0x000000ff  /* Alpha bit mask. */
+#else
+         0x000000ff, /* Red bit mask. */
+         0x0000ff00, /* Green bit mask. */
+         0x00ff0000, /* Blue bit mask. */
+         0xff000000  /* Alpha bit mask. */
+#endif
+         );
+   return surface;
+}
--- a/src/test/SDL_test_imagePrimitivesBlend.c	Thu Dec 20 08:50:36 2012 -0800
+++ b/src/test/SDL_test_imagePrimitivesBlend.c	Sat Dec 22 16:06:55 2012 -0800
@@ -667,3 +667,28 @@
   "\377\377\377\377\377\377\377\377\324X2\377\377\377\333bB\377\377\377",
 };
 
+/**
+ * \brief Returns the PrimitivesBlend test image as SDL_Surface.
+ */
+SDL_Surface *SDLTest_ImagePrimitivesBlend()
+{
+   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
+        (void*)SDLTest_imagePrimitivesBlend.pixel_data,
+        SDLTest_imagePrimitivesBlend.width, 
+        SDLTest_imagePrimitivesBlend.height, 
+        SDLTest_imagePrimitivesBlend.bytes_per_pixel * 8, 
+        SDLTest_imagePrimitivesBlend.width * SDLTest_imagePrimitivesBlend.bytes_per_pixel,
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+         0xff000000, /* Red bit mask. */
+         0x00ff0000, /* Green bit mask. */
+         0x0000ff00, /* Blue bit mask. */
+         0x000000ff  /* Alpha bit mask. */
+#else
+         0x000000ff, /* Red bit mask. */
+         0x0000ff00, /* Green bit mask. */
+         0x00ff0000, /* Blue bit mask. */
+         0xff000000  /* Alpha bit mask. */
+#endif
+         );
+   return surface;
+}
--- a/test/testautomation.c	Thu Dec 20 08:50:36 2012 -0800
+++ b/test/testautomation.c	Sat Dec 22 16:06:55 2012 -0800
@@ -37,6 +37,7 @@
     int testIterations = 1;
     Uint64 userExecKey = 0;
     char *userRunSeed = NULL;
+    char *filter = NULL;
     int i;
 
     /* Initialize test framework */
@@ -74,6 +75,12 @@
                     consumed = 2;
                 }
             } 
+            else if (SDL_strcasecmp(argv[i], "--filter") == 0) {
+                if (argv[i + 1]) {
+                    filter = SDL_strdup(argv[i + 1]);
+                    consumed = 2;
+                }
+            } 
         }
         if (consumed < 0) {
             fprintf(stderr,
@@ -98,12 +105,15 @@
     }
 
     /* Call Harness */
-    result = SDLTest_RunSuites(testSuites, userRunSeed, userExecKey, testIterations);
+    result = SDLTest_RunSuites(testSuites, userRunSeed, userExecKey, filter, testIterations);
 
     /* Clean up */
     if (userRunSeed != NULL) {
         SDL_free(userRunSeed);
     }
+    if (filter != NULL) {
+        SDL_free(filter);
+    }
         
     /* Shutdown everything */
     quit(result);        
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tests/testrender.c	Sat Dec 22 16:06:55 2012 -0800
@@ -0,0 +1,1025 @@
+/**
+ * Original code: automated SDL platform test written by Edgar Simo "bobbens"
+ * Extended and extensively updated by aschiffler at ferzkopp dot net
+ */
+
+#include <stdio.h>
+
+#include "SDL.h"
+#include "SDL_test.h"
+
+/* ================= Test Case Implementation ================== */
+
+#define TESTRENDER_SCREEN_W     80
+#define TESTRENDER_SCREEN_H     60
+
+#define RENDER_COMPARE_FORMAT  SDL_PIXELFORMAT_ARGB8888
+#define RENDER_COMPARE_AMASK   0xff000000 /**< Alpha bit mask. */
+#define RENDER_COMPARE_RMASK   0x00ff0000 /**< Red bit mask. */
+#define RENDER_COMPARE_GMASK   0x0000ff00 /**< Green bit mask. */
+#define RENDER_COMPARE_BMASK   0x000000ff /**< Blue bit mask. */
+
+#define ALLOWABLE_ERROR_OPAQUE	0
+#define ALLOWABLE_ERROR_BLENDED	64
+
+SDL_Window *window = NULL;
+SDL_Renderer *renderer = NULL;
+
+/* Prototypes for helper functions */
+
+static int _clearScreen (void);
+static void _compare(const char *msg, SDL_Surface *s, int allowable_error);
+static int _hasTexAlpha(void);
+static int _hasTexColor(void);
+static SDL_Texture *_loadTestFace(void);
+static int _hasBlendModes(void);
+static int _hasDrawColor(void);
+static int _isSupported(int code);
+
+/**
+ * Create software renderer for tests
+ */
+void InitCreateRenderer(void *arg)
+{
+  int posX = 100, posY = 100, width = 320, height = 240;
+  renderer = NULL;
+  window = SDL_CreateWindow("render_testCreateRenderer", posX, posY, width, height, 0);
+  SDLTest_AssertPass("SDL_CreateWindow()");
+  SDLTest_AssertCheck(window != NULL, "Check SDL_CreateWindow result");
+  if (window == NULL) {
+      return;
+  }
+  
+  renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
+  SDLTest_AssertPass("SDL_CreateRenderer()");
+  SDLTest_AssertCheck(renderer != 0, "Check SDL_CreateRenderer result");
+  if (renderer == 0) {
+      SDL_DestroyWindow(window);
+      return;
+  }
+}
+
+/*
+ * Destroy renderer for tests  
+ */
+void CleanupDestroyRenderer(void *arg)
+{
+  if (renderer != NULL) {  
+     SDL_DestroyRenderer(renderer);
+     SDLTest_AssertPass("SDL_DestroyRenderer()");
+  }
+  
+  if (window != NULL) {  
+     SDL_DestroyWindow(window);
+     SDLTest_AssertPass("SDL_DestroyWindow");
+  }
+}
+
+
+/**
+ * @brief Tests call to SDL_GetNumRenderDrivers
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_GetNumRenderDrivers
+ */
+int
+render_testGetNumRenderDrivers(void *arg)
+{
+  int n;
+  n = SDL_GetNumRenderDrivers();
+  SDLTest_AssertCheck(n >= 1, "Number of renderers >= 1, reported as %i", n);
+  return TEST_COMPLETED;
+}
+
+
+/**
+ * @brief Tests the SDL primitives for rendering.
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawColor
+ * http://wiki.libsdl.org/moin.cgi/SDL_RenderFillRect
+ * http://wiki.libsdl.org/moin.cgi/SDL_RenderDrawLine
+ *
+ */
+int render_testPrimitives (void *arg)
+{
+   int ret;
+   int x, y;
+   SDL_Rect rect;
+   int checkFailCount1;
+   int checkFailCount2;
+
+   /* Need drawcolour or just skip test. */
+   SDLTest_AssertCheck(_hasDrawColor(), "_hasDrawColor");
+
+   /* Draw a rectangle. */
+   rect.x = 40;
+   rect.y = 0;
+   rect.w = 40;
+   rect.h = 80;
+
+   ret = SDL_SetRenderDrawColor(renderer, 13, 73, 200, SDL_ALPHA_OPAQUE );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
+
+   ret = SDL_RenderFillRect(renderer, &rect );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret);
+
+   /* Draw a rectangle. */
+   rect.x = 10;
+   rect.y = 10;
+   rect.w = 60;
+   rect.h = 40;
+   ret = SDL_SetRenderDrawColor(renderer, 200, 0, 100, SDL_ALPHA_OPAQUE );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
+
+   ret = SDL_RenderFillRect(renderer, &rect );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret);
+
+   /* Draw some points like so:
+    * X.X.X.X..
+    * .X.X.X.X.
+    * X.X.X.X.. */
+   checkFailCount1 = 0;
+   checkFailCount2 = 0;
+   for (y=0; y<3; y++) {
+      for (x = y % 2; x<TESTRENDER_SCREEN_W; x+=2) {
+         ret = SDL_SetRenderDrawColor(renderer, x*y, x*y/2, x*y/3, SDL_ALPHA_OPAQUE );
+         if (ret != 0) checkFailCount1++;
+
+         ret = SDL_RenderDrawPoint(renderer, x, y );
+         if (ret != 0) checkFailCount2++;
+      }
+   }
+   SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetRenderDrawColor, expected: 0, got: %i", checkFailCount1);
+   SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_RenderDrawPoint, expected: 0, got: %i", checkFailCount2);
+
+   /* Draw some lines. */
+   ret = SDL_SetRenderDrawColor(renderer, 0, 255, 0, SDL_ALPHA_OPAQUE );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor");
+
+   ret = SDL_RenderDrawLine(renderer, 0, 30, TESTRENDER_SCREEN_W, 30 );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderDrawLine, expected: 0, got: %i", ret);
+
+   ret = SDL_SetRenderDrawColor(renderer, 55, 55, 5, SDL_ALPHA_OPAQUE );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
+
+   ret = SDL_RenderDrawLine(renderer, 40, 30, 40, 60 );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderDrawLine, expected: 0, got: %i", ret);
+
+   ret = SDL_SetRenderDrawColor(renderer, 5, 105, 105, SDL_ALPHA_OPAQUE );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
+
+   ret = SDL_RenderDrawLine(renderer, 0, 0, 29, 29 );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderDrawLine, expected: 0, got: %i", ret);
+
+   ret = SDL_RenderDrawLine(renderer, 29, 30, 0, 59 );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderDrawLine, expected: 0, got: %i", ret);
+
+   ret = SDL_RenderDrawLine(renderer, 79, 0, 50, 29 );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderDrawLine, expected: 0, got: %i", ret);
+
+   ret = SDL_RenderDrawLine(renderer, 79, 59, 50, 30 );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderDrawLine, expected: 0, got: %i", ret);
+
+   /* See if it's the same. */
+   _compare( "Primitives output not the same.", SDLTest_ImagePrimitives(), ALLOWABLE_ERROR_OPAQUE );
+
+   return TEST_COMPLETED;
+}
+
+/**
+ * @brief Tests the SDL primitives with alpha for rendering.
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawColor
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawBlendMode
+ * http://wiki.libsdl.org/moin.cgi/SDL_RenderFillRect
+ */
+int render_testPrimitivesBlend (void *arg)
+{
+   int ret;
+   int i, j;
+   SDL_Rect rect;
+   int checkFailCount1;
+   int checkFailCount2;
+   int checkFailCount3;
+
+   /* Need drawcolour and blendmode or just skip test. */
+   SDLTest_AssertCheck(_hasDrawColor(), "_hasDrawColor");
+   SDLTest_AssertCheck(_hasBlendModes(), "_hasBlendModes");
+
+   /* Create some rectangles for each blend mode. */
+   ret = SDL_SetRenderDrawColor(renderer, 255, 255, 255, 0 );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
+
+   ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawBlendMode, expected: 0, got: %i", ret);
+
+   ret = SDL_RenderFillRect(renderer, NULL );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret);
+
+   rect.x = 10;
+   rect.y = 25;
+   rect.w = 40;
+   rect.h = 25;
+   ret = SDL_SetRenderDrawColor(renderer, 240, 10, 10, 75 );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
+
+   ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawBlendMode, expected: 0, got: %i", ret);
+
+   ret = SDL_RenderFillRect(renderer, &rect );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret);
+
+   rect.x = 30;
+   rect.y = 40;
+   rect.w = 45;
+   rect.h = 15;
+   ret = SDL_SetRenderDrawColor(renderer, 10, 240, 10, 100 );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
+
+   ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawBlendMode, expected: 0, got: %i", ret);
+
+   ret = SDL_RenderFillRect(renderer, &rect );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret);
+
+   rect.x = 25;
+   rect.y = 25;
+   rect.w = 25;
+   rect.h = 25;
+   ret = SDL_SetRenderDrawColor(renderer, 10, 10, 240, 125 );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
+
+   ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawBlendMode, expected: 0, got: %i", ret);
+
+   ret = SDL_RenderFillRect(renderer, &rect );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret);
+
+
+   /* Draw blended lines, lines for everyone. */
+   checkFailCount1 = 0;
+   checkFailCount2 = 0;
+   checkFailCount3 = 0;
+   for (i=0; i<TESTRENDER_SCREEN_W; i+=2)  {
+      ret = SDL_SetRenderDrawColor(renderer, 60+2*i, 240-2*i, 50, 3*i );
+      if (ret != 0) checkFailCount1++;
+
+      ret = SDL_SetRenderDrawBlendMode(renderer,(((i/2)%3)==0) ? SDL_BLENDMODE_BLEND :
+            (((i/2)%3)==1) ? SDL_BLENDMODE_ADD : SDL_BLENDMODE_NONE );
+      if (ret != 0) checkFailCount2++;
+
+      ret = SDL_RenderDrawLine(renderer, 0, 0, i, 59 );
+      if (ret != 0) checkFailCount3++;
+   }
+   SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetRenderDrawColor, expected: 0, got: %i", checkFailCount1);
+   SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetRenderDrawBlendMode, expected: 0, got: %i", checkFailCount2);
+   SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_RenderDrawLine, expected: 0, got: %i", checkFailCount3);
+   
+   checkFailCount1 = 0;
+   checkFailCount2 = 0;
+   checkFailCount3 = 0;
+   for (i=0; i<TESTRENDER_SCREEN_H; i+=2)  {
+      ret = SDL_SetRenderDrawColor(renderer, 60+2*i, 240-2*i, 50, 3*i );
+      if (ret != 0) checkFailCount1++;
+
+      ret = SDL_SetRenderDrawBlendMode(renderer,(((i/2)%3)==0) ? SDL_BLENDMODE_BLEND :
+            (((i/2)%3)==1) ? SDL_BLENDMODE_ADD : SDL_BLENDMODE_NONE );
+      if (ret != 0) checkFailCount2++;
+
+      ret = SDL_RenderDrawLine(renderer, 0, 0, 79, i );
+      if (ret != 0) checkFailCount3++;
+   }
+   SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetRenderDrawColor, expected: 0, got: %i", checkFailCount1);
+   SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetRenderDrawBlendMode, expected: 0, got: %i", checkFailCount2);
+   SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_RenderDrawLine, expected: 0, got: %i", checkFailCount3);
+
+   /* Draw points. */
+   checkFailCount1 = 0;
+   checkFailCount2 = 0;
+   checkFailCount3 = 0;
+   for (j=0; j<TESTRENDER_SCREEN_H; j+=3) {
+      for (i=0; i<TESTRENDER_SCREEN_W; i+=3) {
+         ret = SDL_SetRenderDrawColor(renderer, j*4, i*3, j*4, i*3 );
+         if (ret != 0) checkFailCount1++;
+
+         ret = SDL_SetRenderDrawBlendMode(renderer, ((((i+j)/3)%3)==0) ? SDL_BLENDMODE_BLEND :
+               ((((i+j)/3)%3)==1) ? SDL_BLENDMODE_ADD : SDL_BLENDMODE_NONE );
+         if (ret != 0) checkFailCount2++;
+
+         ret = SDL_RenderDrawPoint(renderer, i, j );
+         if (ret != 0) checkFailCount3++;
+      }
+   }   
+   SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetRenderDrawColor, expected: 0, got: %i", checkFailCount1);
+   SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetRenderDrawBlendMode, expected: 0, got: %i", checkFailCount2);
+   SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_RenderDrawPoint, expected: 0, got: %i", checkFailCount3);
+
+   /* See if it's the same. */
+   _compare( "Blended primitives output not the same.", SDLTest_ImagePrimitivesBlend(), ALLOWABLE_ERROR_BLENDED );
+
+    return TEST_COMPLETED;
+}
+
+
+
+/**
+ * @brief Tests some blitting routines.
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_RenderCopy
+ * http://wiki.libsdl.org/moin.cgi/SDL_DestroyTexture
+ */
+int
+render_testBlit(void *arg)
+{
+   int ret;
+   SDL_Rect rect;
+   SDL_Texture *tface;
+   Uint32 tformat;
+   int taccess, tw, th;
+   int i, j, ni, nj;
+   int checkFailCount1;
+
+
+   /* Need drawcolour or just skip test. */
+   SDLTest_AssertCheck(_hasDrawColor(), "_hasDrawColor)");
+
+   /* Create face surface. */
+   tface = _loadTestFace();
+   SDLTest_AssertCheck(tface != NULL,  "Verify _loadTestFace() result");
+   if (tface == NULL) {
+       return TEST_ABORTED;
+   }
+
+   /* Constant values. */
+   ret = SDL_QueryTexture(tface, &tformat, &taccess, &tw, &th);
+   SDLTest_AssertCheck(ret == 0, "Verify result from SDL_QueryTexture, expected 0, got %i", ret);
+   rect.w = tw;
+   rect.h = th;
+   ni     = TESTRENDER_SCREEN_W - tw;
+   nj     = TESTRENDER_SCREEN_H - th;
+
+   /* Loop blit. */
+   checkFailCount1 = 0;
+   for (j=0; j <= nj; j+=4) {
+      for (i=0; i <= ni; i+=4) {
+         /* Blitting. */
+         rect.x = i;
+         rect.y = j;
+         ret = SDL_RenderCopy(renderer, tface, NULL, &rect );
+         if (ret != 0) checkFailCount1++;
+      }
+   }
+   SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount1);
+
+   /* Clean up. */
+   SDL_DestroyTexture( tface );
+
+   /* See if it's the same */
+   _compare( "Blit output not the same.", SDLTest_ImageBlit(), ALLOWABLE_ERROR_OPAQUE );
+
+   return TEST_COMPLETED;
+}
+
+
+/**
+ * @brief Blits doing colour tests.
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetTextureColorMod
+ * http://wiki.libsdl.org/moin.cgi/SDL_RenderCopy
+ * http://wiki.libsdl.org/moin.cgi/SDL_DestroyTexture
+ */
+int
+render_testBlitColor (void *arg)
+{
+   int ret;
+   SDL_Rect rect;
+   SDL_Texture *tface;
+   Uint32 tformat;
+   int taccess, tw, th;
+   int i, j, ni, nj;
+   int checkFailCount1;
+   int checkFailCount2;
+
+   /* Create face surface. */
+   tface = _loadTestFace();
+   SDLTest_AssertCheck(tface != NULL, "Verify _loadTestFace() result");
+   if (tface == NULL) {
+       return TEST_ABORTED;
+   }
+
+   /* Constant values. */
+   ret = SDL_QueryTexture(tface, &tformat, &taccess, &tw, &th);
+   SDLTest_AssertCheck(ret == 0, "Verify result from SDL_QueryTexture, expected 0, got %i", ret);
+   rect.w = tw;
+   rect.h = th;
+   ni     = TESTRENDER_SCREEN_W - tw;
+   nj     = TESTRENDER_SCREEN_H - th;
+
+   /* Test blitting with colour mod. */
+   checkFailCount1 = 0;
+   checkFailCount2 = 0;
+   for (j=0; j <= nj; j+=4) {
+      for (i=0; i <= ni; i+=4) {
+         /* Set colour mod. */
+         ret = SDL_SetTextureColorMod( tface, (255/nj)*j, (255/ni)*i, (255/nj)*j );
+         if (ret != 0) checkFailCount1++;
+
+         /* Blitting. */
+         rect.x = i;
+         rect.y = j;
+         ret = SDL_RenderCopy(renderer, tface, NULL, &rect );
+         if (ret != 0) checkFailCount2++;
+      }
+   }
+   SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureColorMod, expected: 0, got: %i", checkFailCount1);
+   SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount2);
+
+   /* Clean up. */
+   SDL_DestroyTexture( tface );
+
+   /* See if it's the same. */
+   _compare( "Blit output not the same (using SDL_SetTextureColorMod).",
+            SDLTest_ImageBlitColor(), ALLOWABLE_ERROR_OPAQUE );
+
+   return TEST_COMPLETED;
+}
+
+
+/**
+ * @brief Tests blitting with alpha.
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetTextureAlphaMod
+ * http://wiki.libsdl.org/moin.cgi/SDL_RenderCopy
+ * http://wiki.libsdl.org/moin.cgi/SDL_DestroyTexture
+ */
+int
+render_testBlitAlpha (void *arg)
+{
+   int ret;
+   SDL_Rect rect;
+   SDL_Texture *tface;
+   Uint32 tformat;
+   int taccess, tw, th;
+   int i, j, ni, nj;
+   int checkFailCount1;
+   int checkFailCount2;
+
+
+   /* Need alpha or just skip test. */
+   SDLTest_AssertCheck(_hasTexAlpha(), "_hasTexAlpha");
+
+   /* Create face surface. */
+   tface = _loadTestFace();
+   SDLTest_AssertCheck(tface != NULL, "Verify _loadTestFace() result");
+   if (tface == NULL) {
+       return TEST_ABORTED;
+   }
+
+   /* Constant values. */
+   ret = SDL_QueryTexture(tface, &tformat, &taccess, &tw, &th);
+   SDLTest_AssertCheck(ret == 0, "Verify result from SDL_QueryTexture, expected 0, got %i", ret);
+   rect.w = tw;
+   rect.h = th;
+   ni     = TESTRENDER_SCREEN_W - tw;
+   nj     = TESTRENDER_SCREEN_H - th;
+
+   /* Test blitting with alpha mod. */
+   checkFailCount1 = 0;
+   checkFailCount2 = 0;
+   for (j=0; j <= nj; j+=4) {
+      for (i=0; i <= ni; i+=4) {
+         /* Set alpha mod. */
+         ret = SDL_SetTextureAlphaMod( tface, (255/ni)*i );
+         if (ret != 0) checkFailCount1++;
+
+         /* Blitting. */
+         rect.x = i;
+         rect.y = j;
+         ret = SDL_RenderCopy(renderer, tface, NULL, &rect );
+         if (ret != 0) checkFailCount2++;
+      }
+   }   
+   SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureAlphaMod, expected: 0, got: %i", checkFailCount1);
+   SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount2);
+
+   /* Clean up. */
+   SDL_DestroyTexture( tface );
+
+   /* See if it's the same. */
+   _compare( "Blit output not the same (using SDL_SetSurfaceAlphaMod).",
+            SDLTest_ImageBlitAlpha(), ALLOWABLE_ERROR_BLENDED );
+
+   return TEST_COMPLETED;
+}
+
+/* Helper functions */
+
+/**
+ * @brief Tests a blend mode.
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetTextureBlendMode
+ * http://wiki.libsdl.org/moin.cgi/SDL_RenderCopy
+ */
+static void
+_testBlitBlendMode( SDL_Texture * tface, int mode )
+{
+   int ret;
+   Uint32 tformat;
+   int taccess, tw, th;
+   int i, j, ni, nj;
+   SDL_Rect rect;
+   int checkFailCount1;
+   int checkFailCount2;
+
+   /* Clear surface. */
+   _clearScreen();
+
+   /* Constant values. */
+   ret = SDL_QueryTexture(tface, &tformat, &taccess, &tw, &th);
+   SDLTest_AssertCheck(ret == 0, "Verify result from SDL_QueryTexture, expected 0, got %i", ret);
+   rect.w = tw;
+   rect.h = th;
+   ni     = TESTRENDER_SCREEN_W - tw;
+   nj     = TESTRENDER_SCREEN_H - th;
+
+   /* Test blend mode. */
+   checkFailCount1 = 0;
+   checkFailCount2 = 0;
+   for (j=0; j <= nj; j+=4) {
+      for (i=0; i <= ni; i+=4) {
+         /* Set blend mode. */
+         ret = SDL_SetTextureBlendMode( tface, (SDL_BlendMode)mode );
+         if (ret != 0) checkFailCount1++;
+
+         /* Blitting. */
+         rect.x = i;
+         rect.y = j;
+         ret = SDL_RenderCopy(renderer, tface, NULL, &rect );
+         if (ret != 0) checkFailCount2++;
+      }
+   }
+   SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureBlendMode, expected: 0, got: %i", checkFailCount1);
+   SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount2);
+}
+
+
+/**
+ * @brief Tests some more blitting routines.
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetTextureColorMod
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetTextureAlphaMod
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetTextureBlendMode
+ * http://wiki.libsdl.org/moin.cgi/SDL_DestroyTexture
+ */
+int
+render_testBlitBlend (void *arg)
+{
+   int ret;
+   SDL_Rect rect;
+   SDL_Texture *tface;
+   Uint32 tformat;
+   int taccess, tw, th;
+   int i, j, ni, nj;
+   int mode;
+   int checkFailCount1;
+   int checkFailCount2;
+   int checkFailCount3;
+   int checkFailCount4;
+
+   SDLTest_AssertCheck(_hasBlendModes(), "_hasBlendModes");
+   SDLTest_AssertCheck(_hasTexColor(), "_hasTexColor");
+   SDLTest_AssertCheck(_hasTexAlpha(), "_hasTexAlpha");
+
+   /* Create face surface. */
+   tface = _loadTestFace();
+   SDLTest_AssertCheck(tface != NULL, "Verify _loadTestFace() result");
+   if (tface == NULL) {
+       return TEST_ABORTED;
+   }
+
+   /* Constant values. */
+   ret = SDL_QueryTexture(tface, &tformat, &taccess, &tw, &th);
+   SDLTest_AssertCheck(ret == 0, "Verify result from SDL_QueryTexture, expected 0, got %i", ret);
+   rect.w = tw;
+   rect.h = th;
+   ni = TESTRENDER_SCREEN_W - tw;
+   nj = TESTRENDER_SCREEN_H - th;
+
+   /* Set alpha mod. */
+   ret = SDL_SetTextureAlphaMod( tface, 100 );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetTextureAlphaMod, expected: 0, got: %i", ret);
+
+   /* Test None. */
+   _testBlitBlendMode( tface, SDL_BLENDMODE_NONE );
+   /* See if it's the same. */
+   _compare( "Blit blending output not the same (using SDL_BLENDMODE_NONE).",
+            SDLTest_ImageBlitBlendNone(), ALLOWABLE_ERROR_OPAQUE ); 
+
+
+   /* Test Blend. */
+   _testBlitBlendMode( tface, SDL_BLENDMODE_BLEND );
+   _compare( "Blit blending output not the same (using SDL_BLENDMODE_BLEND).",
+            SDLTest_ImageBlitBlend(), ALLOWABLE_ERROR_BLENDED );
+
+
+   /* Test Add. */
+   _testBlitBlendMode( tface, SDL_BLENDMODE_ADD );
+   _compare( "Blit blending output not the same (using SDL_BLENDMODE_ADD).",
+            SDLTest_ImageBlitBlendAdd(), ALLOWABLE_ERROR_BLENDED );
+
+   /* Test Mod. */
+   _testBlitBlendMode( tface, SDL_BLENDMODE_MOD);
+   _compare( "Blit blending output not the same (using SDL_BLENDMODE_MOD).",
+            SDLTest_ImageBlitBlendMod(), ALLOWABLE_ERROR_BLENDED );
+
+   /* Clear surface. */
+   _clearScreen();
+
+   /* Loop blit. */
+   checkFailCount1 = 0;
+   checkFailCount2 = 0;
+   checkFailCount3 = 0;
+   checkFailCount4 = 0;
+   for (j=0; j <= nj; j+=4) {
+      for (i=0; i <= ni; i+=4) {
+
+         /* Set colour mod. */
+         ret = SDL_SetTextureColorMod( tface, (255/nj)*j, (255/ni)*i, (255/nj)*j );
+         if (ret != 0) checkFailCount1++;
+
+         /* Set alpha mod. */
+         ret = SDL_SetTextureAlphaMod( tface, (100/ni)*i );
+         if (ret != 0) checkFailCount2++;
+
+         /* Crazy blending mode magic. */
+         mode = (i/4*j/4) % 4;
+         if (mode==0) mode = SDL_BLENDMODE_NONE;
+         else if (mode==1) mode = SDL_BLENDMODE_BLEND;
+         else if (mode==2) mode = SDL_BLENDMODE_ADD;
+         else if (mode==3) mode = SDL_BLENDMODE_MOD;
+         ret = SDL_SetTextureBlendMode( tface, (SDL_BlendMode)mode );
+         if (ret != 0) checkFailCount3++;
+
+         /* Blitting. */
+         rect.x = i;
+         rect.y = j;
+         ret = SDL_RenderCopy(renderer, tface, NULL, &rect );
+         if (ret != 0) checkFailCount4++;
+      }
+   }
+   SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureColorMod, expected: 0, got: %i", checkFailCount1);
+   SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetTextureAlphaMod, expected: 0, got: %i", checkFailCount2);
+   SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_SetTextureBlendMode, expected: 0, got: %i", checkFailCount3);
+   SDLTest_AssertCheck(checkFailCount4 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount4);
+
+   /* Clean up. */
+   SDL_DestroyTexture( tface );
+
+   /* Check to see if matches. */
+   _compare( "Blit blending output not the same (using SDL_BLENDMODE_*).",
+            SDLTest_ImageBlitBlendAll(), ALLOWABLE_ERROR_BLENDED);
+
+   return TEST_COMPLETED;
+}
+
+
+
+/**
+ * @brief Checks to see if functionality is supported. Helper function.
+ */
+static int
+_isSupported( int code )
+{
+   return (code == 0);
+}
+
+/**
+ * @brief Test to see if we can vary the draw colour. Helper function.
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawColor
+ * http://wiki.libsdl.org/moin.cgi/SDL_GetRenderDrawColor
+ */
+static int
+_hasDrawColor (void)
+{
+   int ret, fail;
+   Uint8 r, g, b, a;
+
+   fail = 0;
+
+   /* Set colour. */
+   ret = SDL_SetRenderDrawColor(renderer, 100, 100, 100, 100 );
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = SDL_GetRenderDrawColor(renderer, &r, &g, &b, &a );
+   if (!_isSupported(ret))
+      fail = 1;
+   /* Restore natural. */
+   ret = SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE );
+   if (!_isSupported(ret))
+      fail = 1;
+
+   /* Something failed, consider not available. */
+   if (fail)
+      return 0;
+   /* Not set properly, consider failed. */
+   else if ((r != 100) || (g != 100) || (b != 100) || (a != 100))
+      return 0;
+   return 1;
+}
+
+/**
+ * @brief Test to see if we can vary the blend mode. Helper function.
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawBlendMode
+ * http://wiki.libsdl.org/moin.cgi/SDL_GetRenderDrawBlendMode
+ */
+static int
+_hasBlendModes (void)
+{
+   int fail;
+   int ret;
+   SDL_BlendMode mode;
+
+   fail = 0;
+
+   ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND );
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = SDL_GetRenderDrawBlendMode(renderer, &mode );
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = (mode != SDL_BLENDMODE_BLEND);
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD );
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = SDL_GetRenderDrawBlendMode(renderer, &mode );
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = (mode != SDL_BLENDMODE_ADD);
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_MOD );
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = SDL_GetRenderDrawBlendMode(renderer, &mode );
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = (mode != SDL_BLENDMODE_MOD);
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE );
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = SDL_GetRenderDrawBlendMode(renderer, &mode );
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = (mode != SDL_BLENDMODE_NONE);
+   if (!_isSupported(ret))
+      fail = 1;
+
+   return !fail;
+}
+
+
+/**
+ * @brief Loads the test image 'Face' as texture. Helper function.
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_CreateTextureFromSurface
+ */
+static SDL_Texture *
+_loadTestFace(void)
+{
+   SDL_Surface *face;
+   SDL_Texture *tface;
+
+   face = SDLTest_ImageFace();
+   if (face == NULL) {
+      return NULL;
+   }
+   
+   tface = SDL_CreateTextureFromSurface(renderer, face);
+   if (tface == NULL) {
+       SDLTest_LogError("SDL_CreateTextureFromSurface() failed with error: %s", SDL_GetError());
+   }
+
+   SDL_FreeSurface(face);
+
+   return tface;
+}
+
+
+/**
+ * @brief Test to see if can set texture colour mode. Helper function.
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetTextureColorMod
+ * http://wiki.libsdl.org/moin.cgi/SDL_GetTextureColorMod
+ * http://wiki.libsdl.org/moin.cgi/SDL_DestroyTexture
+ */
+static int
+_hasTexColor (void)
+{
+   int fail;
+   int ret;
+   SDL_Texture *tface;
+   Uint8 r, g, b;
+
+   /* Get test face. */
+   tface = _loadTestFace();
+   if (tface == 0)
+      return 0;
+
+   /* See if supported. */
+   fail = 0;
+   ret = SDL_SetTextureColorMod( tface, 100, 100, 100 );
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = SDL_GetTextureColorMod( tface, &r, &g, &b );
+   if (!_isSupported(ret))
+      fail = 1;
+
+   /* Clean up. */
+   SDL_DestroyTexture( tface );
+
+   if (fail)
+      return 0;
+   else if ((r != 100) || (g != 100) || (b != 100))
+      return 0;
+   return 1;
+}
+
+/**
+ * @brief Test to see if we can vary the alpha of the texture. Helper function.
+ *
+ * \sa
+ *  http://wiki.libsdl.org/moin.cgi/SDL_SetTextureAlphaMod
+ *  http://wiki.libsdl.org/moin.cgi/SDL_GetTextureAlphaMod
+ *  http://wiki.libsdl.org/moin.cgi/SDL_DestroyTexture
+ */
+static int
+_hasTexAlpha(void)
+{
+   int fail;
+   int ret;
+   SDL_Texture *tface;
+   Uint8 a;
+
+   /* Get test face. */
+   tface = _loadTestFace();
+   if (tface == 0)
+      return 0;
+
+   /* See if supported. */
+   fail = 0;
+   ret = SDL_SetTextureAlphaMod( tface, 100 );
+   if (!_isSupported(ret))
+      fail = 1;
+   ret = SDL_GetTextureAlphaMod( tface, &a );
+   if (!_isSupported(ret))
+      fail = 1;
+
+   /* Clean up. */
+   SDL_DestroyTexture( tface );
+
+   if (fail)
+      return 0;
+   else if (a != 100)
+      return 0;
+   return 1;
+}
+
+static _renderCompareCount = 0;
+
+/**
+ * @brief Compares screen pixels with image pixels. Helper function.
+ *
+ * @param msg Message on failure.
+ * @param s Image to compare against.
+ * @return 0 on success.
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_RenderReadPixels
+ * http://wiki.libsdl.org/moin.cgi/SDL_CreateRGBSurfaceFrom
+ * http://wiki.libsdl.org/moin.cgi/SDL_FreeSurface
+ */
+static void
+_compare(const char *msg, SDL_Surface *s, int allowable_error)
+{
+   int ret;
+   SDL_Rect rect;
+   Uint8 pix[4*80*60];
+   SDL_Surface *testsur;
+   char imageFilename[128];
+   char referenceFilename[128];
+
+   /* Read pixels. */
+   /* Explicitly specify the rect in case the window isn't expected size... */
+   rect.x = 0;
+   rect.y = 0;
+   rect.w = 80;
+   rect.h = 60;
+   ret = SDL_RenderReadPixels(renderer, &rect, RENDER_COMPARE_FORMAT, pix, 80*4 );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderReadPixels, expected: 0, got: %i", ret);
+
+   /* Create surface. */
+   testsur = SDL_CreateRGBSurfaceFrom( pix, TESTRENDER_SCREEN_W, TESTRENDER_SCREEN_H, 32, TESTRENDER_SCREEN_W*4,
+                                       RENDER_COMPARE_RMASK, RENDER_COMPARE_GMASK, RENDER_COMPARE_BMASK, RENDER_COMPARE_AMASK);
+   SDLTest_AssertCheck(testsur != NULL, "Verify result from SDL_CreateRGBSurfaceFrom");
+
+   /* Compare surface. */
+   ret = SDLTest_CompareSurfaces( testsur, s, allowable_error );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
+
+   _renderCompareCount++;
+   if (ret != 0) {
+      SDL_snprintf(imageFilename, 127, "image%i.bmp", _renderCompareCount);
+      SDL_SaveBMP(testsur, imageFilename);
+      SDL_snprintf(referenceFilename, 127, "reference%i.bmp", _renderCompareCount);
+      SDL_SaveBMP(s, referenceFilename);
+      SDLTest_LogError("Surfaces from failed comparison saved as %s and %s", imageFilename, referenceFilename);
+   }
+
+   /* Clean up. */
+   SDL_FreeSurface( testsur );
+}
+
+/**
+ * @brief Clears the screen. Helper function.
+ *
+ * \sa
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawColor
+ * http://wiki.libsdl.org/moin.cgi/SDL_RenderFillRect
+ * http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawBlendMode
+ */
+static int
+_clearScreen(void)
+{
+   int ret;
+
+   /* Set colour. */
+   ret = SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
+
+   /* Clear screen. */
+   ret = SDL_RenderFillRect(renderer, NULL );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret);
+
+   /* Set defaults. */
+   ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawBlendMode, expected: 0, got: %i", ret);
+
+   ret = SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE );
+   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
+
+   return 0;
+}
+
+/* ================= Test References ================== */
+
+/* Render test cases */
+static const SDLTest_TestCaseReference renderTest1 =
+		{ (SDLTest_TestCaseFp)render_testGetNumRenderDrivers, "render_testGetNumRenderDrivers", "Tests call to SDL_GetNumRenderDrivers", TEST_ENABLED };
+
+static const SDLTest_TestCaseReference renderTest2 =
+		{ (SDLTest_TestCaseFp)render_testPrimitives, "render_testPrimitives", "Tests rendering primitives", TEST_ENABLED };
+
+static const SDLTest_TestCaseReference renderTest3 =
+		{ (SDLTest_TestCaseFp)render_testPrimitivesBlend, "render_testPrimitivesBlend", "Tests rendering primitives with blending", TEST_ENABLED };
+
+static const SDLTest_TestCaseReference renderTest4 =
+		{ (SDLTest_TestCaseFp)render_testBlit, "render_testBlit", "Tests blitting", TEST_ENABLED };
+
+static const SDLTest_TestCaseReference renderTest5 =
+		{ (SDLTest_TestCaseFp)render_testBlitColor, "render_testBlitColor", "Tests blitting with color", TEST_ENABLED };
+
+static const SDLTest_TestCaseReference renderTest6 =
+		{ (SDLTest_TestCaseFp)render_testBlitAlpha, "render_testBlitAlpha", "Tests blitting with alpha", TEST_ENABLED };
+
+static const SDLTest_TestCaseReference renderTest7 =
+		{  (SDLTest_TestCaseFp)render_testBlitBlend, "render_testBlitBlend", "Tests blitting with blending", TEST_ENABLED };
+
+/* Sequence of Render test cases */
+static const SDLTest_TestCaseReference *renderTests[] =  {
+	&renderTest1, &renderTest2, &renderTest3, &renderTest4, &renderTest5, &renderTest6, &renderTest7, NULL
+};
+
+/* Render test suite (global) */
+SDLTest_TestSuiteReference renderTestSuite = {
+	"Render",
+	InitCreateRenderer,
+	renderTests,
+	CleanupDestroyRenderer
+};
--- a/test/tests/testsuites.h	Thu Dec 20 08:50:36 2012 -0800
+++ b/test/tests/testsuites.h	Sat Dec 22 16:06:55 2012 -0800
@@ -15,7 +15,7 @@
 //extern SDLTest_TestSuiteReference keyboardTestSuite;
 extern SDLTest_TestSuiteReference platformTestSuite;
 extern SDLTest_TestSuiteReference rectTestSuite;
-//extern SDLTest_TestSuiteReference renderTestSuite;
+extern SDLTest_TestSuiteReference renderTestSuite;
 extern SDLTest_TestSuiteReference rwopsTestSuite;
 //extern SDLTest_TestSuiteReference surfaceTestSuite;
 //extern SDLTest_TestSuiteReference syswmTestSuite;
@@ -29,7 +29,7 @@
 //	&keyboardTestSuite,
 	&platformTestSuite,
 	&rectTestSuite,
-//	&renderTestSuite,
+	&renderTestSuite,
 	&rwopsTestSuite,
 //	&surfaceTestSuite,
 //	&syswmTestSuite,