Add missing VS project dependencies to fix buildbot build; fix surface suite; minor update to rwops suite
authorAndreas Schiffler <aschiffler@ferzkopp.net>
Sun, 30 Dec 2012 10:58:18 -0800
changeset 6779 c3b579c78059
parent 6778 d57d273d74f9
child 6780 111b37940b35
Add missing VS project dependencies to fix buildbot build; fix surface suite; minor update to rwops suite
VisualC/SDL_VS2010.sln
VisualC/SDL_VS2012.sln
VisualC/tests/testautomation/testautomation_vs2010.vcxproj
VisualC/tests/testautomation/testautomation_vs2012.vcxproj
test/testautomation_rwops.c
test/testautomation_surface.c
--- a/VisualC/SDL_VS2010.sln	Sun Dec 30 09:58:03 2012 -0800
+++ b/VisualC/SDL_VS2010.sln	Sun Dec 30 10:58:18 2012 -0800
@@ -67,6 +67,11 @@
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_vs2010.vcxproj", "{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
+	EndProjectSection
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
--- a/VisualC/SDL_VS2012.sln	Sun Dec 30 09:58:03 2012 -0800
+++ b/VisualC/SDL_VS2012.sln	Sun Dec 30 10:58:18 2012 -0800
@@ -67,6 +67,11 @@
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_vs2012.vcxproj", "{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
+	EndProjectSection
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
--- a/VisualC/tests/testautomation/testautomation_vs2010.vcxproj	Sun Dec 30 09:58:03 2012 -0800
+++ b/VisualC/tests/testautomation/testautomation_vs2010.vcxproj	Sun Dec 30 10:58:18 2012 -0800
@@ -92,6 +92,12 @@
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
+    <PostBuildEvent>
+      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll"</Command>
+    </PostBuildEvent>
+    <PostBuildEvent>
+      <Message>Copy SDL</Message>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
@@ -136,6 +142,12 @@
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
+    <PostBuildEvent>
+      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll"</Command>
+    </PostBuildEvent>
+    <PostBuildEvent>
+      <Message>Copy SDL</Message>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
@@ -149,6 +161,12 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    <PostBuildEvent>
+      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll"</Command>
+    </PostBuildEvent>
+    <PostBuildEvent>
+      <Message>Copy SDL</Message>
+    </PostBuildEvent>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
--- a/VisualC/tests/testautomation/testautomation_vs2012.vcxproj	Sun Dec 30 09:58:03 2012 -0800
+++ b/VisualC/tests/testautomation/testautomation_vs2012.vcxproj	Sun Dec 30 10:58:18 2012 -0800
@@ -96,6 +96,12 @@
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
+    <PostBuildEvent>
+      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll"</Command>
+    </PostBuildEvent>
+    <PostBuildEvent>
+      <Message>Copy SDL</Message>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
@@ -140,6 +146,12 @@
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
+    <PostBuildEvent>
+      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll"</Command>
+    </PostBuildEvent>
+    <PostBuildEvent>
+      <Message>Copy SDL</Message>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
@@ -160,6 +172,12 @@
       <OptimizeReferences>true</OptimizeReferences>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
     </Link>
+    <PostBuildEvent>
+      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll"</Command>
+    </PostBuildEvent>
+    <PostBuildEvent>
+      <Message>Copy SDL</Message>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\test\testautomation.c" />
--- a/test/testautomation_rwops.c	Sun Dec 30 09:58:03 2012 -0800
+++ b/test/testautomation_rwops.c	Sun Dec 30 10:58:18 2012 -0800
@@ -76,7 +76,7 @@
 _testGenericRWopsValidations(SDL_RWops *rw, int write)
 {
    char buf[sizeof(RWopsHelloWorldTestString)];
-   int i;
+   Sint64 i;
    int seekPos = SDLTest_RandomIntegerInRange(4, 8);
 
    /* Clear buffer */
@@ -85,33 +85,33 @@
    /* Set to start. */
    i = SDL_RWseek(rw, 0, RW_SEEK_SET );
    SDLTest_AssertPass("Call to SDL_RWseek succeeded");
-   SDLTest_AssertCheck(i == 0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %i", i);
+   SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %i", i);
 
    /* Test write. */
    i = SDL_RWwrite(rw, RWopsHelloWorldTestString, sizeof(RWopsHelloWorldTestString)-1, 1);
    SDLTest_AssertPass("Call to SDL_RWwrite succeeded");
    if (write) {
-		SDLTest_AssertCheck(i == 1, "Verify result of writing one byte with SDL_RWwrite, expected 1, got %i", i);
+		SDLTest_AssertCheck(i == (Sint64)1, "Verify result of writing one byte with SDL_RWwrite, expected 1, got %i", i);
    }
    else {
-		SDLTest_AssertCheck(i <= 0, "Verify result of writing with SDL_RWwrite, expected <=0, got %i", i);
+		SDLTest_AssertCheck(i != (Sint64)1, "Verify result of writing with SDL_RWwrite, expected !=1, got %i", i);
    }
 
    /* Test seek to random position */
    i = SDL_RWseek( rw, seekPos, RW_SEEK_SET );
    SDLTest_AssertPass("Call to SDL_RWseek succeeded");
-   SDLTest_AssertCheck(i == seekPos, "Verify seek to %i with SDL_RWseek (RW_SEEK_SET), expected %i, got %i", seekPos, seekPos, i);
+   SDLTest_AssertCheck(i == (Sint64)seekPos, "Verify seek to %i with SDL_RWseek (RW_SEEK_SET), expected %i, got %i", seekPos, seekPos, i);
 
    /* Test seek back to start */
    i = SDL_RWseek(rw, 0, RW_SEEK_SET );
    SDLTest_AssertPass("Call to SDL_RWseek succeeded");
-   SDLTest_AssertCheck(i == 0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %i", i);
+   SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %i", i);
 
    /* Test read */
    i = SDL_RWread( rw, buf, 1, sizeof(RWopsHelloWorldTestString)-1 );
    SDLTest_AssertPass("Call to SDL_RWread succeeded");
    SDLTest_AssertCheck(
-	   i == (sizeof(RWopsHelloWorldTestString)-1), 
+	   i == (Sint64)(sizeof(RWopsHelloWorldTestString)-1), 
 	   "Verify result from SDL_RWread, expected %i, got %i",
 	   sizeof(RWopsHelloWorldTestString)-1,
 	   i);
@@ -123,7 +123,7 @@
    i = SDL_RWseek( rw, -4, RW_SEEK_CUR );
    SDLTest_AssertPass("Call to SDL_RWseek(...,-4,RW_SEEK_CUR) succeeded");
    SDLTest_AssertCheck(
-	   i == (sizeof(RWopsHelloWorldTestString)-5), 
+	   i == (Sint64)(sizeof(RWopsHelloWorldTestString)-5), 
 	   "Verify seek to -4 with SDL_RWseek (RW_SEEK_CUR), expected %i, got %i",
 	   sizeof(RWopsHelloWorldTestString)-5,
 	   i);
@@ -131,7 +131,7 @@
    i = SDL_RWseek( rw, -1, RW_SEEK_END );
    SDLTest_AssertPass("Call to SDL_RWseek(...,-1,RW_SEEK_END) succeeded");
    SDLTest_AssertCheck(
-	   i == (sizeof(RWopsHelloWorldTestString)-2), 
+	   i == (Sint64)(sizeof(RWopsHelloWorldTestString)-2), 
 	   "Verify seek to -1 with SDL_RWseek (RW_SEEK_END), expected %i, got %i",
 	   sizeof(RWopsHelloWorldTestString)-2,
 	   i);
@@ -326,7 +326,7 @@
    if (fp == NULL) return TEST_ABORTED;
 
    /* Open */
-   rw = SDL_RWFromFP( fp, 1 );
+   rw = SDL_RWFromFP( fp, SDL_TRUE );
    SDLTest_AssertPass("Call to SDL_RWFromFP() succeeded");
    SDLTest_AssertCheck(rw != NULL, "Verify opening file with SDL_RWFromFP in read mode does not return NULL");
 
@@ -369,7 +369,7 @@
    if (fp == NULL) return TEST_ABORTED;
 
    /* Open */
-   rw = SDL_RWFromFP( fp, 1 );
+   rw = SDL_RWFromFP( fp, SDL_TRUE );
    SDLTest_AssertPass("Call to SDL_RWFromFP() succeeded");
    SDLTest_AssertCheck(rw != NULL, "Verify opening file with SDL_RWFromFP in write mode does not return NULL");
 
--- a/test/testautomation_surface.c	Sun Dec 30 09:58:03 2012 -0800
+++ b/test/testautomation_surface.c	Sun Dec 30 10:58:18 2012 -0800
@@ -11,34 +11,53 @@
 
 /* ================= Test Case Implementation ================== */
 
-
 /* Shared test surface */
 
-static SDL_Surface *testsurface = NULL;
+static SDL_Surface *referenceSurface = NULL;
+static SDL_Surface *testSurface = NULL;
+
+/* Helper functions for the test cases */
+
+#define TEST_SURFACE_WIDTH testSurface->w
+#define TEST_SURFACE_HEIGHT testSurface->h
 
 /* Fixture */
 
+/* Create a 32-bit writable surface for screen tests */
 void
 _surfaceSetUp(void *arg)
 {
-   testsurface = SDLTest_ImageBlit();
-   SDLTest_AssertCheck(testsurface != NULL, "Check that testsurface is not NULL");
+    Uint32 rmask, gmask, bmask, amask;
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+    rmask = 0xff000000;
+    gmask = 0x00ff0000;
+    bmask = 0x0000ff00;
+    amask = 0x000000ff;
+#else
+    rmask = 0x000000ff;
+    gmask = 0x0000ff00;
+    bmask = 0x00ff0000;
+    amask = 0xff000000;
+#endif
+
+	referenceSurface = SDLTest_ImageBlit(); /* For size info */
+	testSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, referenceSurface->w, referenceSurface->h, 32, rmask, gmask, bmask, amask);
+    SDLTest_AssertCheck(testSurface != NULL, "Check that testSurface is not NULL");
 }
 
 void
 _surfaceTearDown(void *arg)
 {
-	if (testsurface != NULL) {
-		SDL_FreeSurface(testsurface);
-		testsurface = NULL;
+	if (referenceSurface != NULL) {
+		SDL_FreeSurface(referenceSurface);
+		referenceSurface = NULL;
+	}
+	if (testSurface != NULL) {
+		SDL_FreeSurface(testSurface);
+		testSurface = NULL;
 	}
 }
 
-/* Helper functions for the test cases */
-
-#define TEST_SURFACE_WIDTH testsurface->w
-#define TEST_SURFACE_HEIGHT testsurface->h
-
 /**
  * Helper that clears the test surface
  */
@@ -48,9 +67,9 @@
 	Uint32 color;
 	
 	/* Clear surface. */
-	color = SDL_MapRGB( testsurface->format, 0, 0, 0);
+	color = SDL_MapRGB( testSurface->format, 0, 0, 0);
 	SDLTest_AssertPass("Call to SDL_MapRGB()");
-	ret = SDL_FillRect( testsurface, NULL, color);
+	ret = SDL_FillRect( testSurface, NULL, color);
 	SDLTest_AssertPass("Call to SDL_FillRect()");
 	SDLTest_AssertCheck(ret == 0, "Verify result from SDL_FillRect, expected: 0, got: %i", ret);
 }
@@ -64,16 +83,16 @@
 	int i, j, ni, nj;
 	SDL_Surface *face;
 	SDL_Rect rect;
-	Uint32 color;
 	int nmode;
+	SDL_BlendMode bmode;
 	int checkFailCount1;
 	int checkFailCount2;
 	int checkFailCount3;
 	int checkFailCount4;
 
 	/* Check test surface */
-	SDLTest_AssertCheck(testsurface != NULL, "Verify testsurface is not NULL");
-	if (testsurface == NULL) return;
+	SDLTest_AssertCheck(testSurface != NULL, "Verify testSurface is not NULL");
+	if (testSurface == NULL) return;
 	
 	/* Create sample surface */
 	face = SDLTest_ImageFace();
@@ -88,8 +107,8 @@
 	rect.h = face->h;
 	
 	/* Steps to take */
-	ni = testsurface->w - face->w;
-	nj = testsurface->h - face->h;
+	ni = testSurface->w - face->w;
+	nj = testSurface->h - face->h;
 
 	/* Optionally set blend mode. */
 	if (mode >= 0) {
@@ -118,18 +137,18 @@
 		else if (mode == -4) {
 			/* Crazy blending mode magic. */
 			nmode = (i/4*j/4) % 4;
-			if (nmode==0) nmode = SDL_BLENDMODE_NONE;
-			else if (nmode==1) nmode = SDL_BLENDMODE_BLEND;
-			else if (nmode==2) nmode = SDL_BLENDMODE_ADD;
-			else if (nmode==3) nmode = SDL_BLENDMODE_MOD;
-			ret = SDL_SetSurfaceBlendMode( face, nmode );		
+			if (nmode==0) bmode = SDL_BLENDMODE_NONE;
+			else if (nmode==1) bmode = SDL_BLENDMODE_BLEND;
+			else if (nmode==2) bmode = SDL_BLENDMODE_ADD;
+			else if (nmode==3) bmode = SDL_BLENDMODE_MOD;
+			ret = SDL_SetSurfaceBlendMode( face, bmode );		
 			if (ret != 0) checkFailCount4++;
 		}
 
 		 /* Blitting. */
 		 rect.x = i;
 		 rect.y = j;
-		 ret = SDL_BlitSurface( face, NULL, testsurface, &rect );
+		 ret = SDL_BlitSurface( face, NULL, testSurface, &rect );
 		 if (ret != 0) checkFailCount1++;
 	  }
 	}
@@ -172,7 +191,7 @@
     /* Create sample surface */
     face = SDLTest_ImageFace();
     SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL");
-    if (face == NULL) return;
+    if (face == NULL) return TEST_ABORTED;
 
     /* Delete test file; ignore errors */
     unlink(sampleFilename);
@@ -231,7 +250,7 @@
 	}
 
 	/* Convert to 32 bit to compare. */
-	rface = SDL_ConvertSurface( face, testsurface->format, 0 );
+	rface = SDL_ConvertSurface( face, testSurface->format, 0 );
 	SDLTest_AssertPass("Call to SDL_ConvertSurface()");
 	SDLTest_AssertCheck(rface != NULL, "Verify result from SDL_ConvertSurface is not NULL");
 
@@ -279,7 +298,7 @@
    
    /* Verify result by comparing surfaces */
    referenceSurface = SDLTest_ImageBlit();
-   ret = SDLTest_CompareSurfaces( testsurface, referenceSurface, 0 );
+   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
    SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
    
    /* Clean up. */
@@ -304,7 +323,7 @@
    
    /* Verify result by comparing surfaces */
    referenceSurface = SDLTest_ImageBlitColor();
-   ret = SDLTest_CompareSurfaces( testsurface, referenceSurface, 0 );
+   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
    SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
    
    /* Clean up. */
@@ -329,7 +348,7 @@
    
    /* Verify result by comparing surfaces */
    referenceSurface = SDLTest_ImageBlitAlpha();
-   ret = SDLTest_CompareSurfaces( testsurface, referenceSurface, 0 );
+   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
    SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
    
    /* Clean up. */
@@ -355,7 +374,7 @@
    
    /* Verify result by comparing surfaces */
    referenceSurface = SDLTest_ImageBlitBlendNone();
-   ret = SDLTest_CompareSurfaces( testsurface, referenceSurface, 0 );
+   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
    SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
    
    /* Clean up. */
@@ -380,7 +399,7 @@
    
    /* Verify result by comparing surfaces */
    referenceSurface = SDLTest_ImageBlitBlend();
-   ret = SDLTest_CompareSurfaces( testsurface, referenceSurface, 0 );
+   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
    SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
    
    /* Clean up. */
@@ -405,7 +424,7 @@
    
    /* Verify result by comparing surfaces */
    referenceSurface = SDLTest_ImageBlitBlendAdd();
-   ret = SDLTest_CompareSurfaces( testsurface, referenceSurface, 0 );
+   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
    SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
    
    /* Clean up. */
@@ -430,7 +449,7 @@
    
    /* Verify result by comparing surfaces */
    referenceSurface = SDLTest_ImageBlitBlendMod();
-   ret = SDLTest_CompareSurfaces( testsurface, referenceSurface, 0 );
+   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
    SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
    
    /* Clean up. */
@@ -455,7 +474,7 @@
    
    /* Verify result by comparing surfaces */
    referenceSurface = SDLTest_ImageBlitBlendAll();
-   ret = SDLTest_CompareSurfaces( testsurface, referenceSurface, 0 );
+   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
    SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
    
    /* Clean up. */