int main(int argc, char* argv[]) { // default configuration filename std::string configFilename = "test1.edl"; // parse arguments for (int i = 1; i < argc; i++) { if ( std::string(argv[i]) == "-f" ) { configFilename = argv[++i]; } } // --- // Read in the description files // --- oe::base::StateMachine* stateMachine = builder(configFilename); //stateMachine->serialize(std::cout); // reset the system stateMachine->event(oe::base::Component::RESET_EVENT); // run the test theTest(stateMachine); return EXIT_SUCCESS; }
void Widget::newTest() { QString thestring1, thestring2, thestring3; QString str = QString::number(currentTest); ui->currentTest->setText(str); Test theTest(this->currentTest); if (questionNo % 3 == 0) { this->currentTest++; if (questionNo != 0) { QString thestring = "Test "; QString thestring1 = QString::number(this->testList[this->currentTest-2]->getId()); QString thestring2 = QString::number((this->testList[this->currentTest-2]->getCorrectAnswers())); QString thestring3 = QString::number(this->testList[this->currentTest-2]->getMaxQuestionCount()); // thestring.append(thestring1); // thestring.append(": "); // thestring.append(thestring2); // thestring.append("/"); // thestring.append(thestring3); // thestring.append("\n"); // ui->previousTests->addItem(thestring); //ui->previousTests->addItem(QString::sprintf("Test %d: %d/%d\n", this->testList[this->currentTest-2]->getId(),this->testList[this->currentTest-2]->getCorrectAnswers(), this->testList[this->currentTest-2]->getMaxQuestionCount())); ui->previousTests->addItem("Test " + thestring1 + ": " + thestring2 + "/" + thestring3 + "\n"); } } this->newQuestion(); //this->newTest(); }
//*********************************************************************************** LOCAL_C TInt Execute() { TInt err = KErrNoMemory; CTrapCleanup* cleanup=CTrapCleanup::New(); //can fail if (cleanup) { _LIT(KPlatSecTestName, "PlatSectTaskHandlerTest"); RTest theTest(KPlatSecTestName); theTest.Start(KPlatSecTestName); theTest.Title(); RFile file; // Adopt the task file from the Task Scheduler err = file.AdoptFromCreator(TScheduledTaskFile::FsHandleIndex(), TScheduledTaskFile::FileHandleIndex()); if (err != KErrNone) return err; // The aParam is the name of a file where the relevant CTaskExCmdLine is // do the executing theTest.Next(_L(" @SYMTestCaseID:SYSLIB-SCHSVR-CT-1345 ")); TRAPD(err, ConstructConsoleL(file, theTest)); if(err == KErrNone) { // Sometimes we want to return a bogus error value, // sometimes we don't. TTime now; now.HomeTime(); TInt64 seed = now.Int64(); err = GetRandomNumber(-50, 200, seed); //20% chance of error being returned } file.Close();// Close the file theTest.End(); theTest.Close(); delete cleanup; } SignalTestExe(); return err; }