aboutsummaryrefslogtreecommitdiff
path: root/engines/testbed/graphics.cpp
diff options
context:
space:
mode:
authorNeeraj Kumar2010-06-06 14:06:51 +0000
committerNeeraj Kumar2010-06-06 14:06:51 +0000
commit1819c8b23b0beac173ed61f777a3656879d020d1 (patch)
tree6ba28fedb2e952a42f5928679aff96a7be8a4aae /engines/testbed/graphics.cpp
parent333989fc6d6a254f0383407de6d69be6c8ca994c (diff)
downloadscummvm-rg350-1819c8b23b0beac173ed61f777a3656879d020d1.tar.gz
scummvm-rg350-1819c8b23b0beac173ed61f777a3656879d020d1.tar.bz2
scummvm-rg350-1819c8b23b0beac173ed61f777a3656879d020d1.zip
polished the interface to interact with testsuites, added code to report test results
svn-id: r49456
Diffstat (limited to 'engines/testbed/graphics.cpp')
-rw-r--r--engines/testbed/graphics.cpp42
1 files changed, 30 insertions, 12 deletions
diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp
index 67176683ee..a5658a1213 100644
--- a/engines/testbed/graphics.cpp
+++ b/engines/testbed/graphics.cpp
@@ -4,29 +4,47 @@
namespace Testbed {
GFXTestSuite::GFXTestSuite() {
- //addTest("FullScreenMode", &testFullScreenMode);
+ // Initialize color palettes
+ // Te fourth field is for alpha channel which is unused
+ // Assuming 8bpp as of now
+ _palette[0] =_palette[1] =_palette[2] = 0;
+ _palette[4] =_palette[5] =_palette[6] = 255;
+ _palette[8] =_palette[9] =_palette[10] = 255;
+ g_system->setPalette(_palette, 0, 3);
+ g_system->grabPalette(_palette, 0, 3);
+
+ // Add tests here
+ addTest("FullScreenMode", &testFullScreenMode);
addTest("AspectRatio", &testAspectRatio);
}
-GFXTestSuite::~GFXTestSuite() {
- for (Common::Array<Test*>::iterator i = _testsToExecute.begin(); i != _testsToExecute.end(); ++i) {
- delete (*i);
- }
-}
-
const char *GFXTestSuite::getName() {
return "GFX";
}
-int GFXTestSuite::execute() {
- //TODO: Implement the method
+void GFXTestSuite::setCustomColor(uint r, uint g, uint b) {
+ _palette[8] = r;
+ _palette[9] = g;
+ _palette[10] = b;
+ g_system->setPalette(_palette, 0, 3);
+ g_system->grabPalette(_palette, 0, 3);
+}
+
+void GFXTestSuite::execute() {
for (Common::Array<Test*>::iterator i = _testsToExecute.begin(); i != _testsToExecute.end(); ++i) {
printf("Executing Test:%s\n", ((*i)->featureName).c_str());
- printf("Result:%d\n",(*i)->driver());
+ // Invoke the test
+ (*i)->driver();
+ _numTestsExecuted++;
+ // Verify result by Interacting with the tester.
+ Common::String prompt("Was this similar to what you expected?");
+ if (handleInteractiveInput(prompt)) {
+ _numTestsPassed++;
+ }
}
- return 1;
+ // Report Generation
+ genReport();
}
-
}