Some more improvements in the TestbedListWidget and added description method in testsuite class

svn-id: r50984
This commit is contained in:
Neeraj Kumar 2010-07-18 09:08:18 +00:00
parent 07a9a03587
commit b6c2be3bb9
13 changed files with 38 additions and 30 deletions

View File

@ -41,10 +41,11 @@ TestbedOptionsDialog::TestbedOptionsDialog(Common::Array<Testsuite *> &tsList, T
for (iter = tsList.begin(); iter != tsList.end(); iter++) {
_testSuiteArray.push_back((*iter)->getName());
_testSuiteDescArray.push_back((*iter)->getDescription());
_colors.push_back(GUI::ThemeEngine::kFontColorAlternate);
}
_testListDisplay->setList(_testSuiteArray, &_colors);
_testListDisplay->setList(_testSuiteDescArray, &_colors);
new GUI::ButtonWidget(this, "Browser.Up", "Select All", kTestbedSelectAll, 0);
new GUI::ButtonWidget(this, "Browser.Cancel", "Continue", GUI::kCloseCmd);
@ -58,7 +59,7 @@ void TestbedOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd,
Testsuite *ts;
switch (cmd) {
case kSelectionToggle:
ts = _testbedConfMan->getTestsuiteByName(_testListDisplay->getSelectedString());
ts = _testbedConfMan->getTestsuiteByName(_testSuiteArray[_testListDisplay->getSelected()]);
if (ts) {
ts->enable(!ts->isEnabled());
_testListDisplay->changeColor();

View File

@ -39,9 +39,9 @@
namespace Testbed {
enum {
kSelectionToggle = 16799, // Some random Number (A better way to do this?)
kTestbedQuitCmd,
kTestbedSelectAll
kSelectionToggle = 'Tgle',
kTestbedQuitCmd = 'Quit',
kTestbedSelectAll = 'sAll'
};
class TestbedConfigManager {
@ -102,6 +102,7 @@ public:
private:
GUI::ListWidget::ColorList _colors;
Common::StringArray _testSuiteArray;
Common::StringArray _testSuiteDescArray;
TestbedListWidget *_testListDisplay;
TestbedConfigManager *_testbedConfMan;
};

View File

@ -238,8 +238,4 @@ EventTestSuite::EventTestSuite() {
addTest("Mainmenu Event", &EventTests::showMainMenu);
}
const char *EventTestSuite::getName() const {
return "Events";
}
} // End of namespace Testbed

View File

@ -53,7 +53,12 @@ public:
*/
EventTestSuite();
~EventTestSuite() {}
const char *getName() const;
const char *getName() const {
return "Events";
}
const char *getDescription() const {
return "Events : Keyboard/Mouse/RTL";
}
};
} // End of namespace Testbed

View File

@ -150,10 +150,6 @@ FSTestSuite::FSTestSuite() {
addTest("WritingFile", &FStests::testWriteFile, false);
}
const char *FSTestSuite::getName() const {
return "FS";
}
void FSTestSuite::enable(bool flag) {
const Common::String &path = ConfMan.get("path");
Common::FSNode gameRoot(path);

View File

@ -60,7 +60,12 @@ public:
*/
FSTestSuite();
~FSTestSuite() {}
const char *getName() const;
const char *getName() const {
return "FS";
}
const char *getDescription() const {
return "File system tests (Navigation, Read/Write)";
}
void enable(bool flag);
};

View File

@ -76,10 +76,6 @@ GFXTestSuite::GFXTestSuite() {
//addTest("Pixel Formats", &GFXtests::pixelFormats);
}
const char *GFXTestSuite::getName() const {
return "GFX";
}
void GFXTestSuite::setCustomColor(uint r, uint g, uint b) {
_palette[8] = r;
_palette[9] = g;

View File

@ -68,7 +68,12 @@ public:
*/
GFXTestSuite();
~GFXTestSuite() {}
const char *getName() const;
const char *getName() const {
return "GFX";
}
const char *getDescription() const {
return "Graphics Subsystem";
}
static void setCustomColor(uint r, uint g, uint b);
private:

View File

@ -150,8 +150,4 @@ MiscTestSuite::MiscTestSuite() {
addTest("Mutexes", &MiscTests::testMutexes, false);
}
const char *MiscTestSuite::getName() const {
return "Misc";
}
} // End of namespace Testbed

View File

@ -67,7 +67,12 @@ public:
*/
MiscTestSuite();
~MiscTestSuite() {}
const char *getName() const;
const char *getName() const {
return "Misc";
}
const char *getDescription() const {
return "Miscellaneous: Timers/Mutexes/Datetime";
}
};
} // End of namespace Testbed

View File

@ -196,8 +196,4 @@ SaveGameTestSuite::SaveGameTestSuite() {
addTest("Verify Error Messages", &SaveGametests::testErrorMessages, false);
}
const char *SaveGameTestSuite::getName() const {
return "SaveGames";
}
} // End of namespace Testbed

View File

@ -56,7 +56,12 @@ public:
*/
SaveGameTestSuite();
~SaveGameTestSuite() {}
const char *getName() const;
const char *getName() const {
return "SaveGames";
}
const char *getDescription() const {
return "Saving Game state tests";
}
};
} // End of namespace Testbed

View File

@ -122,6 +122,7 @@ public:
static uint parseEvents();
virtual const char *getName() const = 0;
virtual const char *getDescription() const = 0;
static void logPrintf(const char *s, ...) GCC_PRINTF(1, 2);
static void logDetailedPrintf(const char *s, ...) GCC_PRINTF(1, 2);