diff options
author | Neeraj Kumar | 2010-10-02 01:05:16 +0000 |
---|---|---|
committer | Neeraj Kumar | 2010-10-02 01:05:16 +0000 |
commit | a16832760bfd1916ad60938e177a5ca6b920d781 (patch) | |
tree | be8dd3757cc98ce6596e0a37a6a6e42168102950 /engines/testbed/misc.cpp | |
parent | f94752f7528c406d68353dc75cad4047c4af86a2 (diff) | |
parent | 81a646c9bd32662f2a72fc0b3db32105857b9416 (diff) | |
download | scummvm-rg350-a16832760bfd1916ad60938e177a5ca6b920d781.tar.gz scummvm-rg350-a16832760bfd1916ad60938e177a5ca6b920d781.tar.bz2 scummvm-rg350-a16832760bfd1916ad60938e177a5ca6b920d781.zip |
1. Added ConfigParams Singelton class to eliminate use of configuration specific static variables.
2. Modified code to handle the change
3. Updated the previously merged obsolete copy of branch gsoc2010-testbed.
svn-id: r52973
Diffstat (limited to 'engines/testbed/misc.cpp')
-rw-r--r-- | engines/testbed/misc.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/engines/testbed/misc.cpp b/engines/testbed/misc.cpp index 74f0af2948..2159974c51 100644 --- a/engines/testbed/misc.cpp +++ b/engines/testbed/misc.cpp @@ -66,28 +66,28 @@ void MiscTests::criticalSection(void *arg) { g_system->getTimerManager()->removeTimerProc(criticalSection); } -bool MiscTests::testDateTime() { - - if (Testsuite::isSessionInteractive) { +TestExitStatus MiscTests::testDateTime() { + + if (ConfParams.isSessionInteractive()) { if (Testsuite::handleInteractiveInput("Testing the date time API implementation", "Continue", "Skip", kOptionRight)) { Testsuite::logPrintf("Info! Date time tests skipped by the user.\n"); - return true; + return kTestSkipped; } - + Testsuite::writeOnScreen("Verifying Date-Time...", Common::Point(0, 100)); } - + TimeDate t1, t2; g_system->getTimeAndDate(t1); Testsuite::logDetailedPrintf("Current Time and Date: "); Common::String dateTimeNow; dateTimeNow = getHumanReadableFormat(t1); - if (Testsuite::isSessionInteractive) { + if (ConfParams.isSessionInteractive()) { // Directly verify date dateTimeNow = "We expect the current date time to be " + dateTimeNow; if (Testsuite::handleInteractiveInput(dateTimeNow, "Correct!", "Wrong", kOptionRight)) { - return false; + return kTestFailed; } } @@ -105,32 +105,32 @@ bool MiscTests::testDateTime() { 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; + return kTestPassed; } } } - return false; + return kTestFailed; } -bool MiscTests::testTimers() { +TestExitStatus MiscTests::testTimers() { static int valToModify = 0; if (g_system->getTimerManager()->installTimerProc(timerCallback, 100000, &valToModify)) { g_system->delayMillis(150); g_system->getTimerManager()->removeTimerProc(timerCallback); if (999 == valToModify) { - return true; + return kTestPassed; } } - return false; + return kTestFailed; } -bool MiscTests::testMutexes() { - - if (Testsuite::isSessionInteractive) { +TestExitStatus MiscTests::testMutexes() { + + if (ConfParams.isSessionInteractive()) { if (Testsuite::handleInteractiveInput("Testing the Mutual Exclusion API implementation", "Continue", "Skip", kOptionRight)) { Testsuite::logPrintf("Info! Mutex tests skipped by the user.\n"); - return true; + return kTestSkipped; } Testsuite::writeOnScreen("Installing mutex", Common::Point(0, 100)); } @@ -148,7 +148,7 @@ bool MiscTests::testMutexes() { g_system->unlockMutex(sv.mutex); // wait till timed process exits - if (Testsuite::isSessionInteractive) { + if (ConfParams.isSessionInteractive()) { Testsuite::writeOnScreen("Waiting for 3s so that timed processes finish", Common::Point(0, 100)); } g_system->delayMillis(3000); @@ -157,10 +157,10 @@ bool MiscTests::testMutexes() { g_system->deleteMutex(sv.mutex); if (sv.resultSoFar && 6 == sv.second) { - return true; + return kTestPassed; } - return false; + return kTestFailed; } MiscTestSuite::MiscTestSuite() { |