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

sud03r at users.sourceforge.net sud03r at users.sourceforge.net
Sat Jun 19 22:50:10 CEST 2010


Revision: 50064
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50064&view=rev
Author:   sud03r
Date:     2010-06-19 20:50:10 +0000 (Sat, 19 Jun 2010)

Log Message:
-----------
some more changes with GFX and FS tests

Modified Paths:
--------------
    scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp	2010-06-19 20:37:53 UTC (rev 50063)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp	2010-06-19 20:50:10 UTC (rev 50064)
@@ -63,12 +63,14 @@
 	Common::FSNode gameRoot(path);
 
 	Common::FSNode fileToWrite = gameRoot.getChild("testbed.out");
+	
+	Common::WriteStream *ws = fileToWrite.createWriteStream();
+	
 	if (!fileToWrite.isWritable()) {
 		printf("LOG: Can't open writable file in game data dir\n");
 		return false;
 	}
 	
-	Common::WriteStream *ws = fileToWrite.createWriteStream();
 	if (!ws) {
 		printf("LOG: Can't create a write stream");
 		return false;
@@ -89,6 +91,15 @@
 	return false;
 }
 
+/**
+ * This test creates a savefile for the given testbed-state and could be reloaded using the saveFile API.
+ * It is intended to test saving and loading from savefiles.
+ */
+/*
+GFXtests::testSavingGame() {
+	Common::SaveFileManager saveFileMan = g_system->getSavefileManager();
+}*/
+
 FSTestSuite::FSTestSuite() {
 	addTest("openingFile", &FStests::testReadFile);	
 	addTest("WritingFile", &FStests::testWriteFile);	

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-06-19 20:37:53 UTC (rev 50063)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-06-19 20:50:10 UTC (rev 50064)
@@ -425,7 +425,7 @@
 	g_system->delayMillis(1000);
 
 	Common::Rect rect(x, y, x+40, y+20);
-	Testsuite::clearScreen(rect);
+	Testsuite::clearScreen();
 	
 	if (Testsuite::handleInteractiveInput("Did the test worked as you were expecting?", "Yes", "No", kOptionRight)) {
 		return false;
@@ -474,7 +474,7 @@
 		return false;
 	}
 
-	Testsuite::clearScreen(rect);
+	Testsuite::clearScreen();
 	return true;
 }
 
@@ -485,32 +485,46 @@
 bool GFXtests::scaledCursors() {
 
 	// TODO : Understand and fix the problem relating scaled cursors
+	Testsuite::displayMessage("Testing : Scaled cursors\n"
+	"Here every graphics mode is tried with a cursorTargetScale of 1,2 and 3"
+	"This may take time, You may skip the later scalers and just examine the first three i.e 1x,2x and 3x");
 
+	int maxLimit = 1000;
+	if (!Testsuite::handleInteractiveInput("Do you want to skip other scalers", "Yes", "No", kOptionRight)) {
+		maxLimit = 3;
+	}
+
 	const OSystem::GraphicsMode *gfxMode = g_system->getSupportedGraphicsModes();
-	while (gfxMode->name) {
+	
+	while (gfxMode->name && maxLimit > 0) {
 		// for every graphics mode display cursors for cursorTargetScale 1, 2 and 3
 		// Switch Graphics mode
 		// FIXME: Doesn't works:
-		// if (g_system->setGraphicsMode(gfxMode->id)) {
-		if (1) {
-			g_system->updateScreen();
+		g_system->beginGFXTransaction();
+		bool isGFXModeSet = g_system->setGraphicsMode(gfxMode->id);
+		g_system->initSize(320, 200);
+		g_system->endGFXTransaction();
+
+		if (isGFXModeSet) {
 			
 			setupMouseLoop(false, gfxMode->name, 1);
 			unsetMouse();
+			Testsuite::clearScreen();
 			
 			setupMouseLoop(false, gfxMode->name, 2);
 			unsetMouse();
+			Testsuite::clearScreen();
 			
 			setupMouseLoop(false, gfxMode->name, 3);
 			unsetMouse();
+			Testsuite::clearScreen();
 
-			break;
-
 		} else {
 			printf("Switching to graphics mode %s failed\n", gfxMode->name);
 		}
 		CursorMan.popAllCursors();
 		gfxMode++;
+		maxLimit--;
 	}
 
 	return true;

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp	2010-06-19 20:37:53 UTC (rev 50063)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp	2010-06-19 20:50:10 UTC (rev 50064)
@@ -62,7 +62,7 @@
 
 	// To be set from config file
 	// XXX: disabling these as of now for fastly testing other tests
-	interactive = false;
+	interactive = true;
 
 	if (interactive) {
 		printf("Running Interactive tests as well\n");		


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