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

jvprat at users.sourceforge.net jvprat at users.sourceforge.net
Wed Jul 14 16:12:42 CEST 2010


Revision: 50885
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50885&view=rev
Author:   jvprat
Date:     2010-07-14 14:12:42 +0000 (Wed, 14 Jul 2010)

Log Message:
-----------
Whitespace cleanup (mainly spaces and tabs at the end of line)

Modified Paths:
--------------
    scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk
    scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp	2010-07-14 14:09:48 UTC (rev 50884)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp	2010-07-14 14:12:42 UTC (rev 50885)
@@ -71,7 +71,7 @@
 	Common::EventManager *eventMan = g_system->getEventManager();
 	bool quitLoop = false;
 	Common::Event event;
-	
+
 	// handle all keybd events
 	while (!quitLoop) {
 		while (eventMan->pollEvent(event)) {
@@ -83,7 +83,7 @@
 
 			switch (event.type) {
 			case Common::EVENT_KEYDOWN :
-				
+
 				if (event.kbd.keycode == Common::KEYCODE_ESCAPE) {
 					return 0;
 				}
@@ -107,7 +107,7 @@
 
 	Common::Point pt(0, 100);
 	Testsuite::writeOnScreen("Generate mouse events make L/R/M button clicks", pt);
-	pt.y = 120; 
+	pt.y = 120;
 	Testsuite::writeOnScreen("Testbed should be able to detect them, Press X to exit", pt);
 
 	// Init Mouse Palette
@@ -166,7 +166,7 @@
 			case Common::EVENT_KEYDOWN:
 				if (event.kbd.keycode == Common::KEYCODE_x) {
 					Testsuite::clearScreen();
-					Testsuite::writeOnScreen("Exit requested", pt);	
+					Testsuite::writeOnScreen("Exit requested", pt);
 					quitLoop = true;
 				}
 				break;
@@ -177,7 +177,7 @@
 
 		}
 	}
-	
+
 	CursorMan.showMouse(false);
 
 	// Verify results now!
@@ -207,9 +207,9 @@
 		text += letter;
 		rect = Testsuite::writeOnScreen(text, pt);
 	}
-	
+
 	bool passed = true;
-	
+
 	if (Testsuite::handleInteractiveInput("Was the word you entered same as that displayed on screen?", "Yes", "No", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Keyboard Events failed");
 		passed = false;
@@ -226,12 +226,12 @@
 	eventMan->pushEvent(mainMenuEvent);
 
 	bool passed = true;
-	
+
 	if (Testsuite::handleInteractiveInput("Were you able to see a main menu widget?", "Yes", "No", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Event MAINMENU failed");
 		passed = false;
 	}
-	
+
 	return passed;
 }
 

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp	2010-07-14 14:09:48 UTC (rev 50884)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp	2010-07-14 14:12:42 UTC (rev 50885)
@@ -39,14 +39,14 @@
  *
  */
 bool FStests::readDataFromFile(Common::FSDirectory *directory, const char *file) {
-	
+
 	Common::SeekableReadStream *readStream = directory->createReadStreamForMember(file);
 
 	if (!readStream) {
 		Testsuite::logDetailedPrintf("Can't open game file for reading\n");
 		return false;
-	} 
-	
+	}
+
 	Common::String msg = readStream->readLine();
 	delete readStream;
 	Testsuite::logDetailedPrintf("Message Extracted from %s/%s : %s\n",directory->getFSNode().getName().c_str(), file, msg.c_str());
@@ -67,44 +67,44 @@
 	const Common::String &path = ConfMan.get("path");
 	Common::FSDirectory gameRoot(path);
 	int numFailed = 0;
-	
+
 	if (!gameRoot.getFSNode().isDirectory()) {
 		Testsuite::logDetailedPrintf("game Path should be a directory");
 		return false;
 	}
-	
+
 	const char *dirList[] = {"test1" ,"Test2", "TEST3" , "tEST4", "test5"};
 	const char *file[] = {"file.txt", "File.txt", "FILE.txt", "fILe.txt", "file"};
 
 	for (unsigned int i = 0; i < ARRAYSIZE(dirList); i++) {
 		Common::String dirName = dirList[i];
 		Common::String fileName = file[i];
-		Common::FSDirectory *directory = gameRoot.getSubDirectory(dirName); 
+		Common::FSDirectory *directory = gameRoot.getSubDirectory(dirName);
 
 		if (!readDataFromFile(directory, fileName.c_str())) {
 			Testsuite::logDetailedPrintf("Reading from %s/%s failed\n", dirName.c_str(), fileName.c_str());
 			numFailed++;
 		}
-		
+
 		dirName.toLowercase();
 		fileName.toLowercase();
-		directory = gameRoot.getSubDirectory(dirName); 
-		
+		directory = gameRoot.getSubDirectory(dirName);
+
 		if (!readDataFromFile(directory, fileName.c_str())) {
 			Testsuite::logDetailedPrintf("Reading from %s/%s failed\n", dirName.c_str(), fileName.c_str());
 			numFailed++;
 		}
-		
+
 		dirName.toUppercase();
 		fileName.toUppercase();
-		directory = gameRoot.getSubDirectory(dirName); 
-		
+		directory = gameRoot.getSubDirectory(dirName);
+
 		if (!readDataFromFile(directory, fileName.c_str())) {
 			Testsuite::logDetailedPrintf("Reading from %s/%s failed\n", dirName.c_str(), fileName.c_str());
 			numFailed++;
 		}
 	}
-	
+
 	Testsuite::logDetailedPrintf("Failed %d out of 15\n", numFailed);
 	return false;
 }
@@ -119,14 +119,14 @@
 	Common::FSNode gameRoot(path);
 
 	Common::FSNode fileToWrite = gameRoot.getChild("testbed.out");
-	
+
 	Common::WriteStream *ws = fileToWrite.createWriteStream();
-	
+
 	if (!ws) {
 		Testsuite::logDetailedPrintf("Can't open writable file in game data dir\n");
 		return false;
 	}
-	
+
 	ws->writeString("ScummVM Rocks!");
 	ws->flush();
 	delete ws;
@@ -141,15 +141,15 @@
 		return true;
 	}
 
-	
+
 	return false;
 }
 
 
 
 FSTestSuite::FSTestSuite() {
-	addTest("ReadingFile", &FStests::testReadFile, false);	
-	addTest("WritingFile", &FStests::testWriteFile, false);	
+	addTest("ReadingFile", &FStests::testReadFile, false);
+	addTest("WritingFile", &FStests::testWriteFile, false);
 }
 
 const char *FSTestSuite::getName() const {

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h	2010-07-14 14:09:48 UTC (rev 50884)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h	2010-07-14 14:12:42 UTC (rev 50885)
@@ -34,7 +34,7 @@
 namespace FStests {
 
 // Note: These tests require a game-data directory
-// So would work if game-path is set in the launcher or invoked as ./scummvm --path="path-to-testbed-data" testbed 
+// So would work if game-path is set in the launcher or invoked as ./scummvm --path="path-to-testbed-data" testbed
 // from commandline
 
 // Helper functions for FS tests

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-07-14 14:09:48 UTC (rev 50884)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-07-14 14:12:42 UTC (rev 50885)
@@ -45,25 +45,25 @@
 	// The fourth field is for alpha channel which is unused
 	// Assuming 8bpp as of now
 	g_system->setPalette(_palette, 0, 3);
-	
+
 	// Init Mouse Palette (White-black-yellow)
 	GFXtests::initMousePalette();
-	
+
 	// Add tests here
-	
+
 	// Blitting buffer on screen
 	addTest("BlitBitmaps", &GFXtests::copyRectToScreen);
-	
+
 	// GFX Transcations
 	addTest("FullScreenMode", &GFXtests::fullScreenMode);
 	addTest("AspectRatio", &GFXtests::aspectRatio);
 	addTest("IconifyingWindow", &GFXtests::iconifyWindow);
-	
+
 	// Mouse Layer tests (Palettes and movements)
 	addTest("PalettizedCursors", &GFXtests::palettizedCursors);
 	// FIXME: Scaled cursor crsh with odd dimmensions
 	addTest("ScaledCursors", &GFXtests::scaledCursors);
-	
+
 	// Effects
 	addTest("shakingEffect", &GFXtests::shakingEffect);
 	addTest("focusRectangle", &GFXtests::focusRectangle);
@@ -74,7 +74,7 @@
 	// Specific Tests:
 	addTest("Palette Rotation", &GFXtests::paletteRotation);
 	//addTest("Pixel Formats", &GFXtests::pixelFormats);
-		
+
 }
 
 const char *GFXTestSuite::getName() const {
@@ -82,7 +82,7 @@
 }
 
 void GFXTestSuite::setCustomColor(uint r, uint g, uint b) {
-	_palette[8] = r; 
+	_palette[8] = r;
 	_palette[9] = g;
 	_palette[10] = b;
 	g_system->setPalette(_palette, 0, 256);
@@ -92,14 +92,14 @@
 
 void GFXtests::initMousePalette() {
 	byte palette[3 * 4]; // Black, white and yellow
-	
+
 	palette[0] = palette[1] = palette[2] = 0;
 	palette[4] = palette[5] = palette[6] = 255;
 	palette[8] = palette[9] = 255;
 	palette[10] = 0;
-		
+
 	CursorMan.replaceCursorPalette(palette, 0, 3);
-	
+
 }
 
 Common::Rect GFXtests::computeSize(Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale) {
@@ -114,7 +114,7 @@
 		// So a w/2 x h/2 rectangle when scaled would match the cursor
 		return Common::Rect(cursorRect.width() / 2, cursorRect.height() / 2);
 	}
-	
+
 	if (scalingFactor == 3) {
 		// Cursor traget scale is 2 or 3.
 		return Common::Rect((cursorRect.width() / cursorTargetScale), (cursorRect.height() / cursorTargetScale));
@@ -125,7 +125,7 @@
 }
 
 void GFXtests::HSVtoRGB(int& rComp, int& gComp, int& bComp, int hue, int sat, int val) {
-	
+
 	float r = rComp;
 	float g = gComp;
 	float b = bComp;
@@ -142,7 +142,7 @@
 		return;
 	}
 
-	h /= 60;	
+	h /= 60;
 	i = (int) h;
 	f = h - i;
 	p = v * (1 - s);
@@ -175,7 +175,7 @@
 			g = p;
 			b = v;
 			break;
-		default:	
+		default:
 			r = v;
 			g = p;
 			b = q;
@@ -187,7 +187,7 @@
 	bComp = b * 255;
 }
 
-Common::Rect GFXtests::drawCursor(bool cursorPaletteDisabled, const char *gfxModeName, int cursorTargetScale) {	
+Common::Rect GFXtests::drawCursor(bool cursorPaletteDisabled, const char *gfxModeName, int cursorTargetScale) {
 
 	// Buffer initialized with yellow color
 	byte buffer[500];
@@ -195,9 +195,9 @@
 
 	int cursorWidth = 12;
 	int cursorHeight = 12;
-	
+
 	/* Disable HotSpot highlighting as of now
-	
+
 	// Paint the cursor with yellow, except the hotspot
 	for (int i = 0; i < 16; i++) {
 		for (int j = 0; j < 16; j++) {
@@ -213,7 +213,7 @@
 	// CursorMan.replaceCursor(buffer, 11, 11, 0, 0, 255, cursorTargetScale);
 	CursorMan.replaceCursor(buffer, 12, 12, 0, 0, 255, cursorTargetScale);
 	CursorMan.showMouse(true);
-	
+
 	if (cursorPaletteDisabled) {
 		CursorMan.disableCursorPalette(true);
 	} else {
@@ -227,7 +227,7 @@
 
 void rotatePalette(byte *palette, int size) {
 	// Rotate the colors starting from address palette "size" times
-	
+
 	// take a temporary palette color
 	byte tColor[4] = {0};
 	// save first color in it.
@@ -251,7 +251,7 @@
 	Common::Rect cursorRect;
 
 	if (isFeaturePresent) {
-		
+
 		cursorRect = GFXtests::drawCursor(disableCursorPalette, gfxModeName, cursorTargetScale);
 
 		Common::EventManager *eventMan = g_system->getEventManager();
@@ -260,14 +260,14 @@
 
 		bool quitLoop = false;
 		uint32 lastRedraw = 0;
-		const uint32 waitTime = 1000 / 45;	
-		
+		const uint32 waitTime = 1000 / 45;
+
 		Testsuite::clearScreen();
 		Common::String info = disableCursorPalette ? "Using Game Palette" : "Using cursor palette";
 		info += " to render the cursor, Click to finish";
-		
+
 		Testsuite::writeOnScreen(info, pt);
-		
+
 		info = "GFX Mode";
 		info += gfxModeName;
 		info += " ";
@@ -278,7 +278,7 @@
 
 		Common::String gfxScalarMode(gfxModeName);
 		Common::Rect estimatedCursorRect;
-		
+
 		if (!gfxScalarMode.equals("")) {
 
 			if (gfxScalarMode.contains("1x")) {
@@ -327,7 +327,7 @@
 					Testsuite::writeOnScreen("Mouse clicked", pt);
 					g_system->delayMillis(1000);
 					break;
-				default:	
+				default:
 					break;// Ignore handling any other event
 
 				}
@@ -351,18 +351,18 @@
 		g_system->warpMouse(i, i);
 		g_system->updateScreen();
 	}
-	
+
 	Testsuite::clearScreen();
 	Testsuite::writeOnScreen("Mouse Moved to (100, 100)", pt);
-	g_system->delayMillis(1000);	
+	g_system->delayMillis(1000);
 }
 
 /**
  * Used by aspectRatio()
  */
 
-void GFXtests::drawEllipse(int cx, int cy, int a, int b) {	
-	
+void GFXtests::drawEllipse(int cx, int cy, int a, int b) {
+
 	// Take a buffer of screen size
 
 	byte buffer[200][320] = {{0}};
@@ -371,33 +371,33 @@
 
 	// Illuminate the center
 	buffer[cx][cy] = 1;
-	
+
 	// Illuminate the points lying on ellipse
 
 	for (theta = 0; theta <= PI / 2; theta += PI / 360  ) {
 		x = (int)(b * sin(theta) + 0.5);
 		y = (int)(a * cos(theta) + 0.5);
-		
+
 		// This gives us four points
-		
+
 		x1 = x + cx;
 		y1 = y + cy;
-		
+
 		buffer[x1][y1] = 1;
 
 		x1 = (-1) * x + cx;
 		y1 = y + cy;
-		
+
 		buffer[x1][y1] = 1;
-		
+
 		x1 = x + cx;
 		y1 = (-1) * y + cy;
-		
+
 		buffer[x1][y1] = 1;
 
 		x1 = (-1) * x + cx;
 		y1 = (-1) * y + cy;
-		
+
 		buffer[x1][y1] = 1;
 	}
 
@@ -412,10 +412,10 @@
  */
 
 bool GFXtests::fullScreenMode() {
-	
+
 	Common::Point pt(0, 100);
 	Common::Rect rect = Testsuite::writeOnScreen("Testing fullscreen mode", pt);
-	
+
 	bool isFeaturePresent;
 	bool isFeatureEnabled;
 	bool passed = true;
@@ -428,9 +428,9 @@
 		// Toggle
 		isFeatureEnabled = g_system->getFeatureState(OSystem::kFeatureFullscreenMode);
 		shouldSelect = isFeatureEnabled ? kOptionLeft : kOptionRight;
-		
+
 		g_system->delayMillis(1000);
-		
+
 		if (isFeatureEnabled) {
 			Testsuite::logDetailedPrintf("Current Mode is Fullsecreen\n");
 		} else {
@@ -438,7 +438,7 @@
 		}
 
 		prompt = " Which mode do you see currently ?  ";
-		
+
 		if (!Testsuite::handleInteractiveInput(prompt, "Fullscreen", "Windowed", shouldSelect)) {
 			// User selected incorrect current state
 			passed = false;
@@ -452,25 +452,25 @@
 		// Current state should be now !isFeatureEnabled
 		isFeatureEnabled = g_system->getFeatureState(OSystem::kFeatureFullscreenMode);
 		shouldSelect = isFeatureEnabled ? kOptionLeft : kOptionRight;
-			
+
 		g_system->delayMillis(1000);
-		
+
 		prompt = "  Which screen mode do you see now ?   ";
-		
+
 		if (!Testsuite::handleInteractiveInput(prompt, "Fullscreen", "Windowed", shouldSelect)) {
 			// User selected incorrect mode
 			passed = false;
 			Testsuite::logDetailedPrintf("g_system->setFeatureState() failed\n");
 		}
-		
+
 		g_system->beginGFXTransaction();
 		g_system->setFeatureState(OSystem::kFeatureFullscreenMode, !isFeatureEnabled);
 		g_system->endGFXTransaction();
-		
+
 		g_system->delayMillis(1000);
-		
+
 		prompt = "This should be your initial state. Is it?";
-		
+
 		if (!Testsuite::handleInteractiveInput(prompt, "Yes, it is", "Nopes", shouldSelect)) {
 			// User selected incorrect mode
 			Testsuite::logDetailedPrintf("switching back to initial state failed\n");
@@ -491,12 +491,12 @@
 
 bool GFXtests::aspectRatio() {
 	// Draw an ellipse on the screen
-	
+
 	drawEllipse(100, 160, 72, 60);
-	
+
 	Common::Point pt(0, 180);
 	Testsuite::writeOnScreen("Testing Aspect Ratio Correction!", pt);
-	
+
 	bool isFeaturePresent;
 	bool isFeatureEnabled;
 	bool passed;
@@ -516,13 +516,13 @@
 			passed = false;
 			Testsuite::logDetailedPrintf("Aspect Ratio Correction failed\n");
 		}
-		
+
 		g_system->beginGFXTransaction();
 		g_system->setFeatureState(OSystem::kFeatureAspectRatioCorrection, !isFeatureEnabled);
 		g_system->endGFXTransaction();
-		
+
 		g_system->delayMillis(1000);
-		
+
 		shouldSelect = !isFeatureEnabled ? kOptionLeft : kOptionRight;
 		prompt = " What does the curve on screen appears to you ?";
 		if (!Testsuite::handleInteractiveInput(prompt, "Circle", "Ellipse", shouldSelect)) {
@@ -530,7 +530,7 @@
 			passed = false;
 			Testsuite::logDetailedPrintf("Aspect Ratio Correction failed\n");
 		}
-		
+
 		g_system->beginGFXTransaction();
 		g_system->setFeatureState(OSystem::kFeatureAspectRatioCorrection, isFeatureEnabled);
 		g_system->endGFXTransaction();
@@ -539,13 +539,13 @@
 	}
 
 	g_system->delayMillis(500);
-	
+
 	if (Testsuite::handleInteractiveInput("This should definetely be your initial state?", "Yes, it is", "Nopes", kOptionRight)) {
 		// User selected incorrect mode
 		Testsuite::logDetailedPrintf("Switching back to initial state failed\n");
 		passed = false;
 	}
-	
+
 	Testsuite::clearScreen();
 	return passed;
 }
@@ -557,35 +557,35 @@
 
 bool GFXtests::palettizedCursors() {
 
-	
+
 	bool passed = true;
-	
+
 	Testsuite::displayMessage("Testing Cursors. You should expect to see a yellow colored square cursor.\n"
 	"You should be able to move it. The test finishes when the mouse(L/R) is clicked");
-	
+
 	// Testing with cursor Palette
 	setupMouseLoop();
 	// Test Automated Mouse movements (warp)
 	mouseMovements();
-	
+
 	if (Testsuite::handleInteractiveInput("Which color did the cursor appeared to you?", "Yellow", "Any other", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Couldn't use cursor palette for rendering cursor\n");
 		passed = false;
-	}	
+	}
 
 	// Testing with game Palette
 	GFXTestSuite::setCustomColor(255, 0, 0);
 	setupMouseLoop(true);
-	
+
 	if (Testsuite::handleInteractiveInput("Which color did the cursor appeared to you?", "Red", "Any other", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Couldn't use Game palette for rendering cursor\n");
 		passed = false;
-	}	
+	}
 
 	if (!Testsuite::handleInteractiveInput("Did Cursor tests went as you were expecting?")) {
 		passed = false;
 	}
-	
+
 	Testsuite::clearScreen();
 	// Done with cursors, make them invisible, any other test the could simply make it visible
 	CursorMan.showMouse(false);
@@ -614,7 +614,7 @@
 
 	Common::Rect rect(x, y, x+40, y+20);
 	Testsuite::clearScreen();
-	
+
 	if (Testsuite::handleInteractiveInput("Did the test worked as you were expecting?", "Yes", "No", kOptionRight)) {
 		return false;
 	}
@@ -625,16 +625,16 @@
 
 /**
  * Testing feature : Iconifying window
- * It is expected the screen minimizes when this feature is enabled 
+ * It is expected the screen minimizes when this feature is enabled
  */
 bool GFXtests::iconifyWindow() {
-	
+
 	Testsuite::displayMessage("Testing Iconify Window mode.\n If the feature is supported by the backend,"
 	"you should expect the window to be minimized. However you would manually need to de-iconify.");
 
 	Common::Point pt(0, 100);
 	Common::Rect rect = Testsuite::writeOnScreen("Testing Iconifying window", pt);
-	
+
 	bool isFeaturePresent;
 	bool isFeatureEnabled;
 
@@ -650,14 +650,14 @@
 		g_system->endGFXTransaction();
 
 		g_system->delayMillis(1000);
-		
+
 		g_system->beginGFXTransaction();
 		g_system->setFeatureState(OSystem::kFeatureIconifyWindow, isFeatureEnabled);
 		g_system->endGFXTransaction();
 	} else {
 		Testsuite::displayMessage("feature not supported");
 	}
-	
+
 	if (Testsuite::handleInteractiveInput("Did the test worked as you were expecting?", "Yes", "No", kOptionRight)) {
 		return false;
 	}
@@ -681,10 +681,10 @@
 	if (!Testsuite::handleInteractiveInput("Do you want to restrict scalers to 1x, 2x and 3x only?", "Yes", "No", kOptionRight)) {
 		maxLimit = 3;
 	}
-	
+
 	const int currGFXMode = g_system->getGraphicsMode();
 	const OSystem::GraphicsMode *gfxMode = g_system->getSupportedGraphicsModes();
-	
+
 	while (gfxMode->name && maxLimit > 0) {
 		// for every graphics mode display cursors for cursorTargetScale 1, 2 and 3
 		// Switch Graphics mode
@@ -693,17 +693,17 @@
 
 		bool isGFXModeSet = g_system->setGraphicsMode(gfxMode->id);
 		g_system->initSize(320, 200);
-		
+
 		OSystem::TransactionError gfxError = g_system->endGFXTransaction();
 
 		if (gfxError == OSystem::kTransactionSuccess && isGFXModeSet) {
-			
+
 			setupMouseLoop(false, gfxMode->name, 1);
 			Testsuite::clearScreen();
-			
+
 			setupMouseLoop(false, gfxMode->name, 2);
 			Testsuite::clearScreen();
-			
+
 			setupMouseLoop(false, gfxMode->name, 3);
 			Testsuite::clearScreen();
 
@@ -715,7 +715,7 @@
 		maxLimit--;
 	}
 
-	// Restore Original State 
+	// Restore Original State
 	g_system->beginGFXTransaction();
 	bool isGFXModeSet = g_system->setGraphicsMode(currGFXMode);
 	g_system->initSize(320, 200);
@@ -780,39 +780,39 @@
 
 	g_system->setFocusRectangle(rectLeft);
 	g_system->updateScreen();
-	
+
 	g_system->delayMillis(1000);
 
 	g_system->setFocusRectangle(rectRight);
 	g_system->updateScreen();
-	
+
 	g_system->clearFocusRectangle();
 
 	if (Testsuite::handleInteractiveInput("Did you noticed a variation in focus?", "Yes", "No", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Focus Rectangle feature doesn't works. Check platform.\n");
 	}
-	
+
 	Testsuite::clearScreen();
 	return true;
 }
 
 bool GFXtests::overlayGraphics() {
-	
+
 	Graphics::PixelFormat pf = g_system->getOverlayFormat();
-	
+
 	OverlayColor buffer[50 * 100];
 	OverlayColor value = pf.RGBToColor(0, 255, 0);
 
 	for (int i = 0; i < 50 * 100; i++) {
 		buffer[i] = value;
 	}
-	
+
 	g_system->showOverlay();
 	g_system->copyRectToOverlay(buffer, 100, 270, 175, 100, 50);
 	g_system->updateScreen();
-	
+
 	g_system->delayMillis(1000);
-	
+
 	g_system->hideOverlay();
 	g_system->updateScreen();
 
@@ -820,7 +820,7 @@
 		Testsuite::logDetailedPrintf("Overlay Rectangle feature doesn't works\n");
 		return false;
 	}
-	
+
 	Testsuite::clearScreen();
 	return true;
 }
@@ -828,7 +828,7 @@
 bool GFXtests::paletteRotation() {
 	Common::Point pt(0, 10);
 	Testsuite::writeOnScreen("Rotating palettes, palettes rotate towards left, click to stop!", pt);
-	
+
 	// Use 256 colors
 	byte palette[256 * 4] = {0, 0, 0, 0,
 							 255, 255, 255, 0};
@@ -843,7 +843,7 @@
 		palette[colIndx + 1] = g;
 		palette[colIndx + 2] = b;
 	}
-	
+
 	// Initialize this palette.
 	g_system->setPalette(palette, 0, 256);
 
@@ -862,12 +862,12 @@
 			}
 		}
 	}
-	
+
 	g_system->copyRectToScreen(buffer, 254, 22, 50, 254, 30);
 	g_system->updateScreen();
 	g_system->delayMillis(1000);
-	
 
+
 	bool toRotate = true;
 	Common::Event event;
 	CursorMan.showMouse(true);
@@ -884,7 +884,7 @@
 		}*/
 
 		rotatePalette(&palette[8], 254);
-		
+
 		/*for (int i = 2; i < 256; i++) {
 			debug("Palette: (%d %d %d) #", palette[i*4], palette[i*4+1], palette[i*4+2]);
 		}*/
@@ -893,7 +893,7 @@
 		g_system->setPalette(palette, 0, 256);
 		g_system->updateScreen();
 	}
-	
+
 	CursorMan.showMouse(false);
 	// Reset initial palettes
 	GFXTestSuite::setCustomColor(255, 0, 0);
@@ -910,15 +910,15 @@
 bool GFXtests::pixelFormats() {
 	Common::List<Graphics::PixelFormat> pfList = g_system->getSupportedFormats();
 	Common::List<Graphics::PixelFormat>::const_iterator iter = pfList.begin();
-	
+
 	int numFormatsTested = 0;
 	int numPassed = 0;
 	bool numFailed = 0;
-	
+
 	Testsuite::logDetailedPrintf("Testing Pixel Formats. Size of list : %d\n", pfList.size());
-	
+
 	for (iter = pfList.begin(); iter != pfList.end(); iter++) {
-		
+
 		numFormatsTested++;
 		if (iter->bytesPerPixel == 1) {
 			// Palettes already tested
@@ -927,18 +927,18 @@
 			Testsuite::logDetailedPrintf("Can't test pixels with bpp > 2\n");
 			continue;
 		}
-		
+
 		// Switch to that pixel Format
 		g_system->beginGFXTransaction();
 		g_system->initSize(320, 200, &(*iter));
 		g_system->endGFXTransaction();
 		Testsuite::clearScreen(true);
-		
 
+
 		// Draw some nice gradients
 		// Pick up some colors
 		uint colors[6];
-		
+
 		colors[0] = iter->RGBToColor(255, 255, 255);
 		colors[1] = iter->RGBToColor(135, 48, 21);
 		colors[2] = iter->RGBToColor(205, 190, 87);
@@ -952,22 +952,22 @@
 		snprintf(msg, sizeof(msg), "Testing Pixel Formats, %d of %d", numFormatsTested, pfList.size());
 		Testsuite::writeOnScreen(msg, pt, true);
 
-		// CopyRectToScreen could have been used, but that may involve writing code which 
+		// CopyRectToScreen could have been used, but that may involve writing code which
 		// already resides in graphics/surface.h
 		// So using Graphics::Surface
 
 		Graphics::Surface *screen = g_system->lockScreen();
 
 		// Draw 6 rectangles centred at (50, 160), piled over one another
-		// each with color in colors[] 
+		// each with color in colors[]
 		for (int i = 0; i < 6; i++) {
 			screen->fillRect(Common::Rect::center(160, 20 + i * 10, 100, 10), colors[i]);
 		}
-		
+
 		g_system->unlockScreen();
 		g_system->updateScreen();
 		g_system->delayMillis(500);
-	
+
 		if(Testsuite::handleInteractiveInput("Were you able to notice the colored rectangles on the screen for this format?", "Yes", "No", kOptionLeft)) {
 			numPassed++;
 		} else {
@@ -989,7 +989,7 @@
 		Testsuite::logDetailedPrintf("Pixel Format test: Failed : %d, Passed : %d, Ignored %d\n",numFailed, numPassed, numFormatsTested - (numPassed + numFailed));
 		return false;
 	}
-	
+
 	return true;
 }
 

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h	2010-07-14 14:09:48 UTC (rev 50884)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h	2010-07-14 14:12:42 UTC (rev 50885)
@@ -41,7 +41,7 @@
 Common::Rect drawCursor(bool cursorPaletteDisabled = false, const char *gfxModeName = "", int cursorTargetScale = 1);
 
 // will contain function declarations for GFX tests
-bool fullScreenMode(); 
+bool fullScreenMode();
 bool aspectRatio();
 bool palettizedCursors();
 bool copyRectToScreen();

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp	2010-07-14 14:09:48 UTC (rev 50884)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp	2010-07-14 14:12:42 UTC (rev 50885)
@@ -44,7 +44,7 @@
 
 void MiscTests::criticalSection(void *arg) {
 	SharedVars &sv = *((SharedVars *) arg);
-	
+
 	Testsuite::logDetailedPrintf("Before critical section: %d %d\n", sv.first, sv.second);
 	g_system->lockMutex(sv.mutex);
 
@@ -92,7 +92,7 @@
 	Testsuite::logDetailedPrintf("Time and Date 2s later: ");
 	getHumanReadableFormat(t2, dateTimeNow);
 	Testsuite::logDetailedPrintf("%s\n", dateTimeNow.c_str());
-	
+
 	if (t1.tm_year == t2.tm_year && t1.tm_mon == t2.tm_mon && t1.tm_mday == t2.tm_mday) {
 		if (t1.tm_mon == t2.tm_mon && t1.tm_year == t2.tm_year){
 			// Ignore lag due to processing time
@@ -109,7 +109,7 @@
 	if (g_system->getTimerManager()->installTimerProc(timerCallback, 100000, &valToModify)) {
 		g_system->delayMillis(150);
 		g_system->getTimerManager()->removeTimerProc(timerCallback);
-		
+
 		if (999 == valToModify) {
 			return true;
 		}
@@ -119,7 +119,7 @@
 
 bool MiscTests::testMutexes() {
 	static SharedVars sv = {1, 1, true, g_system->createMutex()};
-	
+
 	if (g_system->getTimerManager()->installTimerProc(criticalSection, 100000, &sv)) {
 		g_system->delayMillis(150);
 	}
@@ -143,9 +143,9 @@
 }
 
 MiscTestSuite::MiscTestSuite() {
-	addTest("Date/time", &MiscTests::testDateTime, false);	
-	addTest("Timers", &MiscTests::testTimers, false);	
-	addTest("Mutexes", &MiscTests::testMutexes, false);	
+	addTest("Date/time", &MiscTests::testDateTime, false);
+	addTest("Timers", &MiscTests::testTimers, false);
+	addTest("Mutexes", &MiscTests::testMutexes, false);
 }
 const char *MiscTestSuite::getName() const {
 	return "Misc";

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk	2010-07-14 14:09:48 UTC (rev 50884)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk	2010-07-14 14:12:42 UTC (rev 50885)
@@ -1,5 +1,5 @@
 MODULE := engines/testbed
- 
+
 MODULE_OBJS := \
 	detection.o \
 	events.o \
@@ -9,14 +9,14 @@
 	savegame.o \
 	testbed.o \
 	testsuite.o
- 
+
 MODULE_DIRS += \
 	engines/testbed
- 
+
 # This module can be built as a plugin
 ifeq ($(ENABLE_TESTBED), DYNAMIC_PLUGIN)
 PLUGIN := 1
 endif
- 
-# Include common rules 
+
+# Include common rules
 include $(srcdir)/rules.mk

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.cpp	2010-07-14 14:09:48 UTC (rev 50884)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.cpp	2010-07-14 14:12:42 UTC (rev 50885)
@@ -54,7 +54,7 @@
 
 	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
 	Common::InSaveFile *loadFile = saveFileMan->openForLoading(fileName);
-	
+
 	if (!loadFile) {
 		Testsuite::logDetailedPrintf("Can't open save File to load\n");
 		return false;
@@ -88,7 +88,7 @@
 }
 
 bool SaveGametests::testRemovingSavefile() {
-	
+
 	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
 
 	// Create a dummy savefile
@@ -118,7 +118,7 @@
 		Testsuite::logDetailedPrintf("Writing data to savefile failed\n");
 		return false;
 	}
-	
+
 	// Rename it
 	saveFileMan->renameSavefile("tBedSomeWeirdName.0", "tBedSomeCoolName.0");
 
@@ -127,11 +127,11 @@
 		Testsuite::logDetailedPrintf("Renaming savefile failed\n");
 		return false;
 	}
-	
+
 	return true;
 }
 
-bool SaveGametests::testListingSavefile() {	
+bool SaveGametests::testListingSavefile() {
 	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
 	saveFileMan->clearError();
 
@@ -175,10 +175,10 @@
 }
 
 
-bool SaveGametests::testErrorMessages() {	
+bool SaveGametests::testErrorMessages() {
 	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
 	saveFileMan->clearError();
-	
+
 	// Try opening a non existing file
 	readAndVerifyData("tBedSomeNonExistentSaveFile.0", "File doesn't exists!");
 

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp	2010-07-14 14:09:48 UTC (rev 50884)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp	2010-07-14 14:12:42 UTC (rev 50885)
@@ -35,23 +35,23 @@
 #include "testbed/misc.h"
 #include "testbed/savegame.h"
 #include "testbed/testbed.h"
- 
+
 namespace Testbed {
- 
+
 bool TestbedEngine::hasFeature(EngineFeature f) const {
 	return (f == kSupportsRTL) ? true : false;
 }
 
-TestbedEngine::TestbedEngine(OSystem *syst) 
+TestbedEngine::TestbedEngine(OSystem *syst)
  : Engine(syst) {
 	// Put your engine in a sane state, but do nothing big yet;
 	// in particular, do not load data from files; rather, if you
 	// need to do such things, do them from init().
- 
+
 	// Do not initialize graphics here
- 
+
 	// However this is the place to specify all default directories
- 
+
 	DebugMan.addDebugChannel(kTestbedLogOutput, "LOG", "Log of test results generated by testbed");
 	DebugMan.addDebugChannel(kTestbedEngineDebug, "Debug", "Engine-specific debug statements");
 	DebugMan.enableDebugChannel("LOG");
@@ -73,12 +73,12 @@
 	ts = new EventTestSuite();
 	_testsuiteList.push_back(ts);
 }
- 
+
 TestbedEngine::~TestbedEngine() {
 	Testsuite::deleteWriteStream();
 	// Remove all of our debug levels here
 	DebugMan.clearAllDebugChannels();
-	
+
 	for (Common::Array<Testsuite*>::const_iterator i = _testsuiteList.begin(); i != _testsuiteList.end(); ++i) {
 		delete (*i);
 	}
@@ -93,13 +93,13 @@
 			break;
 		}
 	}
-	
+
 	return;
 }
 
 void TestbedEngine::invokeTestsuites() {
 	Common::Array<Testsuite*>::const_iterator iter;
-	
+
 	for (iter = _testsuiteList.begin(); iter != _testsuiteList.end(); iter++) {
 		if ((*iter)->isEnabled()) {
 			(*iter)->execute();
@@ -138,7 +138,7 @@
 Common::Error TestbedEngine::run() {
 	// Initialize graphics using following:
 	initGraphics(320, 200, false);
- 
+
 	// As of now we are using GUI::MessageDialog for interaction, Test if it works.
 	// interactive mode could also be modified by a config parameter "non-interactive=1"
 	// TODO: Implement that
@@ -153,7 +153,7 @@
 	// Testsuite::isSessionInteractive = false;
 
 	if (Testsuite::isSessionInteractive) {
-		Testsuite::logPrintf("Info! : Interactive tests are also being executed.\n");		
+		Testsuite::logPrintf("Info! : Interactive tests are also being executed.\n");
 		Testsuite::displayMessage(prompt, "Proceed?");
 	}
 
@@ -178,5 +178,5 @@
 	invokeTestsuites();
 	return Common::kNoError;
 }
- 
+
 } // End of namespace Testbed

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.h	2010-07-14 14:09:48 UTC (rev 50884)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.h	2010-07-14 14:12:42 UTC (rev 50885)
@@ -24,7 +24,7 @@
 
 #ifndef TESTBED_H
 #define TESTBED_H
- 
+
 #include "engines/engine.h"
 
 #include "gui/options.h"
@@ -42,15 +42,15 @@
 public:
 	TestbedEngine(OSystem *syst);
 	~TestbedEngine();
- 
+
 	virtual Common::Error run();
-	
+
 	/**
 	 * All testsuites are disabled by default
 	 * To enable testsuite X, call enableTestsuite("X", true);
 	 */
 	void enableTestsuite(const Common::String &name, bool enable);
-	
+
 	/**
 	 * Invokes configured testsuites.
 	 */
@@ -78,5 +78,5 @@
 };
 
 } // End of namespace Testbed
- 
+
 #endif

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp	2010-07-14 14:09:48 UTC (rev 50884)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp	2010-07-14 14:12:42 UTC (rev 50885)
@@ -62,7 +62,7 @@
 void Testsuite::initLogging(const char *logdir, const char *filename, bool enable) {
 	setLogDir(logdir);
 	setLogFile(filename);
-	
+
 	if (enable) {
 		_ws = Common::FSNode(_logDirectory).getChild(_logFilename).createWriteStream();
 	} else {
@@ -73,7 +73,7 @@
 void Testsuite::initLogging(bool enable) {
 	setLogDir(ConfMan.get("path").c_str());
 	setLogFile("testbed.log");
-	
+
 	if (enable) {
 		_ws = Common::FSNode(_logDirectory).getChild(_logFilename).createWriteStream();
 	} else {
@@ -88,7 +88,7 @@
 	va_start(vl, fmt);
 	vsnprintf(buffer, STRINGBUFLEN, fmt, vl);
 	va_end(vl);
-	
+
 	if (_ws) {
 		_ws->writeString(buffer);
 	} else {
@@ -104,7 +104,7 @@
 	va_start(vl, fmt);
 	vsnprintf(buffer, STRINGBUFLEN, fmt, vl);
 	va_end(vl);
-	
+
 	if (_ws) {
 		_ws->writeString(buffer);
 	} else {
@@ -134,7 +134,7 @@
 	logPrintf("Failed: %d\n", getNumTestsFailed());
 	logPrintf("\n");
 }
-	
+
 bool Testsuite::handleInteractiveInput(const Common::String &textToDisplay, const char *opt1, const char *opt2, OptionSelected result) {
 	GUI::MessageDialog	prompt(textToDisplay, opt1, opt2);
 	return prompt.runModal() == result ? true : false;
@@ -151,7 +151,7 @@
 	uint textColor = kColorWhite;
 
 	Graphics::Surface *screen = g_system->lockScreen();
-	
+
 	int height = font.getFontHeight();
 	int width = screen->w;
 
@@ -162,7 +162,7 @@
 		fillColor = pf.RGBToColor(0 , 0, 0);
 		textColor = pf.RGBToColor(255 , 255, 255);
 	}
-	
+
 	screen->fillRect(rect, fillColor);
 	font.drawString(screen, textToDisplay, rect.left, rect.top, screen->w, textColor, Graphics::kTextAlignCenter);
 
@@ -174,13 +174,13 @@
 
 void Testsuite::clearScreen(const Common::Rect &rect) {
 	Graphics::Surface *screen = g_system->lockScreen();
-	
+
 	screen->fillRect(rect, kColorBlack);
 
 	g_system->unlockScreen();
 	g_system->updateScreen();
 }
-	
+
 void Testsuite::clearScreen() {
 	int numBytesPerLine = g_system->getWidth() * g_system->getScreenFormat().bytesPerPixel;
 	int size =  g_system->getHeight() * numBytesPerLine;
@@ -190,7 +190,7 @@
 	g_system->updateScreen();
 	delete[] buffer;
 }
-	
+
 void Testsuite::clearScreen(bool flag) {
 	Graphics::Surface *screen = g_system->lockScreen();
 	uint fillColor = kColorBlack;
@@ -244,7 +244,7 @@
 	if (toQuit == kEngineQuit) {
 		return;
 	}
-	
+
 	for (Common::Array<Test*>::iterator i = _testsToExecute.begin(); i != _testsToExecute.end(); ++i) {
 		if (toQuit == kSkipNext) {
 			logPrintf("Info! Skipping Test: %s, Skipped by user.\n", ((*i)->featureName).c_str());
@@ -266,16 +266,16 @@
 			logPrintf("Result: Failed\n");
 		}
 		// TODO: Display a screen here to user with details of upcoming test, he can skip it or Quit or RTL
-		// Check if user wants to quit/RTL/Skip next test by parsing events. 
+		// Check if user wants to quit/RTL/Skip next test by parsing events.
 		// Quit directly if explicitly requested
-		
+
 		if (Engine::shouldQuit()) {
 			toQuit = kEngineQuit;
 			genReport();
 			return;
 		}
 
-		toQuit = parseEvents();	
+		toQuit = parseEvents();
 	}
 	genReport();
 }

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h	2010-07-14 14:09:48 UTC (rev 50884)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h	2010-07-14 14:12:42 UTC (rev 50885)
@@ -80,7 +80,7 @@
 class Testsuite {
 public:
 	Testsuite();
-	virtual ~Testsuite();	
+	virtual ~Testsuite();
 	int getNumTests() const { return _testsToExecute.size(); }
 	int getNumTestsPassed() const { return _numTestsPassed; }
 	int getNumTestsFailed() const { return _numTestsExecuted - _numTestsPassed; }
@@ -96,11 +96,11 @@
 	 *
 	 * @param	textToDisplay Display text
 	 * @return	true if "Yes" false otherwise
-	 */ 
+	 */
 	static bool handleInteractiveInput(const Common::String &textToDisplay, const char *opt1 = "Yes", const char *opt2 = "No", OptionSelected result = kOptionLeft);
-	
+
 	static void displayMessage(const Common::String &textToDisplay, const char *defaultButton = "OK", const char *altButton = 0);
-	static Common::Rect writeOnScreen(const Common::String &textToDisplay, const Common::Point &pt, bool flag = false);	
+	static Common::Rect writeOnScreen(const Common::String &textToDisplay, const Common::Point &pt, bool flag = false);
 	static void clearScreen(const Common::Rect &rect);
 	static void clearScreen();
 	static void clearScreen(bool flag);
@@ -120,7 +120,7 @@
 	 */
 	virtual void execute();
 	static uint parseEvents();
-	
+
 	virtual const char *getName() const = 0;
 
 	static void logPrintf(const char *s, ...) GCC_PRINTF(1, 2);
@@ -132,13 +132,13 @@
 	static void initLogging(bool enable = true);
 	static void setLogDir(const char *dirname);
 	static void setLogFile(const char *filename);
-	
+
 	static void deleteWriteStream();
 
 protected:
 	Common::Array<Test*> _testsToExecute;			///< List of tests to be executed
 	int		    _numTestsPassed;					///< Number of tests passed
-	int  		_numTestsExecuted;					///< Number of tests executed
+	int			_numTestsExecuted;					///< Number of tests executed
 	bool		_isTsEnabled;
 
 public:
@@ -148,7 +148,7 @@
 	 * Used by various tests to respond accordingly
 	 */
 	static bool isSessionInteractive;
-	
+
 	/**
 	 * Used from the code to decide if the engine needs to exit
 	 */


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