[Scummvm-cvs-logs] SF.net SVN: scummvm:[50893] scummvm/branches/gsoc2010-testbed/engines/ testbed
jvprat at users.sourceforge.net
jvprat at users.sourceforge.net
Wed Jul 14 21:44:53 CEST 2010
Revision: 50893
http://scummvm.svn.sourceforge.net/scummvm/?rev=50893&view=rev
Author: jvprat
Date: 2010-07-14 19:44:51 +0000 (Wed, 14 Jul 2010)
Log Message:
-----------
Some code formatting fixes
Modified Paths:
--------------
scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp
scummvm/branches/gsoc2010-testbed/engines/testbed/events.h
scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp
scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h
scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h
scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp
scummvm/branches/gsoc2010-testbed/engines/testbed/misc.h
scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.cpp
scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.h
scummvm/branches/gsoc2010-testbed/engines/testbed/template.h
scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp
scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.h
scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp
scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp 2010-07-14 19:44:51 UTC (rev 50893)
@@ -38,34 +38,34 @@
Common::KeyCode code;
char value;
} keyCodeLUT[] = {
- {Common::KEYCODE_a, 'a'},
- {Common::KEYCODE_b, 'b'},
- {Common::KEYCODE_c, 'c'},
- {Common::KEYCODE_d, 'd'},
- {Common::KEYCODE_e, 'e'},
- {Common::KEYCODE_f, 'f'},
- {Common::KEYCODE_g, 'g'},
- {Common::KEYCODE_h, 'h'},
- {Common::KEYCODE_i, 'i'},
- {Common::KEYCODE_j, 'j'},
- {Common::KEYCODE_k, 'k'},
- {Common::KEYCODE_l, 'l'},
- {Common::KEYCODE_m, 'm'},
- {Common::KEYCODE_n, 'n'},
- {Common::KEYCODE_o, 'o'},
- {Common::KEYCODE_p, 'p'},
- {Common::KEYCODE_q, 'q'},
- {Common::KEYCODE_r, 'r'},
- {Common::KEYCODE_s, 's'},
- {Common::KEYCODE_t, 't'},
- {Common::KEYCODE_u, 'u'},
- {Common::KEYCODE_v, 'v'},
- {Common::KEYCODE_w, 'w'},
- {Common::KEYCODE_x, 'x'},
- {Common::KEYCODE_y, 'y'},
- {Common::KEYCODE_z, 'z'},
- {Common::KEYCODE_SPACE, ' '}
- };
+ {Common::KEYCODE_a, 'a'},
+ {Common::KEYCODE_b, 'b'},
+ {Common::KEYCODE_c, 'c'},
+ {Common::KEYCODE_d, 'd'},
+ {Common::KEYCODE_e, 'e'},
+ {Common::KEYCODE_f, 'f'},
+ {Common::KEYCODE_g, 'g'},
+ {Common::KEYCODE_h, 'h'},
+ {Common::KEYCODE_i, 'i'},
+ {Common::KEYCODE_j, 'j'},
+ {Common::KEYCODE_k, 'k'},
+ {Common::KEYCODE_l, 'l'},
+ {Common::KEYCODE_m, 'm'},
+ {Common::KEYCODE_n, 'n'},
+ {Common::KEYCODE_o, 'o'},
+ {Common::KEYCODE_p, 'p'},
+ {Common::KEYCODE_q, 'q'},
+ {Common::KEYCODE_r, 'r'},
+ {Common::KEYCODE_s, 's'},
+ {Common::KEYCODE_t, 't'},
+ {Common::KEYCODE_u, 'u'},
+ {Common::KEYCODE_v, 'v'},
+ {Common::KEYCODE_w, 'w'},
+ {Common::KEYCODE_x, 'x'},
+ {Common::KEYCODE_y, 'y'},
+ {Common::KEYCODE_z, 'z'},
+ {Common::KEYCODE_SPACE, ' '}
+};
char EventTests::keystrokeToChar() {
Common::EventManager *eventMan = g_system->getEventManager();
@@ -75,15 +75,13 @@
// handle all keybd events
while (!quitLoop) {
while (eventMan->pollEvent(event)) {
-
// Quit if explicitly requested!
if (Engine::shouldQuit()) {
return 0;
}
switch (event.type) {
- case Common::EVENT_KEYDOWN :
-
+ case Common::EVENT_KEYDOWN:
if (event.kbd.keycode == Common::KEYCODE_ESCAPE) {
return 0;
}
@@ -170,9 +168,8 @@
quitLoop = true;
}
break;
-
default:
- break;
+ break;
}
}
@@ -240,6 +237,7 @@
addTest("Keyboard Events", &EventTests::kbdEvents);
addTest("Mainmenu Event", &EventTests::showMainMenu);
}
+
const char *EventTestSuite::getName() const {
return "Events";
}
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/events.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/events.h 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/events.h 2010-07-14 19:44:51 UTC (rev 50893)
@@ -27,7 +27,6 @@
#include "testbed/testsuite.h"
-
namespace Testbed {
namespace EventTests {
@@ -39,8 +38,9 @@
bool kbdEvents();
bool showMainMenu();
// add more here
-}
+} // End of namespace EventTests
+
class EventTestSuite : public Testsuite {
public:
/**
@@ -52,11 +52,10 @@
* @see addTest()
*/
EventTestSuite();
- ~EventTestSuite(){}
+ ~EventTestSuite() {}
const char *getName() const;
-
};
-} // End of namespace Testbed
+} // End of namespace Testbed
-#endif
+#endif // TESTBED_EVENTS_H
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp 2010-07-14 19:44:51 UTC (rev 50893)
@@ -29,6 +29,7 @@
#include "testbed/fs.h"
namespace Testbed {
+
/**
* This test does the following:
* 1) acquires the game-data path
@@ -49,8 +50,8 @@
Common::String msg = readStream->readLine();
delete readStream;
- Testsuite::logDetailedPrintf("Message Extracted from %s/%s : %s\n",directory->getFSNode().getName().c_str(), file, msg.c_str());
+ Testsuite::logDetailedPrintf("Message Extracted from %s/%s : %s\n", directory->getFSNode().getName().c_str(), file, msg.c_str());
Common::String expectedMsg = "It works!";
@@ -62,7 +63,6 @@
return true;
}
-
bool FStests::testReadFile() {
const Common::String &path = ConfMan.get("path");
Common::FSDirectory gameRoot(path);
@@ -113,7 +113,6 @@
* This test creates a file testbed.out, writes a sample data and confirms if
* it is same by reading the file again.
*/
-
bool FStests::testWriteFile() {
const Common::String &path = ConfMan.get("path");
Common::FSNode gameRoot(path);
@@ -141,7 +140,6 @@
return true;
}
-
return false;
}
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h 2010-07-14 19:44:51 UTC (rev 50893)
@@ -45,8 +45,9 @@
bool testWriteFile();
bool testOpeningSaveFile();
// add more here
-}
+} // End of namespace FStests
+
class FSTestSuite : public Testsuite {
public:
/**
@@ -58,11 +59,11 @@
* @see addTest()
*/
FSTestSuite();
- ~FSTestSuite(){}
+ ~FSTestSuite() {}
const char *getName() const;
void enable(bool flag);
};
-} // End of namespace Testbed
+} // End of namespace Testbed
-#endif
+#endif // TESTBED_FS_H
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp 2010-07-14 19:44:51 UTC (rev 50893)
@@ -74,7 +74,6 @@
// Specific Tests:
addTest("Palette Rotation", &GFXtests::paletteRotation);
//addTest("Pixel Formats", &GFXtests::pixelFormats);
-
}
const char *GFXTestSuite::getName() const {
@@ -99,7 +98,6 @@
palette[10] = 0;
CursorMan.replaceCursorPalette(palette, 0, 3);
-
}
Common::Rect GFXtests::computeSize(Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale) {
@@ -124,8 +122,7 @@
}
}
-void GFXtests::HSVtoRGB(int& rComp, int& gComp, int& bComp, int hue, int sat, int val) {
-
+void GFXtests::HSVtoRGB(int &rComp, int &gComp, int &bComp, int hue, int sat, int val) {
float r = rComp;
float g = gComp;
float b = bComp;
@@ -143,43 +140,43 @@
}
h /= 60;
- i = (int) h;
+ i = (int)h;
f = h - i;
p = v * (1 - s);
q = v * (1 - s * f);
t = v * (1 - s * (1 - f));
switch (i) {
- case 0:
- r = v;
- g = t;
- b = p;
- break;
- case 1:
- r = q;
- g = v;
- b = p;
- break;
- case 2:
- r = p;
- g = v;
- b = t;
- break;
- case 3:
- r = p;
- g = q;
- b = v;
- break;
- case 4:
- r = t;
- g = p;
- b = v;
- break;
- default:
- r = v;
- g = p;
- b = q;
- break;
+ case 0:
+ r = v;
+ g = t;
+ b = p;
+ break;
+ case 1:
+ r = q;
+ g = v;
+ b = p;
+ break;
+ case 2:
+ r = p;
+ g = v;
+ b = t;
+ break;
+ case 3:
+ r = p;
+ g = q;
+ b = v;
+ break;
+ case 4:
+ r = t;
+ g = p;
+ b = v;
+ break;
+ default:
+ r = v;
+ g = p;
+ b = q;
+ break;
}
rComp = r * 255;
@@ -188,7 +185,6 @@
}
Common::Rect GFXtests::drawCursor(bool cursorPaletteDisabled, const char *gfxModeName, int cursorTargetScale) {
-
// Buffer initialized with yellow color
byte buffer[500];
memset(buffer, 2, sizeof(buffer));
@@ -238,14 +234,13 @@
memcpy(&palette[i * 4], &palette[(i + 1) * 4], 4 * sizeof(byte));
}
// Assign last color to tcolor
- memcpy(&palette[(size -1) * 4], tColor, 4 * sizeof(byte));
+ memcpy(&palette[(size - 1) * 4], tColor, 4 * sizeof(byte));
}
/**
* Sets up mouse loop, exits when user clicks any of the mouse button
*/
void GFXtests::setupMouseLoop(bool disableCursorPalette, const char *gfxModeName, int cursorTargetScale) {
-
bool isFeaturePresent;
isFeaturePresent = g_system->hasFeature(OSystem::kFeatureCursorHasPalette);
Common::Rect cursorRect;
@@ -285,7 +280,7 @@
estimatedCursorRect = computeSize(cursorRect, 1, cursorTargetScale);
} else if (gfxScalarMode.contains("2x")) {
estimatedCursorRect = computeSize(cursorRect, 2, cursorTargetScale);
- } else if (gfxScalarMode.contains("3x")){
+ } else if (gfxScalarMode.contains("3x")) {
estimatedCursorRect = computeSize(cursorRect, 3, cursorTargetScale);
} else {
// If unable to detect scaler, default to 2
@@ -360,11 +355,8 @@
/**
* Used by aspectRatio()
*/
-
void GFXtests::drawEllipse(int cx, int cy, int a, int b) {
-
// Take a buffer of screen size
-
byte buffer[200][320] = {{0}};
float theta;
int x, y, x1, y1;
@@ -374,7 +366,7 @@
// Illuminate the points lying on ellipse
- for (theta = 0; theta <= PI / 2; theta += PI / 360 ) {
+ for (theta = 0; theta <= PI / 2; theta += PI / 360) {
x = (int)(b * sin(theta) + 0.5);
y = (int)(a * cos(theta) + 0.5);
@@ -410,9 +402,7 @@
/**
* Tests the fullscreen mode by: toggling between fullscreen and windowed mode
*/
-
bool GFXtests::fullScreenMode() {
-
Common::Point pt(0, 100);
Common::Rect rect = Testsuite::writeOnScreen("Testing fullscreen mode", pt);
@@ -488,10 +478,8 @@
/**
* Tests the aspect ratio correction by: drawing an ellipse, when corrected the ellipse should render to a circle
*/
-
bool GFXtests::aspectRatio() {
// Draw an ellipse on the screen
-
drawEllipse(100, 160, 72, 60);
Common::Point pt(0, 180);
@@ -554,14 +542,11 @@
* Tests Palettized cursors.
* Method: Create a yellow colored cursor, should be able to move it. Once you click test terminates
*/
-
bool GFXtests::palettizedCursors() {
-
-
bool passed = true;
Testsuite::displayMessage("Testing Cursors. You should expect to see a yellow colored square cursor.\n"
- "You should be able to move it. The test finishes when the mouse(L/R) is clicked");
+ "You should be able to move it. The test finishes when the mouse(L/R) is clicked");
// Testing with cursor Palette
setupMouseLoop();
@@ -599,7 +584,7 @@
*/
bool GFXtests::copyRectToScreen() {
Testsuite::displayMessage("Testing Blitting a Bitmap to screen.\n"
- "You should expect to see a 20x40 yellow horizontal rectangle centred at the screen.");
+ "You should expect to see a 20x40 yellow horizontal rectangle centred at the screen.");
GFXTestSuite::setCustomColor(255, 255, 0);
byte buffer[20 * 40];
@@ -612,7 +597,7 @@
g_system->updateScreen();
g_system->delayMillis(1000);
- Common::Rect rect(x, y, x+40, y+20);
+ Common::Rect rect(x, y, x + 40, y + 20);
Testsuite::clearScreen();
if (Testsuite::handleInteractiveInput("Did the test worked as you were expecting?", "Yes", "No", kOptionRight)) {
@@ -620,7 +605,6 @@
}
return true;
-
}
/**
@@ -628,9 +612,8 @@
* It is expected the screen minimizes when this feature is enabled
*/
bool GFXtests::iconifyWindow() {
-
Testsuite::displayMessage("Testing Iconify Window mode.\n If the feature is supported by the backend,"
- "you should expect the window to be minimized. However you would manually need to de-iconify.");
+ "you should expect the window to be minimized. However you would manually need to de-iconify.");
Common::Point pt(0, 100);
Common::Rect rect = Testsuite::writeOnScreen("Testing Iconifying window", pt);
@@ -669,13 +652,12 @@
/**
* Testing feature: Scaled cursors
*/
-
bool GFXtests::scaledCursors() {
Testsuite::displayMessage("Testing : Scaled cursors\n"
- "Here every graphics mode is tried with a cursorTargetScale of 1,2 and 3.\n"
- "The expected cursor size is drawn as a rectangle, the cursor should entirely cover that rectangle.\n"
- "This may take time, You may skip the later scalers and just examine the first three i.e 1x,2x and 3x");
+ "Here every graphics mode is tried with a cursorTargetScale of 1,2 and 3.\n"
+ "The expected cursor size is drawn as a rectangle, the cursor should entirely cover that rectangle.\n"
+ "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 restrict scalers to 1x, 2x and 3x only?", "Yes", "No", kOptionRight)) {
@@ -697,7 +679,6 @@
OSystem::TransactionError gfxError = g_system->endGFXTransaction();
if (gfxError == OSystem::kTransactionSuccess && isGFXModeSet) {
-
setupMouseLoop(false, gfxMode->name, 1);
Testsuite::clearScreen();
@@ -706,7 +687,6 @@
setupMouseLoop(false, gfxMode->name, 3);
Testsuite::clearScreen();
-
} else {
Testsuite::logDetailedPrintf("Switching to graphics mode %s failed\n", gfxMode->name);
return false;
@@ -753,9 +733,8 @@
}
bool GFXtests::focusRectangle() {
-
Testsuite::displayMessage("Testing : Setting and hiding Focus \n"
- "If this feature is implemented, the focus should be toggled between the two rectangles on the corners");
+ "If this feature is implemented, the focus should be toggled between the two rectangles on the corners");
const Graphics::Font &font(*FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont));
@@ -797,7 +776,6 @@
}
bool GFXtests::overlayGraphics() {
-
Graphics::PixelFormat pf = g_system->getOverlayFormat();
OverlayColor buffer[50 * 100];
@@ -867,7 +845,6 @@
g_system->updateScreen();
g_system->delayMillis(1000);
-
bool toRotate = true;
Common::Event event;
CursorMan.showMouse(true);
@@ -880,13 +857,13 @@
}
/*for (int i = 2; i < 256; i++) {
- debug("Palette: (%d %d %d) #", palette[i*4], palette[i*4+1], palette[i*4+2]);
+ debug("Palette: (%d %d %d) #", palette[i * 4], palette[i * 4 + 1], palette[i * 4 + 2]);
}*/
rotatePalette(&palette[8], 254);
/*for (int i = 2; i < 256; i++) {
- debug("Palette: (%d %d %d) #", palette[i*4], palette[i*4+1], palette[i*4+2]);
+ debug("Palette: (%d %d %d) #", palette[i * 4], palette[i * 4 + 1], palette[i * 4 + 2]);
}*/
g_system->delayMillis(10);
@@ -918,7 +895,6 @@
Testsuite::logDetailedPrintf("Testing Pixel Formats. Size of list : %d\n", pfList.size());
for (iter = pfList.begin(); iter != pfList.end(); iter++) {
-
numFormatsTested++;
if (iter->bytesPerPixel == 1) {
// Palettes already tested
@@ -934,7 +910,6 @@
g_system->endGFXTransaction();
Testsuite::clearScreen(true);
-
// Draw some nice gradients
// Pick up some colors
uint colors[6];
@@ -984,7 +959,6 @@
initMousePalette();
Testsuite::clearScreen();
-
if (numFailed) {
Testsuite::logDetailedPrintf("Pixel Format test: Failed : %d, Passed : %d, Ignored %d\n",numFailed, numPassed, numFormatsTested - (numPassed + numFailed));
return false;
@@ -993,4 +967,4 @@
return true;
}
-}
+} // End of namespace Testbed
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h 2010-07-14 19:44:51 UTC (rev 50893)
@@ -37,7 +37,7 @@
void initMousePalette();
void mouseMovements();
Common::Rect computeSize(Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale);
-void HSVtoRGB(int& rComp, int& gComp,int& bComp, int hue, int sat, int val);
+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);
// will contain function declarations for GFX tests
@@ -53,8 +53,9 @@
bool paletteRotation();
bool pixelFormats();
// add more here
-}
+} // End of namespace GFXtests
+
class GFXTestSuite : public Testsuite {
public:
/**
@@ -66,7 +67,7 @@
* @see addTest()
*/
GFXTestSuite();
- ~GFXTestSuite(){}
+ ~GFXTestSuite() {}
const char *getName() const;
static void setCustomColor(uint r, uint g, uint b);
@@ -82,6 +83,6 @@
static byte _palette[256 * 4];
};
-} // End of namespace Testbed
+} // End of namespace Testbed
-#endif
+#endif // TESTBED_GRAPHICS_H
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp 2010-07-14 19:44:51 UTC (rev 50893)
@@ -43,7 +43,7 @@
}
void MiscTests::criticalSection(void *arg) {
- SharedVars &sv = *((SharedVars *) arg);
+ SharedVars &sv = *((SharedVars *)arg);
Testsuite::logDetailedPrintf("Before critical section: %d %d\n", sv.first, sv.second);
g_system->lockMutex(sv.mutex);
@@ -56,6 +56,7 @@
sv.first++;
g_system->delayMillis(1000);
+
// This should bring no change as well in the difference between vars
// verify this too.
if (sv.second + 1 != sv.first) {
@@ -94,7 +95,7 @@
Testsuite::logDetailedPrintf("%s\n", dateTimeNow.c_str());
if (t1.tm_year == t2.tm_year && t1.tm_mon == t2.tm_mon && t1.tm_mday == t2.tm_mday) {
- if (t1.tm_mon == t2.tm_mon && t1.tm_year == t2.tm_year){
+ if (t1.tm_mon == t2.tm_mon && t1.tm_year == t2.tm_year) {
// Ignore lag due to processing time
if (t1.tm_sec + 2 == t2.tm_sec) {
return true;
@@ -129,6 +130,7 @@
g_system->delayMillis(1000);
sv.second *= sv.first;
g_system->unlockMutex(sv.mutex);
+
// wait till timed process exits
g_system->delayMillis(3000);
@@ -147,6 +149,7 @@
addTest("Timers", &MiscTests::testTimers, false);
addTest("Mutexes", &MiscTests::testMutexes, false);
}
+
const char *MiscTestSuite::getName() const {
return "Misc";
}
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/misc.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/misc.h 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/misc.h 2010-07-14 19:44:51 UTC (rev 50893)
@@ -52,8 +52,9 @@
bool testTimers();
bool testMutexes();
// add more here
-}
+} // End of namespace MiscTests
+
class MiscTestSuite : public Testsuite {
public:
/**
@@ -65,11 +66,10 @@
* @see addTest()
*/
MiscTestSuite();
- ~MiscTestSuite(){}
+ ~MiscTestSuite() {}
const char *getName() const;
-
};
-} // End of namespace Testbed
+} // End of namespace Testbed
-#endif
+#endif // TESTBED_MISC_H
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.cpp 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.cpp 2010-07-14 19:44:51 UTC (rev 50893)
@@ -32,9 +32,7 @@
* 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.
*/
-
bool SaveGametests::writeDataToFile(const char *fileName, const char *msg) {
-
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
Common::OutSaveFile *saveFile = saveFileMan->openForSaving(fileName);
@@ -51,7 +49,6 @@
}
bool SaveGametests::readAndVerifyData(const char *fileName, const char *expected) {
-
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
Common::InSaveFile *loadFile = saveFileMan->openForLoading(fileName);
@@ -70,7 +67,6 @@
return false;
}
-
bool SaveGametests::testSaveLoadState() {
// create a savefile with "ScummVM Rocks!" written on it
if (!writeDataToFile("tBedSavefile.0", "ScummVM Rocks!")) {
@@ -88,7 +84,6 @@
}
bool SaveGametests::testRemovingSavefile() {
-
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
// Create a dummy savefile
@@ -143,7 +138,7 @@
Common::Error error = saveFileMan->getError();
- if ( error != Common::kNoError) {
+ if (error != Common::kNoError) {
// Abort. Some Error in writing files
Testsuite::logDetailedPrintf("Error while creating savefiles: %s\n", Common::errorToString(error));
return false;
@@ -174,7 +169,6 @@
return false;
}
-
bool SaveGametests::testErrorMessages() {
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
saveFileMan->clearError();
@@ -206,4 +200,4 @@
return "SaveGames";
}
-} // End of namespace testbed
+} // End of namespace Testbed
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.h 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.h 2010-07-14 19:44:51 UTC (rev 50893)
@@ -41,8 +41,9 @@
bool testListingSavefile();
bool testErrorMessages();
// add more here
-}
+} // End of namespace SaveGametests
+
class SaveGameTestSuite : public Testsuite {
public:
/**
@@ -54,11 +55,10 @@
* @see addTest()
*/
SaveGameTestSuite();
- ~SaveGameTestSuite(){}
+ ~SaveGameTestSuite() {}
const char *getName() const;
-
};
-} // End of namespace Testbed
+} // End of namespace Testbed
-#endif
+#endif // TESTBED_SAVEGAME_H
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/template.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/template.h 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/template.h 2010-07-14 19:44:51 UTC (rev 50893)
@@ -37,8 +37,9 @@
// will contain function declarations for XXX tests
// add more here
-}
+} // End of namespace XXXtests
+
class XXXTestSuite : public Testsuite {
public:
/**
@@ -50,11 +51,11 @@
* @see addTest()
*/
XXXTestSuite();
- ~XXXTestSuite(){}
+ ~XXXTestSuite() {}
const char *getName() const;
};
-} // End of namespace Testbed
+} // End of namespace Testbed
-#endif
+#endif // TESTBED_TEMPLATE_H
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp 2010-07-14 19:44:51 UTC (rev 50893)
@@ -79,13 +79,13 @@
// Remove all of our debug levels here
DebugMan.clearAllDebugChannels();
- for (Common::Array<Testsuite*>::const_iterator i = _testsuiteList.begin(); i != _testsuiteList.end(); ++i) {
+ for (Common::Array<Testsuite *>::const_iterator i = _testsuiteList.begin(); i != _testsuiteList.end(); ++i) {
delete (*i);
}
}
void TestbedEngine::enableTestsuite(const Common::String &name, bool enable) {
- Common::Array<Testsuite*>::const_iterator iter;
+ Common::Array<Testsuite *>::const_iterator iter;
for (iter = _testsuiteList.begin(); iter != _testsuiteList.end(); iter++) {
if (name.equalsIgnoreCase((*iter)->getName())) {
@@ -98,13 +98,13 @@
}
void TestbedEngine::invokeTestsuites() {
- Common::Array<Testsuite*>::const_iterator iter;
+ Common::Array<Testsuite *>::const_iterator iter;
for (iter = _testsuiteList.begin(); iter != _testsuiteList.end(); iter++) {
if ((*iter)->isEnabled()) {
(*iter)->execute();
- }
}
+ }
}
TestbedOptionsDialog::TestbedOptionsDialog() : GUI::OptionsDialog("Select", 120, 120, 360, 200), _hOffset(15), _vOffset(15), _boxWidth(300), _boxHeight(10) {
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.h 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.h 2010-07-14 19:44:51 UTC (rev 50893)
@@ -79,4 +79,4 @@
} // End of namespace Testbed
-#endif
+#endif // TESTBED_H
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp 2010-07-14 19:44:51 UTC (rev 50893)
@@ -113,14 +113,14 @@
}
Testsuite::Testsuite() {
- _numTestsPassed = 0;
- _numTestsExecuted = 0;
- // Initially all testsuites are disabled, enable them by calling enableTestSuite(name, true)
- _isTsEnabled = false;
+ _numTestsPassed = 0;
+ _numTestsExecuted = 0;
+ // Initially all testsuites are disabled, enable them by calling enableTestSuite(name, true)
+ _isTsEnabled = false;
}
Testsuite::~Testsuite() {
- for (Common::Array<Test*>::iterator i = _testsToExecute.begin(); i != _testsToExecute.end(); ++i) {
+ for (Common::Array<Test *>::iterator i = _testsToExecute.begin(); i != _testsToExecute.end(); ++i) {
delete (*i);
}
}
@@ -128,7 +128,7 @@
void Testsuite::genReport() const {
logPrintf("\n");
logPrintf("Consolidating results...\n");
- logPrintf("Subsystem: %s ",getName());
+ logPrintf("Subsystem: %s ", getName());
logPrintf("(Tests Executed: %d)\n", _numTestsExecuted);
logPrintf("Passed: %d ", _numTestsPassed);
logPrintf("Failed: %d\n", getNumTestsFailed());
@@ -136,12 +136,12 @@
}
bool Testsuite::handleInteractiveInput(const Common::String &textToDisplay, const char *opt1, const char *opt2, OptionSelected result) {
- GUI::MessageDialog prompt(textToDisplay, opt1, opt2);
+ GUI::MessageDialog prompt(textToDisplay, opt1, opt2);
return prompt.runModal() == result ? true : false;
}
void Testsuite::displayMessage(const Common::String &textToDisplay, const char *defaultButton, const char *altButton) {
- GUI::MessageDialog prompt(textToDisplay, defaultButton);
+ GUI::MessageDialog prompt(textToDisplay, defaultButton);
prompt.runModal();
}
@@ -159,8 +159,8 @@
if (flag) {
Graphics::PixelFormat pf = g_system->getScreenFormat();
- fillColor = pf.RGBToColor(0 , 0, 0);
- textColor = pf.RGBToColor(255 , 255, 255);
+ fillColor = pf.RGBToColor(0, 0, 0);
+ textColor = pf.RGBToColor(255, 255, 255);
}
screen->fillRect(rect, fillColor);
@@ -206,7 +206,7 @@
}
void Testsuite::addTest(const Common::String &name, InvokingFunction f, bool isInteractive) {
- Test* featureTest = new Test(name, f, isInteractive);
+ Test *featureTest = new Test(name, f, isInteractive);
_testsToExecute.push_back(featureTest);
}
@@ -245,7 +245,7 @@
return;
}
- for (Common::Array<Test*>::iterator i = _testsToExecute.begin(); i != _testsToExecute.end(); ++i) {
+ for (Common::Array<Test *>::iterator i = _testsToExecute.begin(); i != _testsToExecute.end(); ++i) {
if (toQuit == kSkipNext) {
logPrintf("Info! Skipping Test: %s, Skipped by user.\n", ((*i)->featureName).c_str());
toQuit = kLoopNormal;
@@ -280,5 +280,4 @@
genReport();
}
-} // end of namespace Testebed
-
+} // End of namespace Testebed
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h 2010-07-14 19:12:31 UTC (rev 50892)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h 2010-07-14 19:44:51 UTC (rev 50893)
@@ -136,7 +136,7 @@
static void deleteWriteStream();
protected:
- Common::Array<Test*> _testsToExecute; ///< List of tests to be executed
+ Common::Array<Test *> _testsToExecute; ///< List of tests to be executed
int _numTestsPassed; ///< Number of tests passed
int _numTestsExecuted; ///< Number of tests executed
bool _isTsEnabled;
@@ -163,6 +163,6 @@
static Common::WriteStream *_ws;
};
-} // End of namespace testbed
+} // End of namespace Testbed
-#endif
+#endif // TESTBED_TESTSUITE_H
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list