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
This commit is contained in:
commit
a16832760b
25 changed files with 928 additions and 433 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue