From 68d691bc3e5ee711daad2979c7db325c16e4c1f0 Mon Sep 17 00:00:00 2001 From: Neeraj Kumar Date: Tue, 29 Jun 2010 22:46:56 +0000 Subject: removed all printfs, added logging feature in form of logPrintf svn-id: r50512 --- engines/testbed/testbed.cpp | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) (limited to 'engines/testbed/testbed.cpp') diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp index 5731483c66..3bb2490cf3 100644 --- a/engines/testbed/testbed.cpp +++ b/engines/testbed/testbed.cpp @@ -22,9 +22,10 @@ * $Id$ */ +#include "common/debug-channels.h" #include "common/scummsys.h" #include "common/system.h" - + #include "engines/util.h" #include "testbed/fs.h" @@ -32,6 +33,7 @@ #include "testbed/misc.h" #include "testbed/savegame.h" #include "testbed/testbed.h" +#include "testbed/testsuite.h" namespace Testbed { @@ -45,38 +47,21 @@ TestbedEngine::TestbedEngine(OSystem *syst) // However this is the place to specify all default directories - printf("TestbedEngine::TestbedEngine()\n"); + DebugMan.addDebugChannel(kTestbedLogOutput, "LOG", "Log of test results generated by testbed"); + DebugMan.addDebugChannel(kTestbedEngineDebug, "Debug", "Engine-specific debug statements"); + DebugMan.enableDebugChannel("LOG"); } TestbedEngine::~TestbedEngine() { - // Dispose your resources here - printf("TestbedEngine::~TestbedEngine()\n"); - + Testsuite::deleteWriteStream(); // Remove all of our debug levels here + DebugMan.clearAllDebugChannels(); } Common::Error TestbedEngine::run() { // Initialize graphics using following: initGraphics(320, 200, false); - // You could use backend transactions directly as an alternative, - // but it isn't recommended, until you want to handle the error values - // from OSystem::endGFXTransaction yourself. - // This is just an example template: - //_system->beginGFXTransaction(); - // // This setup the graphics mode according to users seetings - // initCommonGFX(false); - // - // // Specify dimensions of game graphics window. - // // In this example: 320x200 - // _system->initSize(320, 200); - //FIXME: You really want to handle - //OSystem::kTransactionSizeChangeFailed here - //_system->endGFXTransaction(); - - // Additional setup. - printf("TestbedEngine::init\n"); - // As of now we are using GUI::MessageDialog for interaction, Test if it works. // interactive mode could also be modified by a config parameter "non-interactive=1" // TODO: Implement that @@ -91,8 +76,8 @@ Common::Error TestbedEngine::run() { Testsuite::isInteractive = false; if (Testsuite::isInteractive) { - printf("Running Interactive tests as well\n"); - Testsuite::displayMessage(prompt, "proceed?"); + Testsuite::logPrintf("Info! : Interactive tests are also being executed.\n"); + Testsuite::displayMessage(prompt, "Proceed?"); // Executing GFX Tests GFXTestSuite gts; gts.execute(); -- cgit v1.2.3