TESTBED: Remove dead code, unused arguments and unreferenced symbols

This commit is contained in:
Julien 2011-06-06 18:49:58 -04:00
parent 08c01d116b
commit 6362542836
8 changed files with 20 additions and 27 deletions

View File

@ -159,7 +159,7 @@ void TestbedInteractionDialog::addList(uint x, uint y, uint w, uint h, const Com
_yOffset += h;
}
void TestbedInteractionDialog::addButtonXY(uint x, uint y, uint w, uint h, const Common::String name, uint32 cmd) {
void TestbedInteractionDialog::addButtonXY(uint x, uint /* y */, uint w, uint h, const Common::String name, uint32 cmd) {
_buttonArray.push_back(new GUI::ButtonWidget(this, x, _yOffset, w, h, name, 0, cmd));
}
@ -174,7 +174,6 @@ void TestbedConfigManager::initDefaultConfiguration() {
}
void TestbedConfigManager::writeTestbedConfigToStream(Common::WriteStream *ws) {
Common::String wStr;
for (Common::Array<Testsuite *>::const_iterator i = _testsuiteList.begin(); i < _testsuiteList.end(); i++) {
_configFileInterface.setKey("this", (*i)->getName(), boolToString((*i)->isEnabled()));
const Common::Array<Test *> &testList = (*i)->getTestList();

View File

@ -83,7 +83,7 @@ public:
return "Copyright (C) ScummVM";
}
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription * /* desc */) const {
// Instantiate Engine even if the game data is not found.
*engine = new Testbed::TestbedEngine(syst);
return true;

View File

@ -186,7 +186,7 @@ void GFXtests::HSVtoRGB(int &rComp, int &gComp, int &bComp, int hue, int sat, in
bComp = (int)(b * 255);
}
Common::Rect GFXtests::drawCursor(bool cursorPaletteDisabled, const char *gfxModeName, int cursorTargetScale) {
Common::Rect GFXtests::drawCursor(bool cursorPaletteDisabled, int cursorTargetScale) {
// Buffer initialized with yellow color
byte buffer[500];
memset(buffer, 2, sizeof(buffer));
@ -249,7 +249,7 @@ void GFXtests::setupMouseLoop(bool disableCursorPalette, const char *gfxModeName
if (isFeaturePresent) {
cursorRect = GFXtests::drawCursor(disableCursorPalette, gfxModeName, cursorTargetScale);
cursorRect = GFXtests::drawCursor(disableCursorPalette, cursorTargetScale);
Common::EventManager *eventMan = g_system->getEventManager();
Common::Event event;
@ -741,7 +741,7 @@ TestExitStatus GFXtests::scaledCursors() {
if (isAspectRatioCorrected) {
info += "\nDisabling Aspect ratio correction, for letting cusors match exactly, will be restored after this test.";
}
if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
Testsuite::logPrintf("Info! Skipping test : Scaled Cursors\n");
return kTestSkipped;
@ -753,7 +753,7 @@ TestExitStatus GFXtests::scaledCursors() {
}
if (isAspectRatioCorrected) {
if (isAspectRatioCorrected) {
g_system->beginGFXTransaction();
g_system->setFeatureState(OSystem::kFeatureAspectRatioCorrection, false);
g_system->endGFXTransaction();
@ -766,7 +766,7 @@ TestExitStatus GFXtests::scaledCursors() {
// for every graphics mode display cursors for cursorTargetScale 1, 2 and 3
// Switch Graphics mode
// FIXME: Crashes with "3x" mode now.:
info = Common::String::format("Testing : Scaled cursors with GFX Mode %s\n", gfxMode->name);
if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
Testsuite::logPrintf("\tInfo! Skipping sub-test : Scaled Cursors :: GFX Mode %s\n", gfxMode->name);
@ -779,7 +779,7 @@ TestExitStatus GFXtests::scaledCursors() {
Testsuite::logPrintf("Info! Explicit exit requested during scaling test, this test may be incomplete\n");
return kTestSkipped;
}
g_system->beginGFXTransaction();
bool isGFXModeSet = g_system->setGraphicsMode(gfxMode->id);
@ -807,7 +807,7 @@ TestExitStatus GFXtests::scaledCursors() {
if (Testsuite::handleInteractiveInput(info, "Yes", "No", kOptionRight)) {
Testsuite::logPrintf("\tInfo! Failed sub-test : Scaled Cursors :: GFX Mode %s\n", gfxMode->name);
}
if (Engine::shouldQuit()) {
// Explicit exit requested
Testsuite::logPrintf("Info! Explicit exit requested during scaling test, this test may be incomplete\n");
@ -824,7 +824,7 @@ TestExitStatus GFXtests::scaledCursors() {
if (isAspectRatioCorrected) {
g_system->setFeatureState(OSystem::kFeatureAspectRatioCorrection, true);
}
OSystem::TransactionError gfxError = g_system->endGFXTransaction();
if (gfxError != OSystem::kTransactionSuccess || !isGFXModeSet) {
@ -962,7 +962,7 @@ TestExitStatus GFXtests::paletteRotation() {
Testsuite::logPrintf("Info! Skipping test : palette Rotation\n");
return kTestSkipped;
}
Common::Point pt(0, 10);
Testsuite::clearEntireScreen();
// Use 256 colors
@ -1065,7 +1065,6 @@ TestExitStatus GFXtests::pixelFormats() {
}
Common::List<Graphics::PixelFormat> pfList = g_system->getSupportedFormats();
Common::List<Graphics::PixelFormat>::const_iterator iter = pfList.begin();
int numFormatsTested = 0;
int numPassed = 0;
@ -1073,7 +1072,7 @@ TestExitStatus GFXtests::pixelFormats() {
Testsuite::logDetailedPrintf("Testing Pixel Formats. Size of list : %d\n", pfList.size());
for (iter = pfList.begin(); iter != pfList.end(); iter++) {
for (Common::List<Graphics::PixelFormat>::const_iterator iter = pfList.begin(); iter != pfList.end(); iter++) {
numFormatsTested++;
if (iter->bytesPerPixel == 1) {
// Palettes already tested

View File

@ -34,7 +34,7 @@ void setupMouseLoop(bool disableCursorPalette = false, const char *gfxModeName =
void initMousePalette();
Common::Rect computeSize(const Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale);
void HSVtoRGB(int &rComp, int &gComp, int &bComp, int hue, int sat, int val);
Common::Rect drawCursor(bool cursorPaletteDisabled = false, const char *gfxModeName = "", int cursorTargetScale = 1);
Common::Rect drawCursor(bool cursorPaletteDisabled = false, int cursorTargetScale = 1);
// will contain function declarations for GFX tests
TestExitStatus cursorTrails();

View File

@ -158,11 +158,9 @@ TestExitStatus SaveGametests::testListingSavefile() {
}
}
return kTestPassed;
} else {
Testsuite::logDetailedPrintf("listing Savefiles failed!\n");
return kTestFailed;
}
Testsuite::logDetailedPrintf("listing Savefiles failed!\n");
return kTestFailed;
}

View File

@ -69,10 +69,6 @@ public:
const char *getDescription() const {
return "Sound Subsystem";
}
private:
bool _isTestDataFound;
};
} // End of namespace Testbed

View File

@ -113,7 +113,7 @@ bool Testsuite::handleInteractiveInput(const Common::String &textToDisplay, cons
return prompt.runModal() == result ? true : false;
}
void Testsuite::displayMessage(const Common::String &textToDisplay, const char *defaultButton, const char *altButton) {
void Testsuite::displayMessage(const Common::String &textToDisplay, const char *defaultButton) {
GUI::MessageDialog prompt(textToDisplay, defaultButton);
prompt.runModal();
}
@ -214,10 +214,11 @@ uint Testsuite::parseEvents() {
return kSkipNext;
}
break;
case Common::EVENT_QUIT:
case Common::EVENT_RTL:
return kEngineQuit;
break;
default:
break;
}

View File

@ -112,7 +112,7 @@ public:
*/
static bool handleInteractiveInput(const Common::String &textToDisplay, const char *opt1 = "Yes", const char *opt2 = "No", OptionSelected result = kOptionLeft);
static void displayMessage(const Common::String &textToDisplay, const char *defaultButton = "OK", const char *altButton = 0);
static void displayMessage(const Common::String &textToDisplay, const char *defaultButton = "OK");
static Common::Rect writeOnScreen(const Common::String &textToDisplay, const Common::Point &pt, bool flag = false);
static void clearScreen(const Common::Rect &rect);
static void clearEntireScreen() {
@ -145,7 +145,7 @@ public:
static void logPrintf(const char *s, ...) GCC_PRINTF(1, 2);
static void logDetailedPrintf(const char *s, ...) GCC_PRINTF(1, 2);
// Progress bar (Information Display) related methods.
/**
* Display region is in the bottom. Probably 1/4th of the game screen.
@ -180,7 +180,7 @@ protected:
bool _isTsEnabled;
private:
/**
* Used from the code to decide if the engine needs to exit
*/