aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNeeraj Kumar2010-06-19 20:50:10 +0000
committerNeeraj Kumar2010-06-19 20:50:10 +0000
commit492f743d47ea47ee9e28368fce1b5505399c011e (patch)
tree6be602a46cd2371d347afb54998dba761c2c3eab /engines
parent7b8693757c6c7631ca4f54d10761517c2bcb1792 (diff)
downloadscummvm-rg350-492f743d47ea47ee9e28368fce1b5505399c011e.tar.gz
scummvm-rg350-492f743d47ea47ee9e28368fce1b5505399c011e.tar.bz2
scummvm-rg350-492f743d47ea47ee9e28368fce1b5505399c011e.zip
some more changes with GFX and FS tests
svn-id: r50064
Diffstat (limited to 'engines')
-rw-r--r--engines/testbed/fs.cpp13
-rw-r--r--engines/testbed/graphics.cpp30
-rw-r--r--engines/testbed/testbed.cpp2
3 files changed, 35 insertions, 10 deletions
diff --git a/engines/testbed/fs.cpp b/engines/testbed/fs.cpp
index aa1022ff70..1c2065f827 100644
--- a/engines/testbed/fs.cpp
+++ b/engines/testbed/fs.cpp
@@ -63,12 +63,14 @@ bool FStests::testWriteFile() {
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 @@ bool FStests::testWriteFile() {
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);
diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp
index 3f9438d15c..6b45d6133c 100644
--- a/engines/testbed/graphics.cpp
+++ b/engines/testbed/graphics.cpp
@@ -425,7 +425,7 @@ bool GFXtests::copyRectToScreen() {
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 @@ bool GFXtests::iconifyWindow() {
return false;
}
- Testsuite::clearScreen(rect);
+ Testsuite::clearScreen();
return true;
}
@@ -485,32 +485,46 @@ bool GFXtests::iconifyWindow() {
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();
-
- break;
+ Testsuite::clearScreen();
} else {
printf("Switching to graphics mode %s failed\n", gfxMode->name);
}
CursorMan.popAllCursors();
gfxMode++;
+ maxLimit--;
}
return true;
diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp
index 789fe7c2ec..242504ca11 100644
--- a/engines/testbed/testbed.cpp
+++ b/engines/testbed/testbed.cpp
@@ -62,7 +62,7 @@ Common::Error TestbedEngine::run() {
// 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");