diff -r 1505405bc645 -r b01c07dfcf84 sysresmonitoring/oommonitor/tsrc/ut_oom_closeapp/src/ut_oom_closeapp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysresmonitoring/oommonitor/tsrc/ut_oom_closeapp/src/ut_oom_closeapp.cpp Thu Oct 07 06:25:45 2010 +0300 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains STIFUnit module implementation. +* +*/ + +/******************************************************************************/ +/* + * + * Test module configuration +*/ + +// Version +#define TEST_MODULE_VERSION_MAJOR 0 +#define TEST_MODULE_VERSION_MINOR 0 +#define TEST_MODULE_VERSION_BUILD 0 + +// Uncomment following defines, if you want to provide implementation +// of enlisted virtual methods of test module. +// Implementation part is located at the end of this file. +//#define STIFUNIT_OOMTESTQUERYL +//#define STIFUNIT_OOMTESTINITIALIZEL +//#define STIFUNIT_OOMHANDLEWARNINGL +//#define STIFUNIT_OOMTESTFINALIZEL +// Uncomment following define, if you want to increase heap or stack size. +// #define STIFUNIT_SETHEAPANDSTACKSIZE +/******************************************************************************/ + + +/* + * Test module internals. Please do not edit them. +*/ + +// Includes +#include + +// Literals +_LIT( KUnitLogPath, "\\logs\\testframework\\ut_oom_closeapp\\" ); +_LIT( KUnitLogFile, "ut_oom_closeapp.txt" ); +_LIT( KLogStart, "ut_oom_closeapp logging starts!" ); +_LIT( KExeName, "appfortest.exe" ); +_LIT( KArguments, "" ); +_LIT(KDummyWgName, "20"); + +// Defines +#define STIF_UNIT_TEST_CASES "../src/ut_oom_closeappCases.cpp" +#define STIF_UNIT_MODULE_CLASS_NAME Cut_oom_closeapp +#define STIF_UNIT_MODULE_NAME _L("ut_oom_closeapp.dll") + +// Include STIF unit generic file +#include + +/* + * Implementation of setHeapAndStack virtual methods. + * To changes heap and stack size provide new values to iTestThreadStackSize, iTestThreadMinHeap and iTestThreadMaxHeap. +*/ + +#ifdef STIFUNIT_SETHEAPANDSTACKSIZE +EXPORT_C TInt SetRequirements( CTestModuleParam*& aTestModuleParam, + TUint32& aParameterValid ) + { + aParameterValid = KStifTestModuleParameterChanged; + TRAPD(err, CTestModuleParamVer01* param = CTestModuleParamVer01::NewL()); + if(KErrNone==err) + { + // Stack size + param->iTestThreadStackSize= 16384; // 16K stack + // Heap sizes + param->iTestThreadMinHeap = 4096; // 4K heap min + param->iTestThreadMaxHeap = 1048576;// 1M heap max + } + + return err; + } +#undef STIFUNIT_SETHEAPANDSTACKSIZE +#endif + +/* + * User implementation of OOM virtual methods. + * Providing own implementation requires uncommenting defines at the + * beginnig of this file. +*/ +#ifdef STIFUNIT_OOMTESTQUERYL +TBool Cut_oom_closeapp::OOMTestQueryL( const TFileName& /*aTestCaseFile*/, + const TInt aCaseNumber, + TOOMFailureType& aFailureType, + TInt& aFirstMemFailure, + TInt& aLastMemFailure) + { + } +#undef STIFUNIT_OOMTESTQUERYL +#endif + +#ifdef STIFUNIT_OOMTESTINITIALIZEL +void Cut_oom_closeapp::OOMTestInitializeL( const TFileName& /*aTestCaseFile*/, + const TInt /*aCaseNumber*/ ) + { + } +#undef STIFUNIT_OOMTESTINITIALIZEL +#endif + +#ifdef STIFUNIT_OOMHANDLEWARNINGL +void Cut_oom_closeapp::OOMHandleWarningL( const TFileName& /*aTestCaseFile*/, + const TInt /*aCaseNumber*/, + TInt& /*aFailNextValue*/) + { + } +#undef STIFUNIT_OOMHANDLEWARNINGL +#endif + +#ifdef STIFUNIT_OOMTESTFINALIZEL +void Cut_oom_closeapp::OOMTestFinalizeL( const TFileName& /*aTestCaseFile*/, + const TInt /*aCaseNumber*/ ) + { + } +#undef STIFUNIT_OOMTESTFINALIZEL +#endif + +// End of File