|
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_oom_closeapp\\" ); |
|
50 _LIT( KUnitLogFile, "ut_oom_closeapp.txt" ); |
|
51 _LIT( KLogStart, "ut_oom_closeapp logging starts!" ); |
|
52 _LIT( KExeName, "appfortest.exe" ); |
|
53 _LIT( KArguments, "" ); |
|
54 _LIT(KDummyWgName, "20"); |
|
55 |
|
56 // Defines |
|
57 #define STIF_UNIT_TEST_CASES "../src/ut_oom_closeappCases.cpp" |
|
58 #define STIF_UNIT_MODULE_CLASS_NAME Cut_oom_closeapp |
|
59 #define STIF_UNIT_MODULE_NAME _L("ut_oom_closeapp.dll") |
|
60 |
|
61 // Include STIF unit generic file |
|
62 #include <StifUnitGeneric.h> |
|
63 |
|
64 /* |
|
65 * Implementation of setHeapAndStack virtual methods. |
|
66 * To changes heap and stack size provide new values to iTestThreadStackSize, iTestThreadMinHeap and iTestThreadMaxHeap. |
|
67 */ |
|
68 |
|
69 #ifdef STIFUNIT_SETHEAPANDSTACKSIZE |
|
70 EXPORT_C TInt SetRequirements( CTestModuleParam*& aTestModuleParam, |
|
71 TUint32& aParameterValid ) |
|
72 { |
|
73 aParameterValid = KStifTestModuleParameterChanged; |
|
74 TRAPD(err, CTestModuleParamVer01* param = CTestModuleParamVer01::NewL()); |
|
75 if(KErrNone==err) |
|
76 { |
|
77 // Stack size |
|
78 param->iTestThreadStackSize= 16384; // 16K stack |
|
79 // Heap sizes |
|
80 param->iTestThreadMinHeap = 4096; // 4K heap min |
|
81 param->iTestThreadMaxHeap = 1048576;// 1M heap max |
|
82 } |
|
83 |
|
84 return err; |
|
85 } |
|
86 #undef STIFUNIT_SETHEAPANDSTACKSIZE |
|
87 #endif |
|
88 |
|
89 /* |
|
90 * User implementation of OOM virtual methods. |
|
91 * Providing own implementation requires uncommenting defines at the |
|
92 * beginnig of this file. |
|
93 */ |
|
94 #ifdef STIFUNIT_OOMTESTQUERYL |
|
95 TBool Cut_oom_closeapp::OOMTestQueryL( const TFileName& /*aTestCaseFile*/, |
|
96 const TInt aCaseNumber, |
|
97 TOOMFailureType& aFailureType, |
|
98 TInt& aFirstMemFailure, |
|
99 TInt& aLastMemFailure) |
|
100 { |
|
101 } |
|
102 #undef STIFUNIT_OOMTESTQUERYL |
|
103 #endif |
|
104 |
|
105 #ifdef STIFUNIT_OOMTESTINITIALIZEL |
|
106 void Cut_oom_closeapp::OOMTestInitializeL( const TFileName& /*aTestCaseFile*/, |
|
107 const TInt /*aCaseNumber*/ ) |
|
108 { |
|
109 } |
|
110 #undef STIFUNIT_OOMTESTINITIALIZEL |
|
111 #endif |
|
112 |
|
113 #ifdef STIFUNIT_OOMHANDLEWARNINGL |
|
114 void Cut_oom_closeapp::OOMHandleWarningL( const TFileName& /*aTestCaseFile*/, |
|
115 const TInt /*aCaseNumber*/, |
|
116 TInt& /*aFailNextValue*/) |
|
117 { |
|
118 } |
|
119 #undef STIFUNIT_OOMHANDLEWARNINGL |
|
120 #endif |
|
121 |
|
122 #ifdef STIFUNIT_OOMTESTFINALIZEL |
|
123 void Cut_oom_closeapp::OOMTestFinalizeL( const TFileName& /*aTestCaseFile*/, |
|
124 const TInt /*aCaseNumber*/ ) |
|
125 { |
|
126 } |
|
127 #undef STIFUNIT_OOMTESTFINALIZEL |
|
128 #endif |
|
129 |
|
130 // End of File |