[Scummvm-cvs-logs] SF.net SVN: scummvm:[51946] scummvm/branches/gsoc2010-testbed/engines/ testbed
sud03r at users.sourceforge.net
sud03r at users.sourceforge.net
Mon Aug 9 23:18:27 CEST 2010
Revision: 51946
http://scummvm.svn.sourceforge.net/scummvm/?rev=51946&view=rev
Author: sud03r
Date: 2010-08-09 21:18:27 +0000 (Mon, 09 Aug 2010)
Log Message:
-----------
TESTBED: Some more refinements to the GUI and mouse event tests
Modified Paths:
--------------
scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp
scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
scummvm/branches/gsoc2010-testbed/engines/testbed/sound.cpp
scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp 2010-08-09 20:10:53 UTC (rev 51945)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp 2010-08-09 21:18:27 UTC (rev 51946)
@@ -130,11 +130,20 @@
Common::EventManager *eventMan = g_system->getEventManager();
- Common::Point pt(0, 100);
- Common::Rect rect = Testsuite::writeOnScreen("Generate mouse events make L/R/M button clicks", pt);
- pt.y = 120;
- Testsuite::writeOnScreen("Testbed should be able to detect them, Press X to exit", pt);
+ Common::Point pt(0, 30);
+ Common::Rect rectInfo = Testsuite::writeOnScreen("Generate mouse events make L/R/M button clicks, move wheel", pt);
+ pt.y += 15;
+ Testsuite::writeOnScreen("Press X to exit", pt);
+ pt.y = 70;
+ Common::Rect rectLB = Testsuite::writeOnScreen("Left-button click : Not tested", pt);
+ pt.y += 15;
+ Common::Rect rectRB = Testsuite::writeOnScreen("Right-button click : Not tested", pt);
+ pt.y += 15;
+ Common::Rect rectMB = Testsuite::writeOnScreen("Middle-button click : Not tested", pt);
+ pt.y += 15;
+ Common::Rect rectWheel = Testsuite::writeOnScreen("Wheel Movements : Not tested", pt);
+
// Init Mouse Palette
GFXtests::initMousePalette();
Common::Rect finishZone = drawFinishZone();
@@ -158,44 +167,49 @@
// Movements havee already been tested in GFX
break;
case Common::EVENT_LBUTTONDOWN:
- Testsuite::clearScreen(rect);
- Testsuite::writeOnScreen("Mouse left-button pressed", pt);
+ Testsuite::clearScreen(rectInfo);
+ Testsuite::writeOnScreen("Mouse left-button pressed", Common::Point(rectInfo.left, rectInfo.top));
break;
case Common::EVENT_RBUTTONDOWN:
- Testsuite::clearScreen(rect);
- Testsuite::writeOnScreen("Mouse right-button pressed", pt);
+ Testsuite::clearScreen(rectInfo);
+ Testsuite::writeOnScreen("Mouse right-button pressed", Common::Point(rectInfo.left, rectInfo.top));
break;
case Common::EVENT_WHEELDOWN:
- Testsuite::clearScreen(rect);
- Testsuite::writeOnScreen("Mouse wheel moved down", pt);
+ Testsuite::clearScreen(rectInfo);
+ Testsuite::writeOnScreen("Mouse wheel moved down", Common::Point(rectInfo.left, rectInfo.top));
+ Testsuite::writeOnScreen("Wheel Movements : Done!", Common::Point(rectWheel.left, rectWheel.top));
break;
case Common::EVENT_MBUTTONDOWN:
- Testsuite::clearScreen(rect);
- Testsuite::writeOnScreen("Mouse middle-button pressed ", pt);
+ Testsuite::clearScreen(rectInfo);
+ Testsuite::writeOnScreen("Mouse middle-button pressed ", Common::Point(rectInfo.left, rectInfo.top));
break;
case Common::EVENT_LBUTTONUP:
- Testsuite::clearScreen(rect);
+ Testsuite::clearScreen(rectInfo);
if (finishZone.contains(eventMan->getMousePos())) {
quitLoop = true;
}
- Testsuite::writeOnScreen("Mouse left-button released", pt);
+ Testsuite::writeOnScreen("Mouse left-button released", Common::Point(rectInfo.left, rectInfo.top));
+ Testsuite::writeOnScreen("Left-button clicks : Done!", Common::Point(rectLB.left, rectLB.top));
break;
case Common::EVENT_RBUTTONUP:
- Testsuite::clearScreen(rect);
- Testsuite::writeOnScreen("Mouse right-button released", pt);
+ Testsuite::clearScreen(rectInfo);
+ Testsuite::writeOnScreen("Mouse right-button released", Common::Point(rectInfo.left, rectInfo.top));
+ Testsuite::writeOnScreen("Right-button clicks : Done!", Common::Point(rectRB.left, rectRB.top));
break;
case Common::EVENT_WHEELUP:
- Testsuite::clearScreen(rect);
- Testsuite::writeOnScreen("Mouse wheel moved up", pt);
+ Testsuite::clearScreen(rectInfo);
+ Testsuite::writeOnScreen("Mouse wheel moved up", Common::Point(rectInfo.left, rectInfo.top));
+ Testsuite::writeOnScreen("Wheel Movements : Done!", Common::Point(rectWheel.left, rectWheel.top));
break;
case Common::EVENT_MBUTTONUP:
- Testsuite::clearScreen(rect);
- Testsuite::writeOnScreen("Mouse middle-button released ", pt);
+ Testsuite::clearScreen(rectInfo);
+ Testsuite::writeOnScreen("Mouse middle-button released ", Common::Point(rectInfo.left, rectInfo.top));
+ Testsuite::writeOnScreen("Middle-button clicks : Done!", Common::Point(rectMB.left, rectMB.top));
break;
case Common::EVENT_KEYDOWN:
if (event.kbd.keycode == Common::KEYCODE_x) {
- Testsuite::clearScreen(rect);
- Testsuite::writeOnScreen("Exit requested", pt);
+ Testsuite::clearScreen(rectInfo);
+ Testsuite::writeOnScreen("Exit requested", Common::Point(rectInfo.left, rectInfo.top));
quitLoop = true;
}
break;
@@ -209,15 +223,11 @@
CursorMan.showMouse(false);
// Verify results now!
- if (Testsuite::handleInteractiveInput("Were mouse clicks L/R/M buttons identfied?", "Yes", "No", kOptionRight)) {
- Testsuite::logDetailedPrintf("Mouse clicks (L/R/M buttons) failed");
+ if (Testsuite::handleInteractiveInput("Were mouse clicks (L/R/M buttons) and wheel movements identfied ?", "Yes", "No", kOptionRight)) {
+ Testsuite::logDetailedPrintf("Mouse clicks (L/R/M buttons) and wheel movements failed");
passed = kTestFailed;
}
- if (Testsuite::handleInteractiveInput("Were mouse wheel movements identified?", "Yes", "No", kOptionRight)) {
- Testsuite::logDetailedPrintf("Mouse wheel movements failed");
- passed = kTestFailed;
- }
-
+
return passed;
}
@@ -264,7 +274,7 @@
Testsuite::clearScreen();
Common::String info = "Testing Main Menu events.\n "
"Main Menu event is normally trigerred by user pressing (Ctrl + f5).\n"
- "Click 'resume' to continue testbed.";
+ "Click 'resume'(the topmost button) to continue testbed.";
if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
Testsuite::logPrintf("Info! Skipping test : Main Menu\n");
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp 2010-08-09 20:10:53 UTC (rev 51945)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp 2010-08-09 21:18:27 UTC (rev 51946)
@@ -584,7 +584,7 @@
passed = kTestFailed;
}
- if (!Testsuite::handleInteractiveInput("Did test run as was described?")) {
+ if (!Testsuite::handleInteractiveInput(" Did test run as was described? ")) {
passed = kTestFailed;
}
@@ -635,7 +635,7 @@
g_system->delayMillis(1500);
CursorMan.showMouse(false);
- if (Testsuite::handleInteractiveInput("Was the cursor symmetrically contained in the rectangle at (100, 100)?", "Yes", "No", kOptionRight)) {
+ if (Testsuite::handleInteractiveInput("Was the cursor centred in the rectangle at (100, 100)?", "Yes", "No", kOptionRight)) {
return kTestFailed;
}
@@ -670,7 +670,7 @@
g_system->updateScreen();
g_system->delayMillis(1000);
- if (Testsuite::handleInteractiveInput("Did you see yellow rectangle?", "Yes", "No", kOptionRight)) {
+ if (Testsuite::handleInteractiveInput(" Did you see yellow rectangle ? ", "Yes", "No", kOptionRight)) {
return kTestFailed;
}
@@ -718,7 +718,7 @@
Testsuite::displayMessage("feature not supported");
}
- if (Testsuite::handleInteractiveInput("Did you see window minimized?", "Yes", "No", kOptionRight)) {
+ if (Testsuite::handleInteractiveInput(" Did you see the window minimized? ", "Yes", "No", kOptionRight)) {
return kTestFailed;
}
@@ -733,7 +733,7 @@
Testsuite::clearScreen();
Common::String info = "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"
+ "The expected cursor size is drawn as a rectangle.\n The cursor should approximately match 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";
if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
@@ -909,7 +909,8 @@
Common::String info = "Palette rotation. Here we draw a full 256 colored rainbow and then rotate it.\n"
"Note that the screen graphics change without having to draw anything.\n"
- "The palette should appear to rotate, Click the mouse button to exit.";
+ "The palette should appear to rotate, as a result, the background will change its color too.\n"
+ "Click the mouse button to exit.";
if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
Testsuite::logPrintf("Info! Skipping test : palette Rotation\n");
@@ -980,7 +981,7 @@
GFXTestSuite::setCustomColor(255, 0, 0);
Testsuite::clearScreen();
- if(Testsuite::handleInteractiveInput("Did you saw a rotation in colors of rectangles displayed on screen?", "Yes", "No", kOptionRight)) {
+ if(Testsuite::handleInteractiveInput("Did you see a rotation in colors of rectangles displayed on screen?", "Yes", "No", kOptionRight)) {
return kTestFailed;
}
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/sound.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/sound.cpp 2010-08-09 20:10:53 UTC (rev 51945)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/sound.cpp 2010-08-09 21:18:27 UTC (rev 51946)
@@ -133,7 +133,7 @@
g_system->delayMillis(500);
mixer->pauseHandle(handle, true);
- if (Testsuite::handleInteractiveInput("Were you able to hear the left beep?", "Yes", "No", kOptionRight)) {
+ if (Testsuite::handleInteractiveInput(" Were you able to hear the left beep? ", "Yes", "No", kOptionRight)) {
Testsuite::logDetailedPrintf("Error! Left Beep couldn't be detected : Error with Mixer::setChannelBalance()\n");
passed = kTestFailed;
}
Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp 2010-08-09 20:10:53 UTC (rev 51945)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp 2010-08-09 21:18:27 UTC (rev 51946)
@@ -63,7 +63,11 @@
addList(0, _yOffset, 500, 200, strArray, &colors);
text = "More Details can be viewed in the Log file : " + Testsuite::getLogFile();
addText(450, 20, text, Graphics::kTextAlignLeft, 0, 0);
- text = "Directory : " + Testsuite::getLogDir();
+ if (Testsuite::getLogDir().size()) {
+ text = "Directory : " + Testsuite::getLogDir();
+ } else {
+ text = "Directory : .";
+ }
addText(500, 20, text, Graphics::kTextAlignLeft, 0, 0);
_yOffset += 5;
addButtonXY(_xOffset + 80, _yOffset, 120, 24, "Rerun test suite", kCmdRerunTestbed);
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