[Scummvm-cvs-logs] SF.net SVN: scummvm:[51263] scummvm/branches/gsoc2010-testbed/engines/ testbed

sud03r at users.sourceforge.net sud03r at users.sourceforge.net
Sun Jul 25 00:01:16 CEST 2010


Revision: 51263
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51263&view=rev
Author:   sud03r
Date:     2010-07-24 22:01:15 +0000 (Sat, 24 Jul 2010)

Log Message:
-----------
TESTBED: added a test for checking cursor trails in the GUI, fixed some display stuff

Modified Paths:
--------------
    scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp	2010-07-24 21:55:10 UTC (rev 51262)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp	2010-07-24 22:01:15 UTC (rev 51263)
@@ -108,7 +108,7 @@
 	"Press X to exit";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : keyboard events");
+		Testsuite::logPrintf("Info! Skipping test : keyboard events\n");
 		return true;
 	}
 	
@@ -209,7 +209,7 @@
 	"Press ESC key when done of the input.";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : keyboard events");
+		Testsuite::logPrintf("Info! Skipping test : keyboard events\n");
 		return true;
 	}
 
@@ -247,7 +247,7 @@
 	"Click 'resume' to continue testbed.";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : Main Menu");
+		Testsuite::logPrintf("Info! Skipping test : Main Menu\n");
 		return true;
 	}
 	Common::EventManager *eventMan = g_system->getEventManager();

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-07-24 21:55:10 UTC (rev 51262)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-07-24 22:01:15 UTC (rev 51263)
@@ -74,6 +74,7 @@
 
 	// Specific Tests:
 	addTest("PaletteRotation", &GFXtests::paletteRotation);
+	addTest("cursorTrailsInGUI", &GFXtests::cursorTrails);
 	//addTest("Pixel Formats", &GFXtests::pixelFormats);
 }
 
@@ -399,7 +400,7 @@
 	Common::Rect rect = Testsuite::writeOnScreen("Testing fullscreen mode", pt);
 	
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : FullScreenMode");
+		Testsuite::logPrintf("Info! Skipping test : FullScreenMode\n");
 		return true;
 	}
 
@@ -481,7 +482,7 @@
 	" an ellipse otherwise.";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : Aspect Ratio");
+		Testsuite::logPrintf("Info! Skipping test : Aspect Ratio\n");
 		return true;
 	}
 	// Draw an ellipse on the screen
@@ -554,7 +555,7 @@
 
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : Palettized Cursors");
+		Testsuite::logPrintf("Info! Skipping test : Palettized Cursors\n");
 		return true;
 	}
 	
@@ -602,7 +603,7 @@
 						"There we have a rectangle drawn, finally the cursor would lie centred in that rectangle.";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : Mouse Movements");
+		Testsuite::logPrintf("Info! Skipping test : Mouse Movements\n");
 		return true;
 	}
 	
@@ -648,7 +649,7 @@
 		"You should expect to see a 20x40 yellow horizontal rectangle centred at the screen.";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : Blitting Bitmap");
+		Testsuite::logPrintf("Info! Skipping test : Blitting Bitmap\n");
 		return true;
 	}
 	
@@ -681,7 +682,7 @@
 		"you should expect the window to be minimized.\n However you would manually need to de-iconify.";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : Iconifying window");
+		Testsuite::logPrintf("Info! Skipping test : Iconifying window\n");
 		return true;
 	}
 	
@@ -730,7 +731,7 @@
 		"This may take time, You may skip the later scalers and just examine the first three i.e 1x, 2x and 3x";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : Scaled Cursors");
+		Testsuite::logPrintf("Info! Skipping test : Scaled Cursors\n");
 		return true;
 	}
 
@@ -792,7 +793,7 @@
 	Common::String info = "Shaking test. You should expect the graphics(text/bars etc) drawn on the screen to shake!";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : Shaking Effect");
+		Testsuite::logPrintf("Info! Skipping test : Shaking Effect\n");
 		return true;
 	}
 
@@ -821,7 +822,7 @@
 		"If this feature is implemented, the focus should be toggled between the two rectangles on the corners";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : focus Rectangle");
+		Testsuite::logPrintf("Info! Skipping test : focus Rectangle\n");
 		return true;
 	}
 	
@@ -868,7 +869,7 @@
 	Common::String info = "Overlay Graphics. You should expect to see a green colored rectangle on the screen";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : Overlay Graphics");
+		Testsuite::logPrintf("Info! Skipping test : Overlay Graphics\n");
 		return true;
 	}
 	
@@ -905,7 +906,7 @@
 						"Note that the screen graphics change without having to draw anything.";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : palette Rotation");
+		Testsuite::logPrintf("Info! Skipping test : palette Rotation\n");
 		return true;
 	}
 	Common::Point pt(0, 10);
@@ -982,13 +983,33 @@
 	return true;
 }
 
+bool GFXtests::cursorTrails() {
+	Common::String info = "With some shake offset the cursor was known to leave trails in the GUI\n"
+						"Here we set some offset and ask user to check for mouse trails, \n"
+						"the test is passed when there are no trails";
+
+	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
+		Testsuite::logPrintf("Info! Skipping test : Cursor Trails\n");
+		return true;
+	}
+	bool passed = false;
+	g_system->setShakePos(25);
+	g_system->updateScreen();
+	if (Testsuite::handleInteractiveInput("Does the cursor leaves trails while moving?", "Yes", "No", kOptionRight)) {
+		passed = true;
+	}
+	g_system->setShakePos(0);
+	g_system->updateScreen();
+	return passed;
+}
+
 bool GFXtests::pixelFormats() {
 	Testsuite::clearScreen();
 	Common::String info = "Testing pixel formats. Here we iterate over all the supported pixel formats and display some colors using them\n"
 		"This may take long, especially if the backend supports many pixel formats";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : focus Rectangle");
+		Testsuite::logPrintf("Info! Skipping test : focus Rectangle\n");
 		return true;
 	}
 

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h	2010-07-24 21:55:10 UTC (rev 51262)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h	2010-07-24 22:01:15 UTC (rev 51263)
@@ -40,6 +40,7 @@
 Common::Rect drawCursor(bool cursorPaletteDisabled = false, const char *gfxModeName = "", int cursorTargetScale = 1);
 
 // will contain function declarations for GFX tests
+bool cursorTrails();
 bool fullScreenMode();
 bool aspectRatio();
 bool palettizedCursors();

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp	2010-07-24 21:55:10 UTC (rev 51262)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp	2010-07-24 22:01:15 UTC (rev 51263)
@@ -254,7 +254,7 @@
 	byte *buffer = new byte[lRect * wRect];
 	memset(buffer, 0, sizeof(byte) * lRect * wRect);
 
-	int wShaded = (int) (wRect * (((float)testNum - 1) / numTests));
+	int wShaded = (int) (wRect * (((float)testNum) / numTests));
 
 	// draw the boundary
 	memset(buffer, 1, sizeof(byte) * wRect);
@@ -291,7 +291,7 @@
 		return;
 	}
 
-	uint count = 1;
+	uint count = 0;
 	Common::Point pt = getDisplayRegionCoordinates();
 	pt.y += getLineSeparation();
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list