author | Maciej Seroka <maciejs@symbian.org> |
Wed, 28 Jul 2010 13:24:28 +0100 | |
branch | Symbian3 |
changeset 54 | a4835904093b |
permissions | -rw-r--r-- |
54
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
1 |
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
2 |
// All rights reserved. |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
3 |
// This component and the accompanying materials are made available |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
4 |
// under the terms of "Eclipse Public License v1.0" |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
5 |
// which accompanies this distribution, and is available |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
7 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
8 |
// Initial Contributors: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
9 |
// Nokia Corporation - initial contribution. |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
10 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
11 |
// Contributors: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
12 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
13 |
// Description: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
14 |
// Example CTestStep derived implementation |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
15 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
16 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
17 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
18 |
/** |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
19 |
@file NoMemoryStep.cpp |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
20 |
@internalTechnology |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
21 |
*/ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
22 |
#include "nomemorystep.h" |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
23 |
#include "te_lbsapisuitedefs.h" |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
24 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
25 |
#include "lcfsbucommondefinitions.h" |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
26 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
27 |
#include <lbs.h> |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
28 |
#include <lbssatellite.h> |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
29 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
30 |
#include <s32mem.h> |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
31 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
32 |
CNoMemoryStep::~CNoMemoryStep() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
33 |
/** |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
34 |
* Destructor |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
35 |
*/ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
36 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
37 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
38 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
39 |
CNoMemoryStep::CNoMemoryStep() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
40 |
/** |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
41 |
* Constructor |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
42 |
*/ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
43 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
44 |
// **MUST** call SetTestStepName in the constructor as the controlling |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
45 |
// framework uses the test step name immediately following construction to set |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
46 |
// up the step's unique logging ID. |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
47 |
SetTestStepName(KNoMemoryStep); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
48 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
49 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
50 |
TVerdict CNoMemoryStep::doTestStepPreambleL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
51 |
/** |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
52 |
* @return - TVerdict code |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
53 |
* Override of base class virtual |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
54 |
*/ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
55 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
56 |
CTe_LbsApiSuiteStepBase::doTestStepPreambleL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
57 |
if (TestStepResult()!=EPass) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
58 |
return TestStepResult(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
59 |
// process some pre setting to this test step then set SetTestStepResult to EFail or Epass. |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
60 |
SetTestStepResult(EPass); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
61 |
return TestStepResult(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
62 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
63 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
64 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
65 |
TVerdict CNoMemoryStep::doTestStepL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
66 |
/** |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
67 |
* @return - TVerdict code |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
68 |
* Override of base class pure virtual |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
69 |
* Our implementation only gets called if the base class doTestStepPreambleL() did |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
70 |
* not leave. That being the case, the current test result value will be EPass. |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
71 |
*/ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
72 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
73 |
if (TestStepResult()==EPass) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
74 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
75 |
TInt test; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
76 |
if(!GetIntFromConfig(ConfigSection(),KTe_LbsApiSuiteInt,test)) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
77 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
78 |
// Leave if there's any error. |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
79 |
User::Leave(KErrNotFound); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
80 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
81 |
SetTestStepResult(EPass); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
82 |
StartL(test); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
83 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
84 |
return TestStepResult(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
85 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
86 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
87 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
88 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
89 |
TVerdict CNoMemoryStep::doTestStepPostambleL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
90 |
/** |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
91 |
* @return - TVerdict code |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
92 |
* Override of base class virtual |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
93 |
*/ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
94 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
95 |
// process something post setting to the test step |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
96 |
// uncomment the following line if you have common post setting to all the test steps in there |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
97 |
// CTe_LbsApiSuiteStepBase::doTestStepPostambleL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
98 |
// uncomment the following line if you have post process or remove the following line if no post process |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
99 |
// SetTestStepResult(EPass); // or EFail |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
100 |
return TestStepResult(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
101 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
102 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
103 |
void CNoMemoryStep::StartL (TInt aIndex) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
104 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
105 |
switch (aIndex) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
106 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
107 |
case 0: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
108 |
OOM_RPositionServer_Open_NoMemoryL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
109 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
110 |
case 1: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
111 |
OOM_RPositioner_OpenL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
112 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
113 |
case 2: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
114 |
OOM_RPositioner_SetRequestorL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
115 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
116 |
case 3: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
117 |
OOM_CRequestor_ConstructionL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
118 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
119 |
case 4: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
120 |
OOM_CRequestor_SetRequestorL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
121 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
122 |
case 5: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
123 |
OOM_CRequestor_StreamingL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
124 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
125 |
case 6: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
126 |
OOM_RRequestorStack_StreamingL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
127 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
128 |
case 7: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
129 |
OOM_HPositionGenericInfo_ConstructionL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
130 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
131 |
default: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
132 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
133 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
134 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
135 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
136 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
137 |
#define DO_OOM_CUSTOMISED_LOOP(aType, aCreationCode, aDeletionCode, aLoopStartCode, aLoopEndCode) \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
138 |
{ \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
139 |
aType; \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
140 |
TInt failureRate; \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
141 |
TBool doContinue = ETrue; \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
142 |
for (failureRate = 1; doContinue; failureRate++) \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
143 |
{ \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
144 |
aLoopStartCode; \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
145 |
__UHEAP_SETFAIL(RHeap::EFailNext, failureRate); \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
146 |
__UHEAP_MARK; \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
147 |
\ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
148 |
TInt err; \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
149 |
TRAP(err, aCreationCode); \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
150 |
if (err != KErrNoMemory) \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
151 |
{ \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
152 |
aDeletionCode; \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
153 |
doContinue = EFalse; \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
154 |
} \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
155 |
\ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
156 |
__UHEAP_MARKEND; \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
157 |
__UHEAP_RESET; \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
158 |
aLoopEndCode; \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
159 |
} \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
160 |
CHECK( failureRate > 2 ); \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
161 |
message.Format(_L("Checked %d allocations in \"%s\""), failureRate-2, L## #aCreationCode); \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
162 |
LOG_DES(message); \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
163 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
164 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
165 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
166 |
#define DO_OOM(aType, aCreationCode, aDeletionCode) \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
167 |
DO_OOM_CUSTOMISED_LOOP(aType, aCreationCode, aDeletionCode, (void) 0, (void) 0) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
168 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
169 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
170 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
171 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
172 |
// RPositionServer |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
173 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
174 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
175 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
176 |
//1.1.6 Connect with No Memory |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
177 |
void CNoMemoryStep::OOM_RPositionServer_Open_NoMemoryL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
178 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
179 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
180 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
181 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
182 |
RPositionServer server; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
183 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
184 |
// connect |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
185 |
__UHEAP_SETFAIL(RHeap::EFailNext, 1); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
186 |
__UHEAP_MARK; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
187 |
CHECK_EQUAL_(KErrNoMemory, server.Connect()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
188 |
__UHEAP_MARKEND; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
189 |
__UHEAP_RESET; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
190 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
191 |
StandardCleanup(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
192 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
193 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
194 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
195 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
196 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
197 |
// RPositioner |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
198 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
199 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
200 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
201 |
//1.10.7 Open with No Memory |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
202 |
void CNoMemoryStep::OOM_RPositioner_OpenL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
203 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
204 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
205 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
206 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
207 |
RPositionServer server; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
208 |
User::LeaveIfError(server.Connect()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
209 |
CleanupClosePushL(server); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
210 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
211 |
RPositioner positioner; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
212 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
213 |
// open by default |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
214 |
__UHEAP_SETFAIL(RHeap::EFailNext, 1); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
215 |
__UHEAP_MARK; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
216 |
CHECK_EQUAL_(KErrNoMemory, positioner.Open(server)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
217 |
__UHEAP_MARKEND; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
218 |
__UHEAP_RESET; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
219 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
220 |
// by module id |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
221 |
TPositionModuleId moduleId; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
222 |
server.GetDefaultModuleId(moduleId); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
223 |
__UHEAP_SETFAIL(RHeap::EFailNext, 1); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
224 |
__UHEAP_MARK; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
225 |
CHECK_EQUAL_(KErrNoMemory, positioner.Open(server, moduleId)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
226 |
__UHEAP_MARKEND; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
227 |
__UHEAP_RESET; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
228 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
229 |
// by criteria |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
230 |
TPositionCriteria criteria; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
231 |
criteria.ResetCriteria(); // defaults |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
232 |
__UHEAP_SETFAIL(RHeap::EFailNext, 1); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
233 |
__UHEAP_MARK; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
234 |
CHECK_EQUAL_(KErrNoMemory, positioner.Open(server, criteria)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
235 |
__UHEAP_MARKEND; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
236 |
__UHEAP_RESET; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
237 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
238 |
CleanupStack::PopAndDestroy(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
239 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
240 |
StandardCleanup(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
241 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
242 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
243 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
244 |
//1.13.5 SetRequestor Stack with No Memory |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
245 |
void CNoMemoryStep::OOM_RPositioner_SetRequestorL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
246 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
247 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
248 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
249 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
250 |
RPositionServer server; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
251 |
User::LeaveIfError(server.Connect()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
252 |
CleanupClosePushL(server); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
253 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
254 |
RPositioner positioner; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
255 |
CHECK_EQUAL_(KErrNone, positioner.Open(server)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
256 |
CleanupClosePushL(positioner); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
257 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
258 |
RRequestorStack stack; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
259 |
CRequestor* requestor = NULL; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
260 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
261 |
// All Accepted |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
262 |
requestor = CRequestor::NewLC( |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
263 |
CRequestor::ERequestorContact, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
264 |
DUMMY_REQUESTOR_FORMAT_ACCEPTED2, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
265 |
DUMMY_REQUESTOR_NAME_ACCEPTED2); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
266 |
stack.Append(requestor); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
267 |
requestor = CRequestor::NewLC( |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
268 |
CRequestor::ERequestorService, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
269 |
DUMMY_REQUESTOR_FORMAT_ACCEPTED1, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
270 |
DUMMY_REQUESTOR_NAME_ACCEPTED1); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
271 |
stack.Append(requestor); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
272 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
273 |
// set requestor stack |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
274 |
__UHEAP_SETFAIL(RHeap::EFailNext, 1); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
275 |
__UHEAP_MARK; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
276 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
277 |
CHECK_EQUAL_(KErrNoMemory, positioner.SetRequestor(stack)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
278 |
CHECK_EQUAL_(KErrNone, positioner.SetRequestor(stack)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
279 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
280 |
__UHEAP_MARKEND; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
281 |
__UHEAP_RESET; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
282 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
283 |
CleanupStack::Pop(2); // requestors |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
284 |
CleanupStack::PopAndDestroy(2); // server & positioner |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
285 |
stack.ResetAndDestroy(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
286 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
287 |
StandardCleanup(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
288 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
289 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
290 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
291 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
292 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
293 |
// CRequestor |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
294 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
295 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
296 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
297 |
// 8.2.4. Constructors with No Memory |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
298 |
void CNoMemoryStep::OOM_CRequestor_ConstructionL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
299 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
300 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
301 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
302 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
303 |
_LIT(KRequestorData, "+441223719800"); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
304 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
305 |
// New |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
306 |
CRequestor* requestor = NULL; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
307 |
TBool doContinue = ETrue; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
308 |
TInt failureRate = 0; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
309 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
310 |
for (failureRate = 1; doContinue; failureRate++) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
311 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
312 |
__UHEAP_SETFAIL(RHeap::EFailNext, failureRate); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
313 |
__UHEAP_MARK; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
314 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
315 |
TInt err; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
316 |
TRAP(err, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
317 |
User::LeaveIfNull(requestor = |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
318 |
CRequestor::New(CRequestor::ERequestorContact, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
319 |
CRequestor::EFormatTelephone, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
320 |
KRequestorData)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
321 |
); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
322 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
323 |
if (err != KErrNoMemory) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
324 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
325 |
delete requestor; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
326 |
doContinue = EFalse; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
327 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
328 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
329 |
__UHEAP_MARKEND; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
330 |
__UHEAP_RESET; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
331 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
332 |
CHECK( failureRate > 2 ); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
333 |
message.Format(_L("Checked %d allocations in \"New\""), failureRate-2); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
334 |
LOG_DES(message); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
335 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
336 |
// NewL |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
337 |
doContinue = ETrue; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
338 |
for (failureRate = 1; doContinue; failureRate++) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
339 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
340 |
__UHEAP_SETFAIL(RHeap::EFailNext, failureRate); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
341 |
__UHEAP_MARK; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
342 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
343 |
TInt err; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
344 |
TRAP(err, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
345 |
requestor = CRequestor::NewL(CRequestor::ERequestorContact, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
346 |
CRequestor::EFormatTelephone, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
347 |
KRequestorData); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
348 |
); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
349 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
350 |
if (err != KErrNoMemory) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
351 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
352 |
delete requestor; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
353 |
doContinue = EFalse; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
354 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
355 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
356 |
__UHEAP_MARKEND; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
357 |
__UHEAP_RESET; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
358 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
359 |
CHECK( failureRate > 2 ); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
360 |
message.Format(_L("Checked %d allocations in \"NewL\""), failureRate-2); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
361 |
LOG_DES(message); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
362 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
363 |
// NewLC |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
364 |
doContinue = ETrue; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
365 |
for (failureRate = 1; doContinue; failureRate++) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
366 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
367 |
__UHEAP_SETFAIL(RHeap::EFailNext, failureRate); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
368 |
__UHEAP_MARK; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
369 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
370 |
TInt err; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
371 |
TRAP(err, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
372 |
requestor = CRequestor::NewLC(CRequestor::ERequestorContact, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
373 |
CRequestor::EFormatTelephone, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
374 |
KRequestorData); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
375 |
CleanupStack::Pop(requestor); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
376 |
); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
377 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
378 |
if (err != KErrNoMemory) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
379 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
380 |
delete requestor; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
381 |
doContinue = EFalse; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
382 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
383 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
384 |
__UHEAP_MARKEND; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
385 |
__UHEAP_RESET; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
386 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
387 |
CHECK( failureRate > 2 ); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
388 |
message.Format(_L("Checked %d allocations in \"NewLC\""), failureRate-2); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
389 |
LOG_DES(message); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
390 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
391 |
StandardCleanup(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
392 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
393 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
394 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
395 |
// 8.2.5. SetRequestor with No Memory |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
396 |
void CNoMemoryStep::OOM_CRequestor_SetRequestorL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
397 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
398 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
399 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
400 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
401 |
_LIT(KRequestorData, "+441223719800"); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
402 |
_LIT(KRequestorData2, "+44122371980101"); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
403 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
404 |
// NOTE, this is a special case where the CRequestor is created at the start, then |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
405 |
// its member data is replaced (which is tested under OOM conditions). |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
406 |
DO_OOM( |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
407 |
CRequestor* requestor = CRequestor::NewLC(CRequestor::ERequestorContact, CRequestor::EFormatTelephone, KRequestorData), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
408 |
requestor->SetRequestorL(CRequestor::ERequestorContact, CRequestor::EFormatTelephone, KRequestorData2), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
409 |
CleanupStack::PopAndDestroy(requestor) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
410 |
); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
411 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
412 |
StandardCleanup(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
413 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
414 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
415 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
416 |
// 8.3.3. Streaming with NoMemory |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
417 |
void CNoMemoryStep::OOM_CRequestor_StreamingL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
418 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
419 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
420 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
421 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
422 |
_LIT(KRequestorData, "+441223719800"); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
423 |
CRequestor* requestor = NULL; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
424 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
425 |
requestor = CRequestor::NewLC(CRequestor::ERequestorContact, CRequestor::EFormatTelephone, KRequestorData); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
426 |
TBuf8<100> buffer; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
427 |
RDesWriteStream writeStrm(buffer); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
428 |
CleanupClosePushL(writeStrm); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
429 |
TInt err; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
430 |
TRAP(err, writeStrm << *requestor); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
431 |
CleanupStack::PopAndDestroy(&writeStrm); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
432 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
433 |
// Internalize |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
434 |
DO_OOM_CUSTOMISED_LOOP |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
435 |
( |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
436 |
(void) 0, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
437 |
strm >> *requestor, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
438 |
delete requestor, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
439 |
RDesReadStream strm(buffer); CleanupClosePushL(strm), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
440 |
CleanupStack::PopAndDestroy(&strm) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
441 |
); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
442 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
443 |
CleanupStack::Pop(requestor); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
444 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
445 |
// Construction |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
446 |
DO_OOM_CUSTOMISED_LOOP |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
447 |
( |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
448 |
(void) 0, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
449 |
requestor = CRequestor::NewL(strm), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
450 |
delete requestor, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
451 |
RDesReadStream strm(buffer); CleanupClosePushL(strm), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
452 |
CleanupStack::PopAndDestroy(&strm) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
453 |
); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
454 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
455 |
StandardCleanup(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
456 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
457 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
458 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
459 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
460 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
461 |
// RRequestorStack |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
462 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
463 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
464 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
465 |
void CleanupResetAndDestroy(TAny* aArray) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
466 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
467 |
reinterpret_cast<RRequestorStack*>(aArray)->ResetAndDestroy(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
468 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
469 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
470 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
471 |
// 8.1.3. Streaming with No Memory |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
472 |
void CNoMemoryStep::OOM_RRequestorStack_StreamingL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
473 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
474 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
475 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
476 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
477 |
_LIT(KRequestorData, "+441223719800"); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
478 |
const TInt KNumberOfRequestors = 3; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
479 |
RRequestorStack stack; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
480 |
CleanupStack::PushL(TCleanupItem(CleanupResetAndDestroy, &stack)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
481 |
TInt i; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
482 |
for (i = 0; i < KNumberOfRequestors; i++) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
483 |
User::LeaveIfError(stack.Append(NULL)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
484 |
for (i = 0; i < KNumberOfRequestors; i++) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
485 |
stack[i] = CRequestor::NewL(CRequestor::ERequestorContact, CRequestor::EFormatTelephone, KRequestorData); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
486 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
487 |
TBuf8<100> buffer; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
488 |
RDesWriteStream writeStrm(buffer); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
489 |
CleanupClosePushL(writeStrm); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
490 |
TInt err; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
491 |
TRAP(err, writeStrm << stack); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
492 |
CleanupStack::PopAndDestroy(&writeStrm); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
493 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
494 |
CleanupStack::PopAndDestroy(&stack); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
495 |
CleanupStack::PushL(TCleanupItem(CleanupResetAndDestroy, &stack)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
496 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
497 |
DO_OOM_CUSTOMISED_LOOP |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
498 |
( |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
499 |
(void) 0, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
500 |
strm >> stack, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
501 |
stack.ResetAndDestroy(), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
502 |
RDesReadStream strm(buffer); CleanupClosePushL(strm), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
503 |
CleanupStack::PopAndDestroy(&strm) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
504 |
); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
505 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
506 |
CleanupStack::Pop(&stack); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
507 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
508 |
StandardCleanup(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
509 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
510 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
511 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
512 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
513 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
514 |
// HPositionGenericInfo |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
515 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
516 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
517 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
518 |
// 3.2.2. NoMemory Construction |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
519 |
void CNoMemoryStep::OOM_HPositionGenericInfo_ConstructionL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
520 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
521 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
522 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
523 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
524 |
// New |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
525 |
DO_OOM |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
526 |
( |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
527 |
HPositionGenericInfo* genInfo = NULL, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
528 |
User::LeaveIfNull(genInfo = HPositionGenericInfo::New(10)), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
529 |
delete genInfo |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
530 |
); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
531 |
// NewL |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
532 |
DO_OOM |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
533 |
( |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
534 |
HPositionGenericInfo* genInfo = NULL, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
535 |
genInfo = HPositionGenericInfo::NewL(10), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
536 |
delete genInfo |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
537 |
); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
538 |
// NewLC |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
539 |
DO_OOM |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
540 |
( |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
541 |
HPositionGenericInfo* genInfo = NULL, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
542 |
genInfo = HPositionGenericInfo::NewLC(10); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
543 |
CleanupStack::Pop(genInfo), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
544 |
delete genInfo |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
545 |
); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
546 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
547 |
StandardCleanup(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
548 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
549 |