CTestThreadContainer Class Reference

class CTestThreadContainer : public CBase

Inherits from

Nested Classes and Structures

Public Member Functions
~CTestThreadContainer ()
TInt AddInterferenceThread ( RThread )
void CancelEvent ( TEventIf &, TRequestStatus *)
void DoNotifyCommand ( TCommand , const TDesC8 &)
TInt DoNotifyEvent ( TEventIf &, TRequestStatus *)
void DoNotifyPrint (const TInt , const TStifInfoName &, const TName &)
void DoRemoteReceive ( TStifCommand , TParams , TInt , TRequestStatus &)
TInt DoRemoteReceiveCancel ()
TInt ExecutionThread ( TAny *)
void ExitReason ( CTestModuleIf::TExitReason &, TInt &)
const TDesC & GetTestCaseArguments ()
void GetTestCaseTitleL ( TDes &)
CStifLogger * GetThreadLogger ()
IMPORT_C CUiEnvProxy * GetUiEnvProxy ()
TInt HandleMeasurementProcess ( CSTIFTestMeasurement::TStifMeasurementStruct )
CTestThreadContainer * NewL ( CTestModuleContainer *, TThreadId )
TInt RemoveInterferenceThread ( RThread )
TInt SetBehavior (const CTestModuleIf::TTestBehavior , TAny *)
void SetExitReason (const CTestModuleIf::TExitReason , const TInt )
void SetThreadLogger ( CStifLogger *)
TInt StifMacroError ( TInt , const TText8 *, const char *, TInt , TInt , TInt , TInt , TInt , TInt , TInt )
void StifMacroErrorInit ()
const RPointerArray < TTestCaseInfo > * TestCases ()
TInt UIExecutionThread ( TAny *)
IMPORT_C TBool UITesting ()
Private Member Functions
CTestThreadContainer ( CTestModuleContainer *)
void ConstructL ( TThreadId )
void DeleteTestModule ()
void DestroyEventQueue ()
TInt DuplicateMutexHandles ( RThread &)
TInt EnumerateInThread ()
void ErrorPrint (const TInt , TPtrC )
void ExceptionHandler ( TExcType )
TInt ExecuteOOMTestCase ( TInt , TInt , TInt , TInt &, TTestResult &)
TInt ExecuteTestCaseInThread ()
void FreeEnumerationDataInThread ()
TInt InitializeModuleInThread ( RLibrary &)
void IsServerAlive ()
void LeakChecksForTestCase ( TBool , TInt , TInt , TInt , TInt )
CTestModuleContainer & ModuleContainer ()
void Panic ( TPanicReason )
void SetEventReq ( TEventDef::TEventCmdType , TEventIf &, TRequestStatus *)
void SetMacroInformation ( TInt , TInt , const TText8 *, const char *, TDes &, TDes &)
void TestComplete ( TInt )
CTestExecution & TestExecution ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Member Enumerations
enum TPanicReason {
EUnknownEventCmd , EInvalidCTestThreadContainer , ECreateTrapCleanup , ENullTestThreadContainer , EReInitializingTestModule , ETestModuleNotInitialized , EInvalidTestModuleOperation , ENullRequest , EDuplicateFail , EServerDied , ENullExecution , EThreadHandleOpenFail
}
Private Attributes
RPointerArray < TTestCaseInfo > * iCases
TUint iCheckResourceFlags
RMutex iCommandMutex
RSemaphore iCommandSem
RSemaphore iErrorPrintSem
RMutex iEventMutex
RSemaphore iEventSem
RMutex iInterferenceMutex
RSemaphore iInterferenceSem
RMutex iMeasurementMutex
RSemaphore iMeasurementSem
CTestModuleContainer * iModuleContainer
RMutex iPrintMutex
RSemaphore iPrintSem
RMutex iRcvMutex
RSemaphore iRcvSem
TRequestStatus iReqStatus
RThread iServerThread
RMutex iSndMutex
RSemaphore iSndSem
TTestMacro iTestMacroInfo
CTestModuleBase * iTestModule
RMutex iTestThreadMutex
CStifLogger * iThreadLogger

Constructor & Destructor Documentation

CTestThreadContainer(CTestModuleContainer *)

CTestThreadContainer ( CTestModuleContainer * aModuleContainer ) [private]

C++ default constructor.

Parameters

CTestModuleContainer * aModuleContainer

~CTestThreadContainer()

~CTestThreadContainer ( ) [virtual]

Destructor of CTestThreadContainer .

Member Functions Documentation

AddInterferenceThread(RThread)

TInt AddInterferenceThread ( RThread aSTIFTestInterference ) [virtual]

With this can be store information about test interference thread to client space.

Parameters

RThread aSTIFTestInterference

CancelEvent(TEventIf &, TRequestStatus *)

void CancelEvent ( TEventIf & aEvent,
TRequestStatus * aStatus
) [virtual]

Cancels pending asynchronous event request. This function is called from test execution thread.

Parameters

TEventIf & aEvent
TRequestStatus * aStatus

ConstructL(TThreadId)

void ConstructL ( TThreadId aServerThreadId ) [private]

By default Symbian OS constructor is private.

Parameters

TThreadId aServerThreadId

DeleteTestModule()

void DeleteTestModule ( ) [private]

Delete a test module instance

DestroyEventQueue()

void DestroyEventQueue ( ) [private]

Destroys the event queue. This function is called from test execution thread.

DoNotifyCommand(TCommand, const TDesC8 &)

void DoNotifyCommand ( TCommand aCommand,
const TDesC8 & aParamsPckg
) [virtual]

Completes a command request. This function is called from test execution thread.

Parameters

TCommand aCommand
const TDesC8 & aParamsPckg

DoNotifyEvent(TEventIf &, TRequestStatus *)

TInt DoNotifyEvent ( TEventIf & aEvent,
TRequestStatus * aStatus = NULL
) [virtual]

Completes a event request. This function is called from test execution thread.

Parameters

TEventIf & aEvent
TRequestStatus * aStatus = NULL

DoNotifyPrint(const TInt, const TStifInfoName &, const TName &)

void DoNotifyPrint ( const TInt aPriority,
const TStifInfoName & aDes,
const TName & aBuffer
) [virtual]

Completes a print request. This function is called from test execution thread.

Parameters

const TInt aPriority
const TStifInfoName & aDes
const TName & aBuffer

DoRemoteReceive(TStifCommand, TParams, TInt, TRequestStatus &)

void DoRemoteReceive ( TStifCommand aRemoteCommand,
TParams aParams,
TInt aLen,
TRequestStatus & aStatus
) [virtual]

Enables remote command receiving. This function is called from test execution thread.

Parameters

TStifCommand aRemoteCommand
TParams aParams
TInt aLen
TRequestStatus & aStatus

DoRemoteReceiveCancel()

TInt DoRemoteReceiveCancel ( ) [virtual]

Cancel remote command receiving. This function is called from test execution thread.

DuplicateMutexHandles(RThread &)

TInt DuplicateMutexHandles ( RThread & aThread ) [private]

Duplicates mutexes

Parameters

RThread & aThread

EnumerateInThread()

TInt EnumerateInThread ( ) [private]

Function that enumerates test cases in execution thread context.

ErrorPrint(const TInt, TPtrC)

void ErrorPrint ( const TInt aPriority,
TPtrC aError
) [private]

Error print.

Parameters

const TInt aPriority
TPtrC aError

ExceptionHandler(TExcType)

void ExceptionHandler ( TExcType ) [private, static]

Exception handler

Parameters

TExcType

ExecuteOOMTestCase(TInt, TInt, TInt, TInt &, TTestResult &)

TInt ExecuteOOMTestCase ( TInt aTestCaseNumber,
TInt aFirst,
TInt aLast,
TInt & aResult,
TTestResult & caseResult
) [private]

Executes test case using OOM simulation

Parameters

TInt aTestCaseNumber
TInt aFirst
TInt aLast
TInt & aResult
TTestResult & caseResult

ExecuteTestCaseInThread()

TInt ExecuteTestCaseInThread ( ) [private]

Function that executes test case in execution thread context.

ExecutionThread(TAny *)

TInt ExecutionThread ( TAny * aParams ) [static]

Test case execution thread thread function

Parameters

TAny * aParams

ExitReason(CTestModuleIf::TExitReason &, TInt &)

void ExitReason ( CTestModuleIf::TExitReason & aExitReason,
TInt & aExitCode
) [virtual]

Get exit reason.

Parameters

CTestModuleIf::TExitReason & aExitReason
TInt & aExitCode

FreeEnumerationDataInThread()

void FreeEnumerationDataInThread ( ) [private]

Function that frees the enumeration data in execution thread context.

GetTestCaseArguments()

const TDesC & GetTestCaseArguments ( ) const [virtual]

Get test case execution arguments

GetTestCaseTitleL(TDes &)

void GetTestCaseTitleL ( TDes & aTestCaseTitle ) [virtual]

Obtain title of currently running test case.

Parameters

TDes & aTestCaseTitle

GetThreadLogger()

CStifLogger * GetThreadLogger ( )

Gets thread logger.

GetUiEnvProxy()

IMPORT_C CUiEnvProxy * GetUiEnvProxy ( )

Gets UIEnvProxy.

HandleMeasurementProcess(CSTIFTestMeasurement::TStifMeasurementStruct)

TInt HandleMeasurementProcess ( CSTIFTestMeasurement::TStifMeasurementStruct aSTIFMeasurementInfo ) [virtual]

With this can be stored information about test measurement to TestServer space.

Parameters

CSTIFTestMeasurement::TStifMeasurementStruct aSTIFMeasurementInfo

InitializeModuleInThread(RLibrary &)

TInt InitializeModuleInThread ( RLibrary & aModule ) [private]

Function that initialise module in execution thread context.

Parameters

RLibrary & aModule

IsServerAlive()

void IsServerAlive ( ) const [private]

Check that server is alive.

LeakChecksForTestCase(TBool, TInt, TInt, TInt, TInt)

void LeakChecksForTestCase ( TBool aReturnLeakCheckFail,
TInt aThreadHandleCountBeforeTest,
TInt aThreadHandleCountAfterTest,
TInt aRequestCountBeforeTest,
TInt aRequestCountAfterTest
) [private]

Leak checks for test case

Parameters

TBool aReturnLeakCheckFail
TInt aThreadHandleCountBeforeTest
TInt aThreadHandleCountAfterTest
TInt aRequestCountBeforeTest
TInt aRequestCountAfterTest

ModuleContainer()

CTestModuleContainer & ModuleContainer ( ) [private]

Get module container.

NewL(CTestModuleContainer *, TThreadId)

CTestThreadContainer * NewL ( CTestModuleContainer * aModuleContainer,
TThreadId aServerThreadId
) [static]

NewL is first phase of two-phased constructor.

Parameters

CTestModuleContainer * aModuleContainer
TThreadId aServerThreadId

Panic(TPanicReason)

void Panic ( TPanicReason aReason ) [private, static]

Panicing function for test thread.

Parameters

TPanicReason aReason

RemoveInterferenceThread(RThread)

TInt RemoveInterferenceThread ( RThread aSTIFTestInterference ) [virtual]

With this can be remove information about test interference thread from client space.

Parameters

RThread aSTIFTestInterference

SetBehavior(const CTestModuleIf::TTestBehavior, TAny *)

TInt SetBehavior ( const CTestModuleIf::TTestBehavior aType,
TAny * aPtr
) [virtual]

Set test behavior.

Parameters

const CTestModuleIf::TTestBehavior aType
TAny * aPtr

SetEventReq(TEventDef::TEventCmdType, TEventIf &, TRequestStatus *)

void SetEventReq ( TEventDef::TEventCmdType aType,
TEventIf & aEvent,
TRequestStatus * aStatus
) [private]

SetExitReason(const CTestModuleIf::TExitReason, const TInt)

void SetExitReason ( const CTestModuleIf::TExitReason aExitReason,
const TInt aExitCode
) [virtual]

Set exit reason.

Parameters

const CTestModuleIf::TExitReason aExitReason
const TInt aExitCode

SetMacroInformation(TInt, TInt, const TText8 *, const char *, TDes &, TDes &)

void SetMacroInformation ( TInt aFileMaxLength,
TInt aFuntionMaxLength,
const TText8 * aRecFile,
const char * aRecFunction,
TDes & aFile,
TDes & aFunction
) [private]

Modifies aRecFile and aRecFunction lenghts if nesessarily.

Parameters

TInt aFileMaxLength
TInt aFuntionMaxLength
const TText8 * aRecFile
const char * aRecFunction
TDes & aFile
TDes & aFunction

SetThreadLogger(CStifLogger *)

void SetThreadLogger ( CStifLogger * aThreadLogger )

Sets thread logger.

Parameters

CStifLogger * aThreadLogger

StifMacroError(TInt, const TText8 *, const char *, TInt, TInt, TInt, TInt, TInt, TInt, TInt)

TInt StifMacroError ( TInt aMacroType,
const TText8 * aFile,
const char * aFunction,
TInt aLine,
TInt aResult,
TInt aExpected1,
TInt aExpected2,
TInt aExpected3,
TInt aExpected4,
TInt aExpected5
) [virtual]

STIF TF's(TL, T1L, T2L, etc )macro. Saves information for later use.

Parameters

TInt aMacroType
const TText8 * aFile
const char * aFunction
TInt aLine
TInt aResult
TInt aExpected1
TInt aExpected2
TInt aExpected3
TInt aExpected4
TInt aExpected5

StifMacroErrorInit()

void StifMacroErrorInit ( ) [virtual]

STIF TF's macro. Initialized TTestMacro .

TestCases()

const RPointerArray < TTestCaseInfo > * TestCases ( ) const

Returns pointer to test cases

TestComplete(TInt)

void TestComplete ( TInt aCompletionCode ) [private]

Complete testcase.

Parameters

TInt aCompletionCode

TestExecution()

CTestExecution & TestExecution ( ) const [private]

Handles to parent.

UIExecutionThread(TAny *)

TInt UIExecutionThread ( TAny * aParams ) [static]

UI Test case execution thread thread function

Parameters

TAny * aParams

UITesting()

IMPORT_C TBool UITesting ( )

Gets information if testserver supports UI testing.

Member Enumerations Documentation

Enum TPanicReason

Enumerators

EUnknownEventCmd
EInvalidCTestThreadContainer
ECreateTrapCleanup
ENullTestThreadContainer
EReInitializingTestModule
ETestModuleNotInitialized
EInvalidTestModuleOperation
ENullRequest
EDuplicateFail
EServerDied
ENullExecution
EThreadHandleOpenFail

Member Data Documentation

RPointerArray< TTestCaseInfo > * iCases

RPointerArray < TTestCaseInfo > * iCases [private]

TUint iCheckResourceFlags

TUint iCheckResourceFlags [private]

RMutex iCommandMutex

RMutex iCommandMutex [private]

RSemaphore iCommandSem

RSemaphore iCommandSem [private]

RSemaphore iErrorPrintSem

RSemaphore iErrorPrintSem [private]

RMutex iEventMutex

RMutex iEventMutex [private]

RSemaphore iEventSem

RSemaphore iEventSem [private]

RMutex iInterferenceMutex

RMutex iInterferenceMutex [private]

RSemaphore iInterferenceSem

RSemaphore iInterferenceSem [private]

RMutex iMeasurementMutex

RMutex iMeasurementMutex [private]

RSemaphore iMeasurementSem

RSemaphore iMeasurementSem [private]

CTestModuleContainer * iModuleContainer

CTestModuleContainer * iModuleContainer [private]

RMutex iPrintMutex

RMutex iPrintMutex [private]

RSemaphore iPrintSem

RSemaphore iPrintSem [private]

RMutex iRcvMutex

RMutex iRcvMutex [private]

RSemaphore iRcvSem

RSemaphore iRcvSem [private]

TRequestStatus iReqStatus

TRequestStatus iReqStatus [private]

RThread iServerThread

RThread iServerThread [private]

RMutex iSndMutex

RMutex iSndMutex [private]

RSemaphore iSndSem

RSemaphore iSndSem [private]

TTestMacro iTestMacroInfo

TTestMacro iTestMacroInfo [private]

CTestModuleBase * iTestModule

CTestModuleBase * iTestModule [private]

RMutex iTestThreadMutex

RMutex iTestThreadMutex [private]

CStifLogger * iThreadLogger

CStifLogger * iThreadLogger [private]