CTestThreadContainer Class Reference

class CTestThreadContainer : public CBase

Inherits from

  • CTestThreadContainer

Nested Classes and Structures

Public Member Functions
~CTestThreadContainer()
TInt AddInterferenceThread(RThread)
voidCancelEvent(TEventIf &, TRequestStatus *)
voidDoNotifyCommand(TCommand, const TDesC8 &)
TInt DoNotifyEvent(TEventIf &, TRequestStatus *)
voidDoNotifyPrint(const TInt, const TStifInfoName &, const TName &)
voidDoRemoteReceive(TStifCommand, TParams, TInt, TRequestStatus &)
TInt DoRemoteReceiveCancel()
TInt ExecutionThread(TAny *)
voidExitReason(CTestModuleIf::TExitReason &, TInt &)
const TDesC &GetTestCaseArguments()
voidGetTestCaseTitleL(TDes &)
CStifLogger *GetThreadLogger()
IMPORT_C CUiEnvProxy *GetUiEnvProxy()
TInt HandleMeasurementProcess(CSTIFTestMeasurement::TStifMeasurementStruct)
CTestThreadContainer *NewL(CTestModuleContainer *, TThreadId)
TInt RemoveInterferenceThread(RThread)
TInt SetBehavior(const CTestModuleIf::TTestBehavior, TAny *)
voidSetExitReason(const CTestModuleIf::TExitReason, const TInt)
voidSetThreadLogger(CStifLogger *)
TInt StifMacroError(TInt, const TText8 *, const char *, TInt, TInt, TInt, TInt, TInt, TInt, TInt)
voidStifMacroErrorInit()
const RPointerArray< TTestCaseInfo > *TestCases()
TInt UIExecutionThread(TAny *)
IMPORT_C TBoolUITesting()
Private Member Functions
CTestThreadContainer(CTestModuleContainer *)
voidConstructL(TThreadId)
voidDeleteTestModule()
voidDestroyEventQueue()
TInt DuplicateMutexHandles(RThread &)
TInt EnumerateInThread()
voidErrorPrint(const TInt, TPtrC)
voidExceptionHandler(TExcType)
TInt ExecuteOOMTestCase(TInt, TInt, TInt, TInt &, TTestResult &)
TInt ExecuteTestCaseInThread()
voidFreeEnumerationDataInThread()
TInt InitializeModuleInThread(RLibrary &)
voidIsServerAlive()
voidLeakChecksForTestCase(TBool, TInt, TInt, TInt, TInt)
CTestModuleContainer &ModuleContainer()
voidPanic(TPanicReason)
voidSetEventReq(TEventDef::TEventCmdType, TEventIf &, TRequestStatus *)
voidSetMacroInformation(TInt, TInt, const TText8 *, const char *, TDes &, TDes &)
voidTestComplete(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
enumTPanicReason {
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(RThreadaSTIFTestInterference)[virtual]

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

Parameters

RThread aSTIFTestInterference

CancelEvent(TEventIf &, TRequestStatus *)

voidCancelEvent(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)

voidConstructL(TThreadIdaServerThreadId)[private]

By default Symbian OS constructor is private.

Parameters

TThreadId aServerThreadId

DeleteTestModule()

voidDeleteTestModule()[private]

Delete a test module instance

DestroyEventQueue()

voidDestroyEventQueue()[private]

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

DoNotifyCommand(TCommand, const TDesC8 &)

voidDoNotifyCommand(TCommandaCommand,
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 &)

voidDoNotifyPrint(const TIntaPriority,
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 &)

voidDoRemoteReceive(TStifCommandaRemoteCommand,
TParamsaParams,
TIntaLen,
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)

voidErrorPrint(const TIntaPriority,
TPtrCaError
)[private]

Error print.

Parameters

const TInt aPriority
TPtrC aError

ExceptionHandler(TExcType)

voidExceptionHandler(TExcType)[private, static]

Exception handler

Parameters

TExcType

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

TInt ExecuteOOMTestCase(TIntaTestCaseNumber,
TIntaFirst,
TIntaLast,
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 &)

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

Get exit reason.

Parameters

CTestModuleIf::TExitReason & aExitReason
TInt & aExitCode

FreeEnumerationDataInThread()

voidFreeEnumerationDataInThread()[private]

Function that frees the enumeration data in execution thread context.

GetTestCaseArguments()

const TDesC &GetTestCaseArguments()const [virtual]

Get test case execution arguments

GetTestCaseTitleL(TDes &)

voidGetTestCaseTitleL(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::TStifMeasurementStructaSTIFMeasurementInfo)[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()

voidIsServerAlive()const [private]

Check that server is alive.

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

voidLeakChecksForTestCase(TBoolaReturnLeakCheckFail,
TIntaThreadHandleCountBeforeTest,
TIntaThreadHandleCountAfterTest,
TIntaRequestCountBeforeTest,
TIntaRequestCountAfterTest
)[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,
TThreadIdaServerThreadId
)[static]

NewL is first phase of two-phased constructor.

Parameters

CTestModuleContainer * aModuleContainer
TThreadId aServerThreadId

Panic(TPanicReason)

voidPanic(TPanicReasonaReason)[private, static]

Panicing function for test thread.

Parameters

TPanicReason aReason

RemoveInterferenceThread(RThread)

TInt RemoveInterferenceThread(RThreadaSTIFTestInterference)[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::TTestBehavioraType,
TAny *aPtr
)[virtual]

Set test behavior.

Parameters

const CTestModuleIf::TTestBehavior aType
TAny * aPtr

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

voidSetEventReq(TEventDef::TEventCmdTypeaType,
TEventIf &aEvent,
TRequestStatus *aStatus
)[private]

Parameters

TEventDef::TEventCmdType aType
TEventIf & aEvent
TRequestStatus * aStatus

SetExitReason(const CTestModuleIf::TExitReason, const TInt)

voidSetExitReason(const CTestModuleIf::TExitReasonaExitReason,
const TIntaExitCode
)[virtual]

Set exit reason.

Parameters

const CTestModuleIf::TExitReason aExitReason
const TInt aExitCode

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

voidSetMacroInformation(TIntaFileMaxLength,
TIntaFuntionMaxLength,
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 *)

voidSetThreadLogger(CStifLogger *aThreadLogger)

Sets thread logger.

Parameters

CStifLogger * aThreadLogger

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

TInt StifMacroError(TIntaMacroType,
const TText8 *aFile,
const char *aFunction,
TIntaLine,
TIntaResult,
TIntaExpected1,
TIntaExpected2,
TIntaExpected3,
TIntaExpected4,
TIntaExpected5
)[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()

voidStifMacroErrorInit()[virtual]

STIF TF's macro. Initialized TTestMacro.

TestCases()

const RPointerArray< TTestCaseInfo > *TestCases()const

Returns pointer to test cases

TestComplete(TInt)

voidTestComplete(TIntaCompletionCode)[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 TBoolUITesting()

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]