CTestModuleBase Class Reference

class CTestModuleBase : public CBase

Inherits from

Constructor & Destructor Documentation

CTestModuleBase()

CTestModuleBase()[inline]

C++ default constructor.

~CTestModuleBase()

~CTestModuleBase()[inline, virtual]

Destructor.

Member Functions Documentation

GetTestCasesL(const TFileName &, RPointerArray< TTestCaseInfo > &)

TInt GetTestCasesL(const TFileName &aTestCaseFile,
RPointerArray< TTestCaseInfo > &aTestCases
)[pure virtual]

Test cases are inquired from the Test Module by calling GetTestCasesL. Test cases may be read from the testcase file specified by aTestCaseFile or they can be e.g. hardcoded to testmodule. If the Test Module does not use testcase files for test case definition it does not use aTestCaseFile parameter. Test cases are appended to RPointerArray<TTestCaseInfo> that is a list consisting of several TTestCaseInfo objects. The STIF Test Framework will be the owner of the objects stored to RPointerArray after the GetTestCasesL has appended them to the list and it does the memory deallocation. This method is pure virtual and the Test Module must implement it.

Parameters

const TFileName & aTestCaseFile
RPointerArray< TTestCaseInfo > & aTestCases

InitL(TFileName &, TBool)

TInt InitL(TFileName &,
TBool
)[inline, virtual]

InitL is used to initialize the Test Module. The Test Modules may use the initialization file to read parameters for Test Module initialization but they can also have their own configure file or some other routine to initialize themselves. This method is virtual and it is not mandatory to implement it to Test Module.

Parameters

TFileName &
TBool

OOMHandleWarningL(const TFileName &, const, TInt &)

voidOOMHandleWarningL(const TFileName &,
const TInt,
TInt &
)[inline, virtual]

Used in OOM testing only. Provides a way to the derived TestModule to handle warnings related to non-leaving or TRAPped allocations.

In some cases the allocation should be skipped, either due to problems in the OS code or components used by the code being tested, or even inside the tested components which are implemented this way on purpose (by design), so it is important to give the tester a way to bypass allocation failures.

This method is virtual and will be implemented if test case is to be executed using OOM conditions.

Parameters

const TFileName &
const TInt
TInt &

OOMTestFinalizeL(const TFileName &, const)

voidOOMTestFinalizeL(const TFileName &,
const TInt
)[inline, virtual]

Used to perform the test environment cleanup for a particular OOM test case.

This method is virtual and will be implemented if test case is to be executed using OOM conditions.

Parameters

const TFileName &
const TInt

OOMTestInitializeL(const TFileName &, const)

voidOOMTestInitializeL(const TFileName &,
const TInt
)[inline, virtual]

Used to perform the test environment setup for a particular OOM test case. The Test Modules may use the initialization file to read parameters for Test Module initialization but they can also have their own configure file or some other routine to initialize themselves.

This method is virtual and will be implemented if test case is to be executed using OOM conditions.

Parameters

const TFileName &
const TInt

OOMTestQueryL(const TFileName &, const, TOOMFailureType &, TInt &, TInt &)

TBool OOMTestQueryL(const TFileName &,
const TInt,
TOOMFailureType &aFailureType,
TInt &,
TInt &
)[inline, virtual]

Used to check if a particular Test Case should be run in OOM conditions and which memory allocations should fail. Method returns ETrue if test is should run in OOM conditions, EFalse otherwise.

This method is virtual and will be implemented if test case is to be executed using OOM conditions.

Parameters

const TFileName &
const TInt
TOOMFailureType & aFailureType
TInt &
TInt &

RunTestCaseL(const TInt, const TFileName &, TTestResult &)

TInt RunTestCaseL(const TIntaCaseNumber,
const TFileName &aTestCaseFile,
TTestResult &aResult
)[pure virtual]

RunTestCaseL is used to run an individual test case specified by aCaseNumber and aTestCaseFile (optional). This method is synchronous and test case result is returned as reference parameter aResult value. The function shall return KErrNone if case is started succesfully. If test case is not available (i.e invalid testcase file or or case number), then function shall return KErrNotFound. In other error situations another Symbian error code is returned. This method is pure virtual and the Test Module must implement it.

Parameters

const TInt aCaseNumber
const TFileName & aTestCaseFile
TTestResult & aResult

TestModuleIf()

CTestModuleIf &TestModuleIf()[inline]

TestModuleIf returns the handle to the CTestModuleIf interface. This is an utility function that can be used if the upper layer interface is needed to be used. This method must not be called from the constructor of Test Module that derives the CTestModuleBase.

Version()

TVersion Version()[inline, virtual]

Returns the API version which this test module complies. Test Framework uses this function to verify that loaded module can be used in current framework release.

Note that this function must always be the very first function that is defined in CTestModuleBase.

Member Enumerations Documentation

Enum TOOMFailureType

Enumerators

EFailNext

Member Data Documentation

CTestModuleIf * iTestModuleIf

CTestModuleIf *iTestModuleIf[private]