diff options
author | Neeraj Kumar | 2010-08-09 21:18:27 +0000 |
---|---|---|
committer | Neeraj Kumar | 2010-08-09 21:18:27 +0000 |
commit | acb32580ce440aa687309999ed11ee6e5ca1fa72 (patch) | |
tree | c275cad28bf995fb7d63e4931b7ddc66a03db8e0 | |
parent | 4e92b3a17ea963d3c006c93abd28287e0fac153a (diff) | |
download | scummvm-rg350-acb32580ce440aa687309999ed11ee6e5ca1fa72.tar.gz scummvm-rg350-acb32580ce440aa687309999ed11ee6e5ca1fa72.tar.bz2 scummvm-rg350-acb32580ce440aa687309999ed11ee6e5ca1fa72.zip |
TESTBED: Some more refinements to the GUI and mouse event tests
svn-id: r51946
-rw-r--r-- | engines/testbed/events.cpp | 70 | ||||
-rw-r--r-- | engines/testbed/graphics.cpp | 15 | ||||
-rw-r--r-- | engines/testbed/sound.cpp | 2 | ||||
-rw-r--r-- | engines/testbed/testbed.cpp | 6 |
4 files changed, 54 insertions, 39 deletions
diff --git a/engines/testbed/events.cpp b/engines/testbed/events.cpp index 3858ef0e3a..0bebc30bb1 100644 --- a/engines/testbed/events.cpp +++ b/engines/testbed/events.cpp @@ -130,10 +130,19 @@ TestExitStatus EventTests::mouseEvents() { 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(); @@ -158,44 +167,49 @@ TestExitStatus EventTests::mouseEvents() { // 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 @@ TestExitStatus EventTests::mouseEvents() { 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"); - passed = kTestFailed; - } - if (Testsuite::handleInteractiveInput("Were mouse wheel movements identified?", "Yes", "No", kOptionRight)) { - Testsuite::logDetailedPrintf("Mouse wheel movements 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; } - + return passed; } @@ -264,7 +274,7 @@ TestExitStatus EventTests::showMainMenu() { 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"); diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp index 22b453a763..40f77a98c1 100644 --- a/engines/testbed/graphics.cpp +++ b/engines/testbed/graphics.cpp @@ -584,7 +584,7 @@ TestExitStatus GFXtests::palettizedCursors() { 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 @@ TestExitStatus GFXtests::mouseMovements() { 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 @@ TestExitStatus GFXtests::copyRectToScreen() { 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 @@ TestExitStatus GFXtests::iconifyWindow() { 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 @@ TestExitStatus GFXtests::scaledCursors() { 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 @@ TestExitStatus GFXtests::paletteRotation() { 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 @@ TestExitStatus GFXtests::paletteRotation() { 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; } diff --git a/engines/testbed/sound.cpp b/engines/testbed/sound.cpp index f93dbf0e92..6b56a75b50 100644 --- a/engines/testbed/sound.cpp +++ b/engines/testbed/sound.cpp @@ -133,7 +133,7 @@ TestExitStatus SoundSubsystem::playBeeps() { 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; } diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp index 760213af4f..673858f4c1 100644 --- a/engines/testbed/testbed.cpp +++ b/engines/testbed/testbed.cpp @@ -63,7 +63,11 @@ void TestbedExitDialog::init() { 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); |