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

sud03r at users.sourceforge.net sud03r at users.sourceforge.net
Thu Jun 17 13:23:51 CEST 2010


Revision: 49925
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49925&view=rev
Author:   sud03r
Date:     2010-06-17 11:23:51 +0000 (Thu, 17 Jun 2010)

Log Message:
-----------
few fixes in GFX tests, added template for FS tests

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

Added Paths:
-----------
    scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/template.h

Added: scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp	                        (rev 0)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp	2010-06-17 11:23:51 UTC (rev 49925)
@@ -0,0 +1,12 @@
+#include "testbed/fs.h"
+
+namespace Testbed {
+
+FSTestSuite::FSTestSuite() {
+	
+}
+const char *FSTestSuite::getName() const {
+	return "File System";
+}
+
+} // End of namespace Testbed


Property changes on: scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h	                        (rev 0)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h	2010-06-17 11:23:51 UTC (rev 49925)
@@ -0,0 +1,34 @@
+#ifndef FS_H
+#define FS_H
+
+#include "testbed/testsuite.h"
+
+namespace Testbed {
+
+namespace FStests {
+
+// Helper functions for FS tests
+
+// will contain function declarations for FS tests
+// add more here
+}
+
+class FSTestSuite : public Testsuite {
+public:
+	/**
+	 * The constructor for the FSTestSuite
+	 * For every test to be executed one must:
+	 * 1) Create a function that would invoke the test
+	 * 2) Add that test to list by executing addTest()
+	 *
+	 * @see addTest()
+	 */
+	FSTestSuite();
+	~FSTestSuite(){}
+	const char *getName() const;
+
+};
+
+}	// End of namespace Testbed
+
+#endif


Property changes on: scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-06-17 11:05:39 UTC (rev 49924)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-06-17 11:23:51 UTC (rev 49925)
@@ -22,21 +22,21 @@
 	// Add tests here
 	
 	// Blitting buffer on screen
-	// addTest("BlitBitmaps", &GFXtests::copyRectToScreen);
+	addTest("BlitBitmaps", &GFXtests::copyRectToScreen);
 	
 	// GFX Transcations
-	// addTest("FullScreenMode", &GFXtests::fullScreenMode);
-	// addTest("AspectRatio", &GFXtests::aspectRatio);
-	// addTest("IconifyingWindow", &GFXtests::iconifyWindow);
+	addTest("FullScreenMode", &GFXtests::fullScreenMode);
+	addTest("AspectRatio", &GFXtests::aspectRatio);
+	addTest("IconifyingWindow", &GFXtests::iconifyWindow);
 	
 	// Mouse Layer tests (Palettes and movements)
 	addTest("PalettizedCursors", &GFXtests::palettizedCursors);
-	// TODO: need to fix it
+	// FIXME: need to fix it
 	addTest("ScaledCursors", &GFXtests::scaledCursors);
 	
 	// Effects
-	// addTest("shakingEffect", &GFXtests::shakingEffect);
-	// addTest("focusRectangle", &GFXtests::focusRectangle);
+	addTest("shakingEffect", &GFXtests::shakingEffect);
+	addTest("focusRectangle", &GFXtests::focusRectangle);
 
 	// TODO: unable to notice any change, make it noticable
 	addTest("Overlays", &GFXtests::overlayGraphics);
@@ -74,7 +74,7 @@
 		buffer[10 - i][i] = 0;
 	}
 	
-	CursorMan.pushCursor(&buffer[0][0], 11, 11, 5, 5, 1);
+	CursorMan.pushCursor(&buffer[0][0], 11, 11, 5, 5, cursorTargetScale);
 	CursorMan.showMouse(true);
 	
 	if (cursorPaletteDisabled) {
@@ -82,16 +82,6 @@
 	}
 	
 	g_system->updateScreen();
-
-	if (gfxModeName) {
-		Common::Point pt(0, 100);
-		char scaleFactor[10];
-		snprintf(scaleFactor, 10, "%dx", cursorTargetScale);
-		Common::String info = "GFX Mode:";
-		info = info + gfxModeName  + " Cursor scaled by:" + scaleFactor;
-		Testsuite::clearScreen();
-		Testsuite::writeOnScreen(info, pt);
-	}
 }
 
 /**
@@ -116,10 +106,22 @@
 		
 		Testsuite::clearScreen();
 		Common::String info = disableCursorPalette ? "Using Game Palette" : "Using cursor palette";
-		info += "to render the cursor, Click to finish";
+		info += " to render the cursor, Click to finish";
 		
 		Testsuite::writeOnScreen(info, pt);
+		
+		info = "GFX Mode";
+		info += gfxModeName;
+		info += " ";
 
+		char cScale = cursorTargetScale + '0';
+		info += "Cursor scale: ";
+		info += cScale;
+		
+		if (!Common::String(gfxModeName).equals("")) {
+			Testsuite::writeOnScreen(info, Common::Point(0, 120));
+		}
+
 		while (!quitLoop) {
 			while (eventMan->pollEvent(event)) {
 	
@@ -133,13 +135,9 @@
 					break;
 				case Common::EVENT_LBUTTONDOWN:
 				case Common::EVENT_RBUTTONDOWN:
-					Testsuite::clearScreen();
-					Testsuite::writeOnScreen("Mouse Clicked", pt);
-					printf("Mouse Clicked\n");
-					g_system->delayMillis(1000);
 					quitLoop = true;
 					Testsuite::clearScreen();
-					Testsuite::writeOnScreen("TestFinished", pt);
+					Testsuite::writeOnScreen("Mouse clicked", pt);
 					g_system->delayMillis(1000);
 					break;
 				default:	
@@ -505,7 +503,9 @@
 			
 			setupMouseLoop(false, gfxMode->name, 3);
 			unsetMouse();
-		
+
+			break;
+
 		} else {
 			printf("Switching to graphics mode %s failed\n", gfxMode->name);
 		}
@@ -529,7 +529,7 @@
 	g_system->delayMillis(1500);
 
 	if (Testsuite::handleInteractiveInput("Did the test worked as you were expecting?", "Yes", "No", kOptionRight)) {
-		printf("LOG: Shaking  Effect didn't worked");
+		printf("LOG: Shaking Effect didn't worked");
 		return false;
 	}
 	Testsuite::clearScreen();

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h	2010-06-17 11:05:39 UTC (rev 49924)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h	2010-06-17 11:23:51 UTC (rev 49925)
@@ -9,10 +9,10 @@
 
 // Helper functions for GFX tests
 void drawEllipse(int x, int y, int a, int b);
-void setupMouseLoop(bool disableCursorPalette = false, const char *gfxModeName = 0, int cursorTargetScale = 1);
+void setupMouseLoop(bool disableCursorPalette = false, const char *gfxModeName = "", int cursorTargetScale = 1);
 void unsetMouse();
 void mouseMovements();
-void drawCursor(bool cursorPaletteDisabled = false, const char *gfxModeName = 0, int cursorTargetScale = 1);
+void drawCursor(bool cursorPaletteDisabled = false, const char *gfxModeName = "", int cursorTargetScale = 1);
 
 // will contain function declarations for GFX tests
 bool fullScreenMode(); 

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk	2010-06-17 11:05:39 UTC (rev 49924)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk	2010-06-17 11:23:51 UTC (rev 49925)
@@ -2,6 +2,7 @@
  
 MODULE_OBJS := \
 	detection.o \
+	fs.o \
 	graphics.o \
 	testbed.o
  

Added: scummvm/branches/gsoc2010-testbed/engines/testbed/template.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/template.h	                        (rev 0)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/template.h	2010-06-17 11:23:51 UTC (rev 49925)
@@ -0,0 +1,36 @@
+#ifndef TEMPLATE_H
+#define TEMPLATE_H
+
+#include "testbed/testsuite.h"
+
+// This file can be used as template for header files of other newer testsuites.
+
+namespace Testbed {
+
+namespace XXXtests {
+
+// Helper functions for XXX tests
+
+// will contain function declarations for XXX tests
+// add more here
+}
+
+class XXXTestSuite : public Testsuite {
+public:
+	/**
+	 * The constructor for the XXXTestSuite
+	 * For every test to be executed one must:
+	 * 1) Create a function that would invoke the test
+	 * 2) Add that test to list by executing addTest()
+	 *
+	 * @see addTest()
+	 */
+	XXXTestSuite();
+	~XXXTestSuite(){}
+	const char *getName() const;
+
+};
+
+}	// End of namespace Testbed
+
+#endif


Property changes on: scummvm/branches/gsoc2010-testbed/engines/testbed/template.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp	2010-06-17 11:05:39 UTC (rev 49924)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp	2010-06-17 11:23:51 UTC (rev 49925)
@@ -4,6 +4,7 @@
 #include "engines/util.h"
  
 #include "testbed/testbed.h"
+#include "testbed/fs.h"
 #include "testbed/graphics.h"
  
 namespace Testbed {
@@ -60,16 +61,20 @@
 						"If you see this, it means interactive tests would run on this system :)");
 
 	// To be set from config file
-	interactive = true;
-	Testsuite::displayMessage(prompt, "proceed?");
+	// XXX: disabling these as of now for fastly testing other tests
+	interactive = false;
 
 	if (interactive) {
-		printf("Running tests in Interactive Mode\n");		
+		printf("Running Interactive tests as well\n");		
+		Testsuite::displayMessage(prompt, "proceed?");
 		// Executing GFX Tests
-		GFXTestSuite ts;
-		ts.execute();
+		GFXTestSuite gts;
+		gts.execute();
 	}
 	
+	FSTestSuite fts;
+	fts.execute();
+	
 	return Common::kNoError;
 }
  

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h	2010-06-17 11:05:39 UTC (rev 49924)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h	2010-06-17 11:23:51 UTC (rev 49925)
@@ -60,10 +60,10 @@
 	int getNumTestsPassed() const { return _numTestsPassed; }
 	int getNumTestsFailed() const { return _numTestsExecuted - _numTestsPassed; }
 	void genReport() const {
-		printf("Subsystem:%s\n",getName());
-		printf("Tests executed:%d\n", _numTestsExecuted);
-		printf("Tests Passed:%d\n", _numTestsPassed);
-		printf("Tests Failed:%d\n", getNumTestsFailed());
+		printf("\nSubsystem: %s\n",getName());
+		printf("Tests executed: %d\n", _numTestsExecuted);
+		printf("Tests Passed: %d\n", _numTestsPassed);
+		printf("Tests Failed: %d\n\n", getNumTestsFailed());
 	}
 	
 	/**


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