mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-22 01:57:16 +00:00
some more changes with GFX and FS tests
svn-id: r50064
This commit is contained in:
parent
7b8693757c
commit
492f743d47
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user