aboutsummaryrefslogtreecommitdiff
path: root/engines/testbed
diff options
context:
space:
mode:
authorNeeraj Kumar2010-06-25 20:26:54 +0000
committerNeeraj Kumar2010-06-25 20:26:54 +0000
commit6e27ad3b2bdafce93a5743bdacb932b711bd7ef2 (patch)
tree910e48f9fb3327fdc74ed40460f0725a3dadbcc8 /engines/testbed
parentbc3a7ba915221b130bfb6390c1dedf86dac81c95 (diff)
downloadscummvm-rg350-6e27ad3b2bdafce93a5743bdacb932b711bd7ef2.tar.gz
scummvm-rg350-6e27ad3b2bdafce93a5743bdacb932b711bd7ef2.tar.bz2
scummvm-rg350-6e27ad3b2bdafce93a5743bdacb932b711bd7ef2.zip
some more refinements to FS and GFX tests
svn-id: r50286
Diffstat (limited to 'engines/testbed')
-rw-r--r--engines/testbed/fs.cpp19
-rw-r--r--engines/testbed/fs.h2
-rw-r--r--engines/testbed/graphics.cpp17
3 files changed, 19 insertions, 19 deletions
diff --git a/engines/testbed/fs.cpp b/engines/testbed/fs.cpp
index ff1ae31777..53b08fd394 100644
--- a/engines/testbed/fs.cpp
+++ b/engines/testbed/fs.cpp
@@ -15,12 +15,9 @@ namespace Testbed {
* compares the message contained in it, with what it expects.
*
*/
-bool FStests::readDataFromFile(Common::FSNode &directory, const char *file) {
+bool FStests::readDataFromFile(Common::FSDirectory *directory, const char *file) {
-
- Common::FSDirectory nestedDir(directory);
-
- Common::SeekableReadStream *readStream = nestedDir.createReadStreamForMember(file);
+ Common::SeekableReadStream *readStream = directory->createReadStreamForMember(file);
if (!readStream) {
printf("LOG:Can't open game file for reading\n");
@@ -29,7 +26,7 @@ bool FStests::readDataFromFile(Common::FSNode &directory, const char *file) {
Common::String msg = readStream->readLine();
delete readStream;
- printf("LOG: Message Extracted from %s/%s : %s\n",directory.getName().c_str(), file, msg.c_str());
+ printf("LOG: Message Extracted from %s/%s : %s\n",directory->getFSNode().getName().c_str(), file, msg.c_str());
Common::String expectedMsg = "It works!";
@@ -45,10 +42,10 @@ bool FStests::readDataFromFile(Common::FSNode &directory, const char *file) {
bool FStests::testReadFile() {
const Common::String &path = ConfMan.get("path");
- Common::FSNode gameRoot(path);
+ Common::FSDirectory gameRoot(path);
int numFailed = 0;
- if (!gameRoot.isDirectory()) {
+ if (!gameRoot.getFSNode().isDirectory()) {
printf("LOG:game Path should be a directory");
return false;
}
@@ -59,7 +56,7 @@ bool FStests::testReadFile() {
for (unsigned int i = 0; i < ARRAYSIZE(dirList); i++) {
Common::String dirName = dirList[i];
Common::String fileName = file[i];
- Common::FSNode directory = gameRoot.getChild(dirName);
+ Common::FSDirectory *directory = gameRoot.getSubDirectory(dirName);
if (!readDataFromFile(directory, fileName.c_str())) {
printf("LOG : reading from %s/%s failed\n", dirName.c_str(), fileName.c_str());
@@ -68,7 +65,7 @@ bool FStests::testReadFile() {
dirName.toLowercase();
fileName.toLowercase();
- directory = gameRoot.getChild(dirName);
+ directory = gameRoot.getSubDirectory(dirName);
if (!readDataFromFile(directory, fileName.c_str())) {
printf("LOG : reading from %s/%s failed\n", dirName.c_str(), fileName.c_str());
@@ -77,7 +74,7 @@ bool FStests::testReadFile() {
dirName.toUppercase();
fileName.toUppercase();
- directory = gameRoot.getChild(dirName);
+ directory = gameRoot.getSubDirectory(dirName);
if (!readDataFromFile(directory, fileName.c_str())) {
printf("LOG : reading from %s/%s failed\n", dirName.c_str(), fileName.c_str());
diff --git a/engines/testbed/fs.h b/engines/testbed/fs.h
index c7180390dd..f9b834d04d 100644
--- a/engines/testbed/fs.h
+++ b/engines/testbed/fs.h
@@ -12,7 +12,7 @@ namespace FStests {
// from commandline
// Helper functions for FS tests
-bool readDataFromFile(Common::FSNode &directory, const char *file);
+bool readDataFromFile(Common::FSDirectory *directory, const char *file);
// will contain function declarations for FS tests
bool testReadFile();
diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp
index 79d73a0432..b97af6cce2 100644
--- a/engines/testbed/graphics.cpp
+++ b/engines/testbed/graphics.cpp
@@ -436,13 +436,14 @@ bool GFXtests::palettizedCursors() {
printf("LOG: Couldn't use Game palette for rendering cursor\n");
passed = false;
}
- g_system->delayMillis(1000);
if (!Testsuite::handleInteractiveInput("Did Cursor tests went as you were expecting?")) {
passed = false;
}
Testsuite::clearScreen();
+ // Done with cursors
+ CursorMan.popAllCursors();
return passed;
}
@@ -578,6 +579,9 @@ bool GFXtests::scaledCursors() {
printf("LOG: Switcing to initial state failed\n");
return false;
}
+
+ // Done with cursors
+ CursorMan.popAllCursors();
Testsuite::clearScreen();
return true;
@@ -651,16 +655,15 @@ bool GFXtests::overlayGraphics() {
Graphics::PixelFormat pf = g_system->getOverlayFormat();
- OverlayColor buffer[20 * 40];
+ OverlayColor buffer[50 * 100];
OverlayColor value = pf.RGBToColor(0, 255, 0);
- for (int i = 0; i < 20 * 40; i++) {
+ for (int i = 0; i < 50 * 100; i++) {
buffer[i] = value;
}
- // FIXME: Not Working.
g_system->showOverlay();
- g_system->copyRectToOverlay(buffer, 40, 100, 100, 40, 20);
+ g_system->copyRectToOverlay(buffer, 100, 270, 175, 100, 50);
g_system->updateScreen();
g_system->delayMillis(1000);
@@ -762,7 +765,7 @@ bool GFXtests::pixelFormats() {
colors[4] = iter->RGBToColor(181, 126, 145);
colors[5] = iter->RGBToColor(47, 78, 36);
- Common::Point pt(0, 10);
+ Common::Point pt(0, 170);
char msg[100];
// XXX: Can use snprintf?
snprintf(msg, sizeof(msg), "Testing Pixel Formats, %d of %d", numFormatsTested, pfList.size());
@@ -777,7 +780,7 @@ bool GFXtests::pixelFormats() {
// Draw 6 rectangles centred at (50, 160), piled over one another
// each with color in colors[]
for (int i = 0; i < 6; i++) {
- screen->fillRect(Common::Rect::center(160, 50 + i * 10, 100, 10), colors[i]);
+ screen->fillRect(Common::Rect::center(160, 20 + i * 10, 100, 10), colors[i]);
}
g_system->unlockScreen();