sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
/**
|
sl@0
|
20 |
@file
|
sl@0
|
21 |
*/
|
sl@0
|
22 |
|
sl@0
|
23 |
#include "t_certapps_actions.h"
|
sl@0
|
24 |
#include "t_certapps_defs.h"
|
sl@0
|
25 |
#include "t_input.h"
|
sl@0
|
26 |
#include "t_output.h"
|
sl@0
|
27 |
|
sl@0
|
28 |
#include "certificateapps.h"
|
sl@0
|
29 |
|
sl@0
|
30 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
31 |
//CCertAppTestAction base class
|
sl@0
|
32 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
33 |
|
sl@0
|
34 |
// singleton instance of the manager
|
sl@0
|
35 |
CCertificateAppInfoManager* CCertAppTestAction::iAppManager = NULL;
|
sl@0
|
36 |
|
sl@0
|
37 |
CCertAppTestAction::~CCertAppTestAction()
|
sl@0
|
38 |
{
|
sl@0
|
39 |
}
|
sl@0
|
40 |
|
sl@0
|
41 |
|
sl@0
|
42 |
CCertAppTestAction::CCertAppTestAction(RFs& aFs, CConsoleBase& aConsole,
|
sl@0
|
43 |
Output& aOut)
|
sl@0
|
44 |
: CTestAction(aConsole, aOut), iFs(aFs)
|
sl@0
|
45 |
{
|
sl@0
|
46 |
}
|
sl@0
|
47 |
|
sl@0
|
48 |
void CCertAppTestAction::ConstructL(const TTestActionSpec& aTestActionSpec)
|
sl@0
|
49 |
{
|
sl@0
|
50 |
CTestAction::ConstructL(aTestActionSpec);
|
sl@0
|
51 |
TInt pos = 0, error = 0;
|
sl@0
|
52 |
SetExpectedResult(ParseTagString(aTestActionSpec.iActionResult, KReturn, pos, error));
|
sl@0
|
53 |
}
|
sl@0
|
54 |
|
sl@0
|
55 |
void CCertAppTestAction::InitialiseL(TBool& /*aMemFailureFlag*/,
|
sl@0
|
56 |
TBool& /*aCancel*/, TInt& /*aHeapMark*/, TInt& /*aHeapMarkEnd*/)
|
sl@0
|
57 |
{
|
sl@0
|
58 |
}
|
sl@0
|
59 |
|
sl@0
|
60 |
TPtrC8 CCertAppTestAction::ParseTagString(const TDesC8& aBuf, const TDesC8& aTagName, TInt& aPos, TInt& aError)
|
sl@0
|
61 |
{
|
sl@0
|
62 |
// wrapper around the Input::ParseElement function. Processes aTagName
|
sl@0
|
63 |
// and produces <aTagName> and </aTagName> used by ParseElement
|
sl@0
|
64 |
TBuf8<64> start(0);
|
sl@0
|
65 |
TBuf8<64> end(0);
|
sl@0
|
66 |
|
sl@0
|
67 |
start.Append('<');
|
sl@0
|
68 |
start.Append(aTagName);
|
sl@0
|
69 |
start.Append('>');
|
sl@0
|
70 |
|
sl@0
|
71 |
end.Append('<');
|
sl@0
|
72 |
end.Append('/');
|
sl@0
|
73 |
end.Append(aTagName);
|
sl@0
|
74 |
end.Append('>');
|
sl@0
|
75 |
|
sl@0
|
76 |
return Input::ParseElement(aBuf, start, end, aPos, aError);
|
sl@0
|
77 |
}
|
sl@0
|
78 |
|
sl@0
|
79 |
TInt32 CCertAppTestAction::ParseTagInt(const TDesC8& aBuf, const TDesC8& aTagName, TInt& aPos, TInt& aError)
|
sl@0
|
80 |
{
|
sl@0
|
81 |
TPtrC8 ptr(ParseTagString(aBuf, aTagName, aPos, aError));
|
sl@0
|
82 |
|
sl@0
|
83 |
// Get an integer value out of it
|
sl@0
|
84 |
TInt32 retVal = 0;
|
sl@0
|
85 |
TLex8 lex(ptr);
|
sl@0
|
86 |
lex.Val(retVal);
|
sl@0
|
87 |
return retVal;
|
sl@0
|
88 |
}
|
sl@0
|
89 |
|
sl@0
|
90 |
|
sl@0
|
91 |
void CCertAppTestAction::SetExpectedResult(const TDesC8& aResult)
|
sl@0
|
92 |
{
|
sl@0
|
93 |
if (aResult == _L8("KErrNone") || aResult == KNullDesC8)
|
sl@0
|
94 |
{
|
sl@0
|
95 |
iExpectedResult = KErrNone;
|
sl@0
|
96 |
}
|
sl@0
|
97 |
else if (aResult == _L8("KErrAccessDenied"))
|
sl@0
|
98 |
{
|
sl@0
|
99 |
iExpectedResult = KErrAccessDenied;
|
sl@0
|
100 |
}
|
sl@0
|
101 |
else if (aResult == _L8("KErrNotReady"))
|
sl@0
|
102 |
{
|
sl@0
|
103 |
iExpectedResult = KErrNotReady;
|
sl@0
|
104 |
}
|
sl@0
|
105 |
else if (aResult == _L8("KErrAlreadyExists"))
|
sl@0
|
106 |
{
|
sl@0
|
107 |
iExpectedResult = KErrAlreadyExists;
|
sl@0
|
108 |
}
|
sl@0
|
109 |
else if (aResult == _L8("KErrInUse"))
|
sl@0
|
110 |
{
|
sl@0
|
111 |
iExpectedResult = KErrInUse;
|
sl@0
|
112 |
}
|
sl@0
|
113 |
else if (aResult == _L8("KErrNotFound"))
|
sl@0
|
114 |
{
|
sl@0
|
115 |
iExpectedResult = KErrNotFound;
|
sl@0
|
116 |
}
|
sl@0
|
117 |
else if (aResult == _L8("KErrBadName"))
|
sl@0
|
118 |
{
|
sl@0
|
119 |
iExpectedResult = KErrBadName;
|
sl@0
|
120 |
}
|
sl@0
|
121 |
else if (aResult == _L8("KErrArgument"))
|
sl@0
|
122 |
{
|
sl@0
|
123 |
iExpectedResult = KErrArgument;
|
sl@0
|
124 |
}
|
sl@0
|
125 |
else if (aResult == _L8("KErrNotReady"))
|
sl@0
|
126 |
{
|
sl@0
|
127 |
iExpectedResult = KErrNotReady;
|
sl@0
|
128 |
}
|
sl@0
|
129 |
else if (aResult == _L8("KErrCorrupt"))
|
sl@0
|
130 |
{
|
sl@0
|
131 |
iExpectedResult = KErrCorrupt;
|
sl@0
|
132 |
}
|
sl@0
|
133 |
else if (aResult == _L8("KErrPermissionDenied"))
|
sl@0
|
134 |
{
|
sl@0
|
135 |
iExpectedResult = KErrPermissionDenied;
|
sl@0
|
136 |
}
|
sl@0
|
137 |
else
|
sl@0
|
138 |
{
|
sl@0
|
139 |
iOut.write(_L("Unrecognised error code: "));
|
sl@0
|
140 |
iOut.writeString(aResult);
|
sl@0
|
141 |
iOut.writeNewLine();
|
sl@0
|
142 |
User::Leave(KErrArgument);
|
sl@0
|
143 |
}
|
sl@0
|
144 |
}
|
sl@0
|
145 |
|
sl@0
|
146 |
void CCertAppTestAction::PerformAction(TRequestStatus& aStatus)
|
sl@0
|
147 |
{
|
sl@0
|
148 |
TInt err = KErrNone;
|
sl@0
|
149 |
TRAP(err, DoPerformActionL());
|
sl@0
|
150 |
|
sl@0
|
151 |
if (err != KErrNoMemory)
|
sl@0
|
152 |
{
|
sl@0
|
153 |
iFinished = ETrue;
|
sl@0
|
154 |
}
|
sl@0
|
155 |
|
sl@0
|
156 |
TRequestStatus* status = &aStatus;
|
sl@0
|
157 |
User::RequestComplete(status, err);
|
sl@0
|
158 |
}
|
sl@0
|
159 |
|
sl@0
|
160 |
void CCertAppTestAction::DoPerformPrerequisite(TRequestStatus& aStatus)
|
sl@0
|
161 |
{
|
sl@0
|
162 |
TInt err = KErrNone;
|
sl@0
|
163 |
|
sl@0
|
164 |
// For all tests (with the exception of InitManager which overrides this
|
sl@0
|
165 |
// method), we check to make sure that the AppManager is set
|
sl@0
|
166 |
if (iAppManager)
|
sl@0
|
167 |
{
|
sl@0
|
168 |
iActionState = EAction;
|
sl@0
|
169 |
}
|
sl@0
|
170 |
else
|
sl@0
|
171 |
{
|
sl@0
|
172 |
iFinished = ETrue;
|
sl@0
|
173 |
err = KErrNotFound;
|
sl@0
|
174 |
}
|
sl@0
|
175 |
|
sl@0
|
176 |
TRequestStatus* status = &aStatus;
|
sl@0
|
177 |
User::RequestComplete(status, err);
|
sl@0
|
178 |
}
|
sl@0
|
179 |
|
sl@0
|
180 |
void CCertAppTestAction::DoPerformPostrequisite(TRequestStatus& aStatus)
|
sl@0
|
181 |
{
|
sl@0
|
182 |
TRequestStatus* status = &aStatus;
|
sl@0
|
183 |
User::RequestComplete(status, KErrNone);
|
sl@0
|
184 |
}
|
sl@0
|
185 |
|
sl@0
|
186 |
void CCertAppTestAction::PerformCancel()
|
sl@0
|
187 |
{
|
sl@0
|
188 |
}
|
sl@0
|
189 |
|
sl@0
|
190 |
void CCertAppTestAction::Reset()
|
sl@0
|
191 |
{
|
sl@0
|
192 |
}
|
sl@0
|
193 |
|
sl@0
|
194 |
void CCertAppTestAction::DoReportAction()
|
sl@0
|
195 |
{
|
sl@0
|
196 |
}
|
sl@0
|
197 |
|
sl@0
|
198 |
void CCertAppTestAction::DoCheckResult(TInt aError)
|
sl@0
|
199 |
{
|
sl@0
|
200 |
iResult = (aError == iExpectedResult);
|
sl@0
|
201 |
}
|
sl@0
|
202 |
|
sl@0
|
203 |
|
sl@0
|
204 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
205 |
//CInitManager - initialises the singleton manager
|
sl@0
|
206 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
207 |
CInitManager::CInitManager(RFs& aFs, CConsoleBase& aConsole, Output& aOut)
|
sl@0
|
208 |
: CCertAppTestAction(aFs, aConsole, aOut)
|
sl@0
|
209 |
{
|
sl@0
|
210 |
}
|
sl@0
|
211 |
|
sl@0
|
212 |
void CInitManager::DoPerformPrerequisite(TRequestStatus& aStatus)
|
sl@0
|
213 |
{
|
sl@0
|
214 |
TInt err = KErrNone;
|
sl@0
|
215 |
|
sl@0
|
216 |
// If it does not exist, then we are OK
|
sl@0
|
217 |
if (!iAppManager)
|
sl@0
|
218 |
{
|
sl@0
|
219 |
iActionState = EAction;
|
sl@0
|
220 |
}
|
sl@0
|
221 |
else
|
sl@0
|
222 |
{
|
sl@0
|
223 |
iFinished = ETrue;
|
sl@0
|
224 |
err = KErrAlreadyExists;
|
sl@0
|
225 |
}
|
sl@0
|
226 |
|
sl@0
|
227 |
TRequestStatus* status = &aStatus;
|
sl@0
|
228 |
User::RequestComplete(status, err);
|
sl@0
|
229 |
}
|
sl@0
|
230 |
|
sl@0
|
231 |
void CInitManager::DoPerformActionL()
|
sl@0
|
232 |
{
|
sl@0
|
233 |
iAppManager = CCertificateAppInfoManager::NewL();
|
sl@0
|
234 |
}
|
sl@0
|
235 |
|
sl@0
|
236 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
237 |
//CDestroyManager - destroys the singleton manager
|
sl@0
|
238 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
239 |
CDestroyManager::CDestroyManager(RFs& aFs, CConsoleBase& aConsole, Output& aOut)
|
sl@0
|
240 |
: CCertAppTestAction(aFs, aConsole, aOut)
|
sl@0
|
241 |
{
|
sl@0
|
242 |
}
|
sl@0
|
243 |
|
sl@0
|
244 |
void CDestroyManager::DoPerformActionL()
|
sl@0
|
245 |
{
|
sl@0
|
246 |
delete iAppManager;
|
sl@0
|
247 |
iAppManager = NULL;
|
sl@0
|
248 |
}
|
sl@0
|
249 |
|
sl@0
|
250 |
|
sl@0
|
251 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
252 |
//CClearAllApps - removes all the applications from the app list
|
sl@0
|
253 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
254 |
CClearAllApps::CClearAllApps(RFs& aFs, CConsoleBase& aConsole, Output& aOut)
|
sl@0
|
255 |
: CCertAppTestAction(aFs, aConsole, aOut)
|
sl@0
|
256 |
{
|
sl@0
|
257 |
}
|
sl@0
|
258 |
|
sl@0
|
259 |
void CClearAllApps::DoPerformActionL()
|
sl@0
|
260 |
{
|
sl@0
|
261 |
for (;;)
|
sl@0
|
262 |
{
|
sl@0
|
263 |
// apps is owned by the app manager, don't try accessing it after we've
|
sl@0
|
264 |
// removed any of the applications though
|
sl@0
|
265 |
|
sl@0
|
266 |
RArray<TCertificateAppInfo> apps;
|
sl@0
|
267 |
apps = iAppManager->Applications();
|
sl@0
|
268 |
if (apps.Count() == 0)
|
sl@0
|
269 |
{
|
sl@0
|
270 |
break;
|
sl@0
|
271 |
}
|
sl@0
|
272 |
iAppManager->RemoveL(apps[0].Id());
|
sl@0
|
273 |
}
|
sl@0
|
274 |
}
|
sl@0
|
275 |
|
sl@0
|
276 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
277 |
//CAddApp - adds applications
|
sl@0
|
278 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
279 |
CAddApp::CAddApp(RFs& aFs, CConsoleBase& aConsole, Output& aOut)
|
sl@0
|
280 |
: CCertAppTestAction(aFs, aConsole, aOut)
|
sl@0
|
281 |
{
|
sl@0
|
282 |
}
|
sl@0
|
283 |
|
sl@0
|
284 |
CAddApp::~CAddApp()
|
sl@0
|
285 |
{
|
sl@0
|
286 |
iAppArray.Close();
|
sl@0
|
287 |
}
|
sl@0
|
288 |
|
sl@0
|
289 |
void CAddApp::ConstructL(const TTestActionSpec& aTestActionSpec)
|
sl@0
|
290 |
{
|
sl@0
|
291 |
CCertAppTestAction::ConstructL(aTestActionSpec);
|
sl@0
|
292 |
TInt pos = 0;
|
sl@0
|
293 |
TInt err = KErrNone;
|
sl@0
|
294 |
|
sl@0
|
295 |
// Parse the UID and name for the new app
|
sl@0
|
296 |
do
|
sl@0
|
297 |
{
|
sl@0
|
298 |
TUid uid(TUid::Uid(ParseTagInt(aTestActionSpec.iActionBody, KUid, pos, err)));
|
sl@0
|
299 |
if (!err)
|
sl@0
|
300 |
{
|
sl@0
|
301 |
TName name;
|
sl@0
|
302 |
name.Copy(ParseTagString(aTestActionSpec.iActionBody, KAppName, pos, err));
|
sl@0
|
303 |
iAppArray.Append(TCertificateAppInfo(uid, name));
|
sl@0
|
304 |
}
|
sl@0
|
305 |
}
|
sl@0
|
306 |
while (!err);
|
sl@0
|
307 |
}
|
sl@0
|
308 |
|
sl@0
|
309 |
void CAddApp::DoPerformActionL()
|
sl@0
|
310 |
{
|
sl@0
|
311 |
for (TInt i = 0; i < iAppArray.Count(); ++i)
|
sl@0
|
312 |
{
|
sl@0
|
313 |
iAppManager->AddL(iAppArray[i]);
|
sl@0
|
314 |
}
|
sl@0
|
315 |
}
|
sl@0
|
316 |
|
sl@0
|
317 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
318 |
//CRemoveApp - removes an application
|
sl@0
|
319 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
320 |
CRemoveApp::CRemoveApp(RFs& aFs, CConsoleBase& aConsole, Output& aOut)
|
sl@0
|
321 |
: CCertAppTestAction(aFs, aConsole, aOut)
|
sl@0
|
322 |
{
|
sl@0
|
323 |
}
|
sl@0
|
324 |
|
sl@0
|
325 |
void CRemoveApp::ConstructL(const TTestActionSpec& aTestActionSpec)
|
sl@0
|
326 |
{
|
sl@0
|
327 |
CCertAppTestAction::ConstructL(aTestActionSpec);
|
sl@0
|
328 |
TInt pos = 0;
|
sl@0
|
329 |
TInt err = KErrNone;
|
sl@0
|
330 |
|
sl@0
|
331 |
// Parse the UID
|
sl@0
|
332 |
iUid = TUid::Uid(ParseTagInt(aTestActionSpec.iActionBody, KUid, pos, err));
|
sl@0
|
333 |
}
|
sl@0
|
334 |
|
sl@0
|
335 |
void CRemoveApp::DoPerformActionL()
|
sl@0
|
336 |
{
|
sl@0
|
337 |
iAppManager->RemoveL(iUid);
|
sl@0
|
338 |
}
|
sl@0
|
339 |
|
sl@0
|
340 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
341 |
//CAppCount - Gets the number of applications
|
sl@0
|
342 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
343 |
CAppCount::CAppCount(RFs& aFs, CConsoleBase& aConsole, Output& aOut)
|
sl@0
|
344 |
: CCertAppTestAction(aFs, aConsole, aOut)
|
sl@0
|
345 |
{
|
sl@0
|
346 |
}
|
sl@0
|
347 |
|
sl@0
|
348 |
void CAppCount::ConstructL(const TTestActionSpec& aTestActionSpec)
|
sl@0
|
349 |
{
|
sl@0
|
350 |
CCertAppTestAction::ConstructL(aTestActionSpec);
|
sl@0
|
351 |
TInt pos = 0;
|
sl@0
|
352 |
TInt err = KErrNone;
|
sl@0
|
353 |
|
sl@0
|
354 |
// Parse the expected number of applications
|
sl@0
|
355 |
iCount = ParseTagInt(aTestActionSpec.iActionBody, KCount, pos, err);
|
sl@0
|
356 |
}
|
sl@0
|
357 |
|
sl@0
|
358 |
void CAppCount::DoPerformActionL()
|
sl@0
|
359 |
{
|
sl@0
|
360 |
if (iCount != iAppManager->Applications().Count())
|
sl@0
|
361 |
User::Leave(KErrArgument);
|
sl@0
|
362 |
}
|
sl@0
|
363 |
|
sl@0
|
364 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
365 |
//CGetApp - Gets an application with a given ID
|
sl@0
|
366 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
367 |
CGetApp::CGetApp(RFs& aFs, CConsoleBase& aConsole, Output& aOut)
|
sl@0
|
368 |
: CCertAppTestAction(aFs, aConsole, aOut)
|
sl@0
|
369 |
{
|
sl@0
|
370 |
}
|
sl@0
|
371 |
|
sl@0
|
372 |
void CGetApp::ConstructL(const TTestActionSpec& aTestActionSpec)
|
sl@0
|
373 |
{
|
sl@0
|
374 |
CCertAppTestAction::ConstructL(aTestActionSpec);
|
sl@0
|
375 |
TInt pos = 0;
|
sl@0
|
376 |
TInt err = KErrNone;
|
sl@0
|
377 |
|
sl@0
|
378 |
// Parse the UID to retrieve and the name to expect
|
sl@0
|
379 |
iUid = TUid::Uid(ParseTagInt(aTestActionSpec.iActionBody, KUid, pos, err));
|
sl@0
|
380 |
iName.Copy(ParseTagString(aTestActionSpec.iActionBody, KAppName, pos, err));
|
sl@0
|
381 |
}
|
sl@0
|
382 |
|
sl@0
|
383 |
void CGetApp::DoPerformActionL()
|
sl@0
|
384 |
{
|
sl@0
|
385 |
TCertificateAppInfo app;
|
sl@0
|
386 |
TInt index;
|
sl@0
|
387 |
app = iAppManager->ApplicationL(iUid, index);
|
sl@0
|
388 |
|
sl@0
|
389 |
if (app.Name() != iName)
|
sl@0
|
390 |
User::Leave(KErrCorrupt);
|
sl@0
|
391 |
}
|
sl@0
|
392 |
|
sl@0
|
393 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
394 |
//CGetApplications - Gets the applications and compares with what is expected
|
sl@0
|
395 |
/////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
396 |
CGetApplications::CGetApplications(RFs& aFs, CConsoleBase& aConsole, Output& aOut)
|
sl@0
|
397 |
: CCertAppTestAction(aFs, aConsole, aOut)
|
sl@0
|
398 |
{
|
sl@0
|
399 |
}
|
sl@0
|
400 |
|
sl@0
|
401 |
CGetApplications::~CGetApplications()
|
sl@0
|
402 |
{
|
sl@0
|
403 |
iAppArray.Close();
|
sl@0
|
404 |
}
|
sl@0
|
405 |
|
sl@0
|
406 |
void CGetApplications::ConstructL(const TTestActionSpec& aTestActionSpec)
|
sl@0
|
407 |
{
|
sl@0
|
408 |
CCertAppTestAction::ConstructL(aTestActionSpec);
|
sl@0
|
409 |
TInt pos = 0;
|
sl@0
|
410 |
TInt err = KErrNone;
|
sl@0
|
411 |
|
sl@0
|
412 |
// Parse the UID and name for the new app
|
sl@0
|
413 |
do
|
sl@0
|
414 |
{
|
sl@0
|
415 |
TUid uid(TUid::Uid(ParseTagInt(aTestActionSpec.iActionBody, KUid, pos, err)));
|
sl@0
|
416 |
if (!err)
|
sl@0
|
417 |
{
|
sl@0
|
418 |
TName name;
|
sl@0
|
419 |
name.Copy(ParseTagString(aTestActionSpec.iActionBody, KAppName, pos, err));
|
sl@0
|
420 |
iAppArray.Append(TCertificateAppInfo(uid, name));
|
sl@0
|
421 |
}
|
sl@0
|
422 |
}
|
sl@0
|
423 |
while (!err);
|
sl@0
|
424 |
}
|
sl@0
|
425 |
|
sl@0
|
426 |
void CGetApplications::DoPerformActionL()
|
sl@0
|
427 |
{
|
sl@0
|
428 |
const RArray<TCertificateAppInfo>& recArray = iAppManager->Applications();
|
sl@0
|
429 |
TInt count = iAppArray.Count();
|
sl@0
|
430 |
|
sl@0
|
431 |
if (count != recArray.Count())
|
sl@0
|
432 |
{
|
sl@0
|
433 |
User::Leave(KErrArgument);
|
sl@0
|
434 |
}
|
sl@0
|
435 |
|
sl@0
|
436 |
for (TInt i = 0 ; i < count ; ++i)
|
sl@0
|
437 |
{
|
sl@0
|
438 |
TInt j;
|
sl@0
|
439 |
for (j = 0 ; j < count ; ++j)
|
sl@0
|
440 |
{
|
sl@0
|
441 |
if ((iAppArray[i].Id() == recArray[j].Id()) &&
|
sl@0
|
442 |
(iAppArray[i].Name() == recArray[j].Name()))
|
sl@0
|
443 |
{
|
sl@0
|
444 |
break;
|
sl@0
|
445 |
}
|
sl@0
|
446 |
}
|
sl@0
|
447 |
|
sl@0
|
448 |
if (j == count)
|
sl@0
|
449 |
{
|
sl@0
|
450 |
// If we get to the end of recArray and there is no match then
|
sl@0
|
451 |
// the arrays definitely do not match
|
sl@0
|
452 |
User::Leave(KErrArgument);
|
sl@0
|
453 |
}
|
sl@0
|
454 |
}
|
sl@0
|
455 |
}
|