77
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: This file contains STIFUnit module implementation.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
/******************************************************************************/
|
|
19 |
/*
|
|
20 |
*
|
|
21 |
* Test module configuration
|
|
22 |
*/
|
|
23 |
|
|
24 |
// Version
|
|
25 |
#define TEST_MODULE_VERSION_MAJOR 0
|
|
26 |
#define TEST_MODULE_VERSION_MINOR 0
|
|
27 |
#define TEST_MODULE_VERSION_BUILD 0
|
|
28 |
|
|
29 |
// Uncomment following defines, if you want to provide implementation
|
|
30 |
// of enlisted virtual methods of test module.
|
|
31 |
// Implementation part is located at the end of this file.
|
|
32 |
//#define STIFUNIT_OOMTESTQUERYL
|
|
33 |
//#define STIFUNIT_OOMTESTINITIALIZEL
|
|
34 |
//#define STIFUNIT_OOMHANDLEWARNINGL
|
|
35 |
//#define STIFUNIT_OOMTESTFINALIZEL
|
|
36 |
// Uncomment following define, if you want to increase heap or stack size.
|
|
37 |
// #define STIFUNIT_SETHEAPANDSTACKSIZE
|
|
38 |
/******************************************************************************/
|
|
39 |
|
|
40 |
|
|
41 |
/*
|
|
42 |
* Test module internals. Please do not edit them.
|
|
43 |
*/
|
|
44 |
|
|
45 |
// Includes
|
|
46 |
#include <e32base.h>
|
|
47 |
|
|
48 |
// Literals
|
|
49 |
_LIT( KUnitLogPath, "\\logs\\testframework\\ut_oomwatcher\\" );
|
|
50 |
_LIT( KUnitLogFile, "ut_oomwatcher.txt" );
|
|
51 |
_LIT( KLogStart, "ut_oomwatcher logging starts!" );
|
|
52 |
|
|
53 |
// Defines
|
|
54 |
#define STIF_UNIT_TEST_CASES "../src/ut_oomwatchercases.cpp"
|
|
55 |
#define STIF_UNIT_MODULE_CLASS_NAME Cut_oomwatcher
|
|
56 |
#define STIF_UNIT_MODULE_NAME _L("ut_oomwatcher.dll")
|
|
57 |
|
|
58 |
// Include STIF unit generic file
|
|
59 |
#include <StifUnitGeneric.h>
|
|
60 |
|
|
61 |
/*
|
|
62 |
* Implementation of setHeapAndStack virtual methods.
|
|
63 |
* To changes heap and stack size provide new values to iTestThreadStackSize, iTestThreadMinHeap and iTestThreadMaxHeap.
|
|
64 |
*/
|
|
65 |
|
|
66 |
#ifdef STIFUNIT_SETHEAPANDSTACKSIZE
|
|
67 |
EXPORT_C TInt SetRequirements( CTestModuleParam*& aTestModuleParam,
|
|
68 |
TUint32& aParameterValid )
|
|
69 |
{
|
|
70 |
aParameterValid = KStifTestModuleParameterChanged;
|
|
71 |
CTestModuleParamVer01* param;
|
|
72 |
TRAPD(err, param = CTestModuleParamVer01::NewL());
|
|
73 |
// Stack size
|
|
74 |
param->iTestThreadStackSize= 16384; // 16K stack
|
|
75 |
// Heap sizes
|
|
76 |
param->iTestThreadMinHeap = 4096; // 4K heap min
|
|
77 |
param->iTestThreadMaxHeap = 1048576;// 1M heap max
|
|
78 |
|
|
79 |
return KErrNone;
|
|
80 |
}
|
|
81 |
#undef STIFUNIT_SETHEAPANDSTACKSIZE
|
|
82 |
#endif
|
|
83 |
|
|
84 |
/*
|
|
85 |
* User implementation of OOM virtual methods.
|
|
86 |
* Providing own implementation requires uncommenting defines at the
|
|
87 |
* beginnig of this file.
|
|
88 |
*/
|
|
89 |
#ifdef STIFUNIT_OOMTESTQUERYL
|
|
90 |
TBool Cut_oomwatcher::OOMTestQueryL( const TFileName& /*aTestCaseFile*/,
|
|
91 |
const TInt aCaseNumber,
|
|
92 |
TOOMFailureType& aFailureType,
|
|
93 |
TInt& aFirstMemFailure,
|
|
94 |
TInt& aLastMemFailure)
|
|
95 |
{
|
|
96 |
}
|
|
97 |
#undef STIFUNIT_OOMTESTQUERYL
|
|
98 |
#endif
|
|
99 |
|
|
100 |
#ifdef STIFUNIT_OOMTESTINITIALIZEL
|
|
101 |
void Cut_oomwatcher::OOMTestInitializeL( const TFileName& /*aTestCaseFile*/,
|
|
102 |
const TInt /*aCaseNumber*/ )
|
|
103 |
{
|
|
104 |
}
|
|
105 |
#undef STIFUNIT_OOMTESTINITIALIZEL
|
|
106 |
#endif
|
|
107 |
|
|
108 |
#ifdef STIFUNIT_OOMHANDLEWARNINGL
|
|
109 |
void Cut_oomwatcher::OOMHandleWarningL( const TFileName& /*aTestCaseFile*/,
|
|
110 |
const TInt /*aCaseNumber*/,
|
|
111 |
TInt& /*aFailNextValue*/)
|
|
112 |
{
|
|
113 |
}
|
|
114 |
#undef STIFUNIT_OOMHANDLEWARNINGL
|
|
115 |
#endif
|
|
116 |
|
|
117 |
#ifdef STIFUNIT_OOMTESTFINALIZEL
|
|
118 |
void Cut_oomwatcher::OOMTestFinalizeL( const TFileName& /*aTestCaseFile*/,
|
|
119 |
const TInt /*aCaseNumber*/ )
|
|
120 |
{
|
|
121 |
}
|
|
122 |
#undef STIFUNIT_OOMTESTFINALIZEL
|
|
123 |
#endif
|
|
124 |
|
|
125 |
// End of File
|