/* ------------------------------------------------------------------------------- Class: COomTestHarness Method: ConstructL Description: Symbian 2nd phase constructor that can leave. Note: If OOM test case uses STIF Logger, then STIF Logger must be created with static buffer size parameter (aStaticBufferSize). Otherwise Logger allocates memory from heap and therefore causes error situations with OOM testing. For more information about STIF Logger construction, see STIF Users Guide. Parameters: None Return Values: None Errors/Exceptions: None Status: Approved ------------------------------------------------------------------------------- */ void COomTestHarness::ConstructL() { //Read logger settings to check whether test case name is to be //appended to log file name. RSettingServer settingServer; TInt ret = settingServer.Connect(); if(ret != KErrNone) { User::Leave(ret); } // Struct to StifLogger settigs. TLoggerSettings loggerSettings; // Parse StifLogger defaults from STIF initialization file. ret = settingServer.GetLoggerSettings(loggerSettings); if(ret != KErrNone) { User::Leave(ret); } // Close Setting server session settingServer.Close(); iAddTestCaseTitleToLogName = loggerSettings.iAddTestCaseTitle; // Constructing static buffer size logger, needed with OOM testing because // normally logger allocates memory from heap! iStdLog = CStifLogger::NewL( KT_OomHarnessLogPath, KT_OomHarnessLogFile, CStifLogger::ETxt, CStifLogger::EFile, ETrue, ETrue, ETrue, EFalse, ETrue, EFalse, 100 ); iLog = iStdLog; // Sample how to use logging _LIT( KLogInfo, "t_oomharness logging starts!" ); iLog->Log( KLogInfo ); User::LeaveIfError(iAllocServer.Connect()); User::LeaveIfError(iOomSession.Connect()); User::LeaveIfError(iChunk.CreateLocal(KOomHarnessInitialEatenMemory, KOomHarnessMaxEatenMemory)); iChunkSize = KOomHarnessInitialEatenMemory; iScheduler = new (ELeave) CActiveScheduler; CActiveScheduler::Install( iScheduler ); iStatusWatcher = CMemoryMonitorStatusWatcher::NewL(); iTimeoutWatcher = CMemoryMonitorTimeoutWatcher::NewL(); ResetL(); }
// ----------------------------------------------------------------------------- // Ctestsdktouchpane::ConstructL // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // void CTestSDKTouchPane::ConstructL() { iView = CTestSDKTPView::NewL(); iContainer = new( ELeave ) CTestSDKTPContainer(); iContainer->SetMopParent( iView ); iContainer->ConstructL( iView->ClientRect() ); CCoeEnv::Static()->AppUi()->AddToStackL( iContainer ); iContainer->MakeVisible( ETrue ); //Read logger settings to check whether test case name is to be //appended to log file name. RSettingServer settingServer; CleanupClosePushL( settingServer ); TInt ret = settingServer.Connect(); if ( ret != KErrNone ) { User::Leave(ret); } // Struct to StifLogger settigs. TLoggerSettings loggerSettings; // Parse StifLogger defaults from STIF initialization file. ret = settingServer.GetLoggerSettings( loggerSettings ); if ( ret != KErrNone ) { User::Leave( ret ); } // Close Setting server session settingServer.Close(); CleanupStack::PopAndDestroy( &settingServer ); TFileName logFileName; if ( loggerSettings.iAddTestCaseTitle ) { TName title; TestModuleIf().GetTestCaseTitleL( title ); logFileName.Format( KtestsdktouchpaneLogFileWithTitle, &title ); } else { logFileName.Copy( KtestsdktouchpaneLogFile ); } iLog = CStifLogger::NewL( KtestsdktouchpaneLogPath, logFileName, CStifLogger::ETxt, CStifLogger::EFile, EFalse ); SendTestClassVersion(); iOffset = CCoeEnv::Static()->AddResourceFileL( _L( "C:\\resource\\testsdktouchpane.rsc" ) ); }
// ----------------------------------------------------------------------------- // CTestSDKButtons::ConstructL // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // void CTestSDKButtons::ConstructL() { //Read logger settings to check whether test case name is to be //appended to log file name. RSettingServer settingServer; CleanupClosePushL( settingServer ); TInt ret = settingServer.Connect(); if(ret != KErrNone) { User::Leave(ret); } // Struct to StifLogger settigs. TLoggerSettings loggerSettings; // Parse StifLogger defaults from STIF initialization file. ret = settingServer.GetLoggerSettings(loggerSettings); if(ret != KErrNone) { User::Leave(ret); } // Close Setting server session settingServer.Close(); CleanupStack::PopAndDestroy( &settingServer ); TFileName logFileName; if(loggerSettings.iAddTestCaseTitle) { TName title; TestModuleIf().GetTestCaseTitleL(title); logFileName.Format(KtestsdkbuttonsLogFileWithTitle, &title); } else { logFileName.Copy(KtestsdkbuttonsLogFile); } iLog = CStifLogger::NewL( KtestsdkbuttonsLogPath, logFileName, CStifLogger::ETxt, CStifLogger::EFile, EFalse ); TRect rect = CEikonEnv::Static()->EikAppUi()->ClientRect(); iContainer = CButtonControl::NewL( rect ); iOffset = CCoeEnv::Static()->AddResourceFileL( KResourceFile ); SendTestClassVersion(); }
// ----------------------------------------------------------------------------- // CTestSdkPrivateUiFramework::ConstructL // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // void CTestSdkPrivateUiFramework::ConstructL() { //Read logger settings to check whether test case name is to be //appended to log file name. RSettingServer settingServer; CleanupClosePushL( settingServer ); TInt ret = settingServer.Connect(); if ( ret != KErrNone ) { User::Leave(ret); } // Struct to StifLogger settigs. TLoggerSettings loggerSettings; // Parse StifLogger defaults from STIF initialization file. ret = settingServer.GetLoggerSettings( loggerSettings ); if ( ret != KErrNone ) { User::Leave( ret ); } // Close Setting server session settingServer.Close(); CleanupStack::PopAndDestroy( &settingServer ); TFileName logFileName; if ( loggerSettings.iAddTestCaseTitle ) { TName title; TestModuleIf().GetTestCaseTitleL( title ); logFileName.Format( KtestsdkprivateuiframeworkLogFileWithTitle, &title ); } else { logFileName.Copy( KtestsdkprivateuiframeworkLogFile ); } iLog = CStifLogger::NewL( KtestsdkprivateuiframeworkLogPath, logFileName, CStifLogger::ETxt, CStifLogger::EFile, EFalse ); SendTestClassVersion(); _LIT( KResourceFile, "c:\\resource\\testsdkprivateuiframework.rsc" ); iOffset = CCoeEnv::Static()->AddResourceFileL( KResourceFile ); }
// ----------------------------------------------------------------------------- // Ctestsdkfonts::ConstructL // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // void CTestSdkFonts::ConstructL() { //Read logger settings to check whether test case name is to be //appended to log file name. RSettingServer settingServer; CleanupClosePushL( settingServer ); TInt ret = settingServer.Connect(); if ( ret != KErrNone ) { User::Leave(ret); } // Struct to StifLogger settigs. TLoggerSettings loggerSettings; // Parse StifLogger defaults from STIF initialization file. ret = settingServer.GetLoggerSettings( loggerSettings ); if ( ret != KErrNone ) { User::Leave( ret ); } // Close Setting server session settingServer.Close(); CleanupStack::PopAndDestroy( &settingServer ); TFileName logFileName; if ( loggerSettings.iAddTestCaseTitle ) { TName title; TestModuleIf().GetTestCaseTitleL( title ); logFileName.Format( KtestsdkfontsLogFileWithTitle, &title ); } else { logFileName.Copy( KtestsdkfontsLogFile ); } iLog = CStifLogger::NewL( KtestsdkfontsLogPath, logFileName, CStifLogger::ETxt, CStifLogger::EFile, EFalse ); SendTestClassVersion(); iFontAccess = new ( ELeave ) AknFontAccess; }
// ----------------------------------------------------------------------------- // CDRM_CAF::ConstructL // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // void CDRM_CAF::ConstructL() { //Read logger settings to check whether test case name is to be //appended to log file name. User::LeaveIfError( iFs.Connect() ); // CleanupClosePushL( iFs ); CreateDirL(); RSettingServer settingServer; TInt ret = settingServer.Connect(); if(ret != KErrNone) { User::Leave(ret); } // Struct to StifLogger settigs. TLoggerSettings loggerSettings; // Parse StifLogger defaults from STIF initialization file. ret = settingServer.GetLoggerSettings(loggerSettings); if(ret != KErrNone) { User::Leave(ret); } // Close Setting server session settingServer.Close(); TFileName logFileName; if(loggerSettings.iAddTestCaseTitle) { TName title; TestModuleIf().GetTestCaseTitleL(title); logFileName.Format(KDRM_CAFLogFileWithTitle, &title); } else { logFileName.Copy(KDRM_CAFLogFile); } iLog = CStifLogger::NewL( KDRM_CAFLogPath, logFileName, CStifLogger::ETxt, CStifLogger::EFile, EFalse ); SendTestClassVersion(); }
// ----------------------------------------------------------------------------- // CMmsClientMtmApiTest::ConstructL // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // void CMmsClientMtmApiTest::ConstructL() { //Read logger settings to check whether test case name is to be //appended to log file name. RSettingServer settingServer; TInt ret = settingServer.Connect(); if(ret != KErrNone) { User::Leave(ret); } // Struct to StifLogger settigs. TLoggerSettings loggerSettings; // Parse StifLogger defaults from STIF initialization file. ret = settingServer.GetLoggerSettings(loggerSettings); if(ret != KErrNone) { User::Leave(ret); } // Close Setting server session settingServer.Close(); TFileName logFileName; if(loggerSettings.iAddTestCaseTitle) { TName title; TestModuleIf().GetTestCaseTitleL(title); logFileName.Format(KMmsClientMtmApiTestLogFileWithTitle, &title); } else { logFileName.Copy(KMmsClientMtmApiTestLogFile); } iLog = CStifLogger::NewL( KMmsClientMtmApiTestLogPath, logFileName, CStifLogger::ETxt, CStifLogger::EFile, EFalse ); iSession = CMsvSession::OpenSyncL(*this); iMtmRegistry = CClientMtmRegistry::NewL(*iSession); iClientMtm = (CMmsClientMtm *) iMtmRegistry-> NewMtmL(KUidMsgTypeMultimedia); SendTestClassVersion(); }
// ----------------------------------------------------------------------------- // CAdvancedTriggerSupervision::ConstructL // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // void CAdvancedTriggerSupervision::ConstructL() { //Read logger settings to check whether test case name is to be //appended to log file name. RSettingServer settingServer; TInt ret = settingServer.Connect(); if(ret != KErrNone) { User::Leave(ret); } // Struct to StifLogger settigs. TLoggerSettings loggerSettings; // Parse StifLogger defaults from STIF initialization file. ret = settingServer.GetLoggerSettings(loggerSettings); if(ret != KErrNone) { User::Leave(ret); } // Close Setting server session settingServer.Close(); TFileName logFileName; if(loggerSettings.iAddTestCaseTitle) { TName title; TestModuleIf().GetTestCaseTitleL(title); logFileName.Format(KAdvancedTriggerSupervisionLogFileWithTitle, &title); } else { logFileName.Copy(KAdvancedTriggerSupervisionLogFile); } iLog = CStifLogger::NewL( KAdvancedTriggerSupervisionLogPath, logFileName, CStifLogger::ETxt, CStifLogger::EFile, EFalse ); iProEngine= ProEngFactory::NewEngineL(); }
// ----------------------------------------------------------------------------- // Ctestdomalarm::ConstructL // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // void Ctestdomalarm::ConstructL() { RSettingServer settingServer; CleanupClosePushL( settingServer ); TInt ret = settingServer.Connect(); if ( ret != KErrNone ) { User::Leave(ret); } TLoggerSettings loggerSettings; ret = settingServer.GetLoggerSettings( loggerSettings ); if ( ret != KErrNone ) { User::Leave( ret ); } settingServer.Close(); CleanupStack::PopAndDestroy( &settingServer ); TFileName logFileName; if ( loggerSettings.iAddTestCaseTitle ) { TName title; TestModuleIf().GetTestCaseTitleL( title ); logFileName.Format( KtestdomalarmLogFileWithTitle, &title ); } else { logFileName.Copy( KtestdomalarmLogFile ); } iLog = CStifLogger::NewL( KtestdomalarmLogPath, logFileName, CStifLogger::ETxt, CStifLogger::EFile, EFalse ); SendTestClassVersion(); }
// ----------------------------------------------------------------------------- // CTestPlatAlfVisual::ConstructL // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // void CTestPlatAlfVisual::ConstructL() { //Read logger settings to check whether test case name is to be //appended to log file name. RSettingServer settingServer; CleanupClosePushL( settingServer ); TInt ret = settingServer.Connect(); if ( ret != KErrNone ) { User::Leave(ret); } // Struct to StifLogger settigs. TLoggerSettings loggerSettings; // Parse StifLogger defaults from STIF initialization file. ret = settingServer.GetLoggerSettings( loggerSettings ); if ( ret != KErrNone ) { User::Leave( ret ); } // Close Setting server session settingServer.Close(); CleanupStack::PopAndDestroy( &settingServer ); TFileName logFileName; if ( loggerSettings.iAddTestCaseTitle ) { TName title; TestModuleIf().GetTestCaseTitleL( title ); logFileName.Format( KtestplatalfvisualLogFileWithTitle, &title ); } else { logFileName.Copy( KtestplatalfvisualLogFile ); } iLog = CStifLogger::NewL( KtestplatalfvisualLogPath, logFileName, CStifLogger::ETxt, CStifLogger::EFile, EFalse ); SendTestClassVersion(); TurnOffScreenSaver(); // Create CAlfEnv instance iAlfEnv = CAlfEnv::NewL(); TRect rect = CEikonEnv::Static()->AppUiFactory()->ClientRect(); iAlfDisplay = &( iAlfEnv->NewDisplayL( rect ) ); iAlfCtrlGroup = &( iAlfEnv->NewControlGroupL( KControlGroupId ) ); // Create CAlfControl instance iAlfCtl = new ( ELeave ) CAlfControl; iAlfCtl->ConstructL( *iAlfEnv ); iAlfCtrlGroup->AppendL( iAlfCtl ); iAlfCtl->BindDisplay( *iAlfDisplay ); }