2
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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 module contains the implementation of
|
|
15 |
* CAtsLogger class member functions.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
// INCLUDE FILES
|
|
20 |
#include "atslogger.h"
|
|
21 |
|
|
22 |
CAtsLogger::CAtsLogger(const TDesC& aName) :
|
|
23 |
iReportStage(EUninitialized),
|
|
24 |
iName(aName),
|
|
25 |
iIndentLevel(0),
|
|
26 |
iRawLog(EFalse),
|
|
27 |
iXmlLog(EFalse),
|
|
28 |
iValid(EFalse),
|
|
29 |
iLineFeedDone(EFalse),
|
|
30 |
iInTestCase(EFalse),
|
|
31 |
iClosed(EFalse),
|
|
32 |
iFullReportingMode(ETrue),
|
|
33 |
iDoDebugOutput(EFalse),
|
|
34 |
iDoIndentation(ETrue)
|
|
35 |
{
|
|
36 |
}
|
|
37 |
|
|
38 |
void CAtsLogger::ConstructL( TBool aAfterReboot )
|
|
39 |
{
|
|
40 |
TChar xmlDrive;
|
|
41 |
iXmlLog = CheckDirectoryL(KAtsLoggerXmlDirectory, xmlDrive);
|
|
42 |
TChar rawDrive;
|
|
43 |
iRawLog = CheckDirectoryL(KAtsLoggerRawDirectory, rawDrive);
|
|
44 |
if (iXmlLog)
|
|
45 |
{
|
|
46 |
iXmlLogFileName.Copy(_L("?:"));
|
|
47 |
iXmlLogFileName.Append(KAtsLoggerXmlDirectory);
|
|
48 |
iXmlLogFileName.Append(iName);
|
|
49 |
iXmlLogFileName.Append(KAtsLoggerXmlSuffix);
|
|
50 |
iXmlLogFileName[0] = (TUint8)xmlDrive;
|
|
51 |
if( aAfterReboot )
|
|
52 |
{
|
|
53 |
User::LeaveIfError(OpenExistingFileL(iXmlLogFileName));
|
|
54 |
}
|
|
55 |
else
|
|
56 |
{
|
|
57 |
User::LeaveIfError(ReplaceFileL(iXmlLogFileName));
|
|
58 |
}
|
|
59 |
iValid = ETrue;
|
|
60 |
}
|
|
61 |
else
|
|
62 |
{
|
|
63 |
iValid = EFalse;
|
|
64 |
}
|
|
65 |
if (iRawLog)
|
|
66 |
{
|
|
67 |
iRawLogFileName.Copy(_L("?:"));
|
|
68 |
iRawLogFileName.Append(KAtsLoggerRawDirectory);
|
|
69 |
iRawLogFileName.Append(iName);
|
|
70 |
iRawLogFileName.Append(KAtsLoggerRawSuffix);
|
|
71 |
iRawLogFileName[0] = (TUint8)rawDrive;
|
|
72 |
if( aAfterReboot )
|
|
73 |
{
|
|
74 |
User::LeaveIfError(OpenExistingFileL(iRawLogFileName));
|
|
75 |
}
|
|
76 |
else
|
|
77 |
{
|
|
78 |
User::LeaveIfError(ReplaceFileL(iRawLogFileName));
|
|
79 |
}
|
|
80 |
}
|
|
81 |
iXmlBuffer = CBufSeg::NewL(KAtsLoggerBufferSegmentGranularity);
|
|
82 |
iXmlBufferLength = 0;
|
|
83 |
}
|
|
84 |
|
|
85 |
|
|
86 |
TBool CAtsLogger::CheckDirectoryL(const TDesC& aDirName, TChar& aDrive)
|
|
87 |
{
|
|
88 |
User::LeaveIfError(iRfs.Connect());
|
|
89 |
TDriveList driveList;
|
|
90 |
iRfs.DriveList(driveList);
|
|
91 |
TBool dirFound = EFalse;
|
|
92 |
TFileName dir;
|
|
93 |
for (TInt i = 0; i < driveList.Length() && !dirFound; i++)
|
|
94 |
{
|
|
95 |
TChar drive;
|
|
96 |
if (driveList[i] != 0)
|
|
97 |
{
|
|
98 |
iRfs.DriveToChar(i, drive);
|
|
99 |
dir.Copy(_L("?:"));
|
|
100 |
dir.Append(aDirName);
|
|
101 |
dir[0] = (TUint8)drive;
|
|
102 |
RDir rDir;
|
|
103 |
TInt error = rDir.Open(iRfs, dir, KEntryAttNormal);
|
|
104 |
if (error == KErrNone)
|
|
105 |
{
|
|
106 |
dirFound = ETrue;
|
|
107 |
aDrive = drive;
|
|
108 |
}
|
|
109 |
else
|
|
110 |
{
|
|
111 |
dirFound = EFalse;
|
|
112 |
aDrive = '?';
|
|
113 |
}
|
|
114 |
rDir.Close();
|
|
115 |
}
|
|
116 |
}
|
|
117 |
iRfs.Close();
|
|
118 |
return dirFound;
|
|
119 |
}
|
|
120 |
|
|
121 |
TInt CAtsLogger::ReplaceFileL(const TDesC& aFileName)
|
|
122 |
{
|
|
123 |
User::LeaveIfError(iRfs.Connect());
|
|
124 |
RFile file;
|
|
125 |
TInt err = file.Replace(iRfs, aFileName, EFileWrite | EFileShareAny);
|
|
126 |
file.Close();
|
|
127 |
iRfs.Close();
|
|
128 |
return err;
|
|
129 |
}
|
|
130 |
|
|
131 |
TInt CAtsLogger::OpenExistingFileL(const TDesC& aFileName)
|
|
132 |
{
|
|
133 |
User::LeaveIfError(iRfs.Connect());
|
|
134 |
RFile file;
|
|
135 |
TInt err = file.Open(iRfs, aFileName, EFileWrite | EFileShareAny);
|
|
136 |
file.Close();
|
|
137 |
iRfs.Close();
|
|
138 |
return err;
|
|
139 |
}
|
|
140 |
|
|
141 |
EXPORT_C CAtsLogger::~CAtsLogger()
|
|
142 |
{
|
|
143 |
if (!iClosed)
|
|
144 |
{
|
|
145 |
CloseL();
|
|
146 |
}
|
|
147 |
if (iXmlBuffer)
|
|
148 |
{
|
|
149 |
delete iXmlBuffer;
|
|
150 |
iXmlBuffer = NULL;
|
|
151 |
}
|
|
152 |
}
|
|
153 |
|
|
154 |
EXPORT_C void CAtsLogger::CloseL()
|
|
155 |
{
|
|
156 |
if (iClosed)
|
|
157 |
{
|
|
158 |
return;
|
|
159 |
}
|
|
160 |
User::LeaveIfError(iRfs.Connect());
|
|
161 |
if (iXmlLog)
|
|
162 |
{
|
|
163 |
RFile file;
|
|
164 |
TInt err = file.Open(iRfs, iXmlLogFileName, EFileWrite | EFileShareAny);
|
|
165 |
if (err == KErrNone)
|
|
166 |
{
|
|
167 |
TInt fileSize = 0;
|
|
168 |
file.Size(fileSize);
|
|
169 |
file.Close();
|
|
170 |
if (fileSize == 0)
|
|
171 |
{
|
|
172 |
iRfs.Delete(iXmlLogFileName);
|
|
173 |
}
|
|
174 |
}
|
|
175 |
}
|
|
176 |
if (iRawLog)
|
|
177 |
{
|
|
178 |
RFile file;
|
|
179 |
TInt err = file.Open(iRfs, iRawLogFileName, EFileWrite | EFileShareAny);
|
|
180 |
if (err == KErrNone)
|
|
181 |
{
|
|
182 |
TInt fileSize = 0;
|
|
183 |
file.Size(fileSize);
|
|
184 |
file.Close();
|
|
185 |
if (fileSize == 0)
|
|
186 |
{
|
|
187 |
iRfs.Delete(iRawLogFileName);
|
|
188 |
}
|
|
189 |
}
|
|
190 |
}
|
|
191 |
iRfs.Close();
|
|
192 |
iClosed = ETrue;
|
|
193 |
}
|
|
194 |
|
|
195 |
|
|
196 |
EXPORT_C CAtsLogger* CAtsLogger::NewL( const TDesC& aName,
|
|
197 |
TBool aAfterReboot )
|
|
198 |
{
|
|
199 |
__ASSERT_ALWAYS(aName.Length() > 0, User::Leave(KErrBadName));
|
|
200 |
RFs rfs;
|
|
201 |
User::LeaveIfError(rfs.Connect());
|
|
202 |
__ASSERT_ALWAYS(rfs.IsValidName(aName), User::Leave(KErrBadName));
|
|
203 |
rfs.Close();
|
|
204 |
CAtsLogger* self = new (ELeave) CAtsLogger(aName);
|
|
205 |
CleanupStack::PushL(self);
|
|
206 |
self->ConstructL( aAfterReboot );
|
|
207 |
CleanupStack::Pop(self);
|
|
208 |
return self;
|
|
209 |
}
|
|
210 |
|
|
211 |
|
|
212 |
EXPORT_C TBool CAtsLogger::IsValid()
|
|
213 |
{
|
|
214 |
return iValid;
|
|
215 |
}
|
|
216 |
|
|
217 |
EXPORT_C void CAtsLogger::BeginTestReportL()
|
|
218 |
{
|
|
219 |
if (iFullReportingMode)
|
|
220 |
{
|
|
221 |
if (!IsTransitionLegal(EBeginTestReport))
|
|
222 |
{
|
|
223 |
User::Leave(EBeginTestReport);
|
|
224 |
}
|
|
225 |
iReportStage = EBeginTestReport;
|
|
226 |
OpenTagIndentL(KAtsLoggerTagTestReport());
|
|
227 |
}
|
|
228 |
else
|
|
229 |
{
|
|
230 |
//iTestSet.iStartTime = TTime();
|
|
231 |
iTestSet.iStartTime.HomeTime();
|
|
232 |
}
|
|
233 |
}
|
|
234 |
|
|
235 |
EXPORT_C void CAtsLogger::EndTestReportL()
|
|
236 |
{
|
|
237 |
if (iFullReportingMode)
|
|
238 |
{
|
|
239 |
if (!IsTransitionLegal(EEndTestReport))
|
|
240 |
{
|
|
241 |
User::Leave(EEndTestReport);
|
|
242 |
}
|
|
243 |
iReportStage = EEndTestReport;
|
|
244 |
CloseTagIndentL(KAtsLoggerTagTestReport());
|
|
245 |
}
|
|
246 |
if (iDoDebugOutput)
|
|
247 |
{
|
|
248 |
WriteBufferToDebugPortL(iXmlBuffer);
|
|
249 |
}
|
|
250 |
if (iXmlLog && !iInTestCase && iXmlBufferLength > 0)
|
|
251 |
{
|
|
252 |
WriteBufferToFileL(iXmlBuffer, iXmlLogFileName);
|
|
253 |
}
|
|
254 |
iXmlBuffer->Reset();
|
|
255 |
iXmlBufferLength = 0;
|
|
256 |
}
|
|
257 |
|
|
258 |
EXPORT_C void CAtsLogger::BeginTestSetL(const TDesC& aFactory,
|
|
259 |
const TDesC& aComponent,
|
|
260 |
const TDesC& aVersion,
|
|
261 |
const TDesC& aDescription)
|
|
262 |
{
|
|
263 |
if (iFullReportingMode)
|
|
264 |
{
|
|
265 |
if (!IsTransitionLegal(EBeginTestSet))
|
|
266 |
{
|
|
267 |
User::Leave(EBeginTestSet);
|
|
268 |
}
|
|
269 |
iReportStage = EBeginTestSet;
|
|
270 |
//iTestSet.iStartTime = TTime();
|
|
271 |
iTestSet.iStartTime.HomeTime();
|
|
272 |
TDateTime date(iTestSet.iStartTime.DateTime());
|
|
273 |
OpenTagIndentL(KAtsLoggerTagTestSet());
|
|
274 |
OpenTagIndentL(KAtsLoggerTagTestSetInit());
|
|
275 |
TagL(KAtsLoggerTagDescription(), aDescription);
|
|
276 |
HBufC* stamp;
|
|
277 |
stamp = FormatDateLC(date);
|
|
278 |
TagL(KAtsLoggerTagDate(), *stamp);
|
|
279 |
CleanupStack::PopAndDestroy(stamp);
|
|
280 |
TagL(KAtsLoggerTagFactory(), aFactory);
|
|
281 |
OpenTagIndentL(KAtsLoggerTagComponent());
|
|
282 |
TagL(KAtsLoggerTagName(), aComponent);
|
|
283 |
TagL(KAtsLoggerTagVersion(), aVersion);
|
|
284 |
CloseTagIndentL(KAtsLoggerTagComponent());
|
|
285 |
CloseTagIndentL(KAtsLoggerTagTestSetInit());
|
|
286 |
}
|
|
287 |
}
|
|
288 |
|
|
289 |
EXPORT_C void CAtsLogger::SaveForRebootL()
|
|
290 |
{
|
|
291 |
if (iFullReportingMode)
|
|
292 |
{
|
|
293 |
iReportStage = EEndTestReport;
|
|
294 |
}
|
|
295 |
if (iDoDebugOutput)
|
|
296 |
{
|
|
297 |
WriteBufferToDebugPortL(iXmlBuffer);
|
|
298 |
}
|
|
299 |
if (iXmlLog && !iInTestCase && iXmlBufferLength > 0)
|
|
300 |
{
|
|
301 |
WriteBufferToFileL(iXmlBuffer, iXmlLogFileName);
|
|
302 |
}
|
|
303 |
iXmlBuffer->Reset();
|
|
304 |
iXmlBufferLength = 0;
|
|
305 |
}
|
|
306 |
|
|
307 |
EXPORT_C void CAtsLogger::ContinueAfterRebootL()
|
|
308 |
{
|
|
309 |
if (iFullReportingMode)
|
|
310 |
{
|
|
311 |
iIndentLevel += 2;
|
|
312 |
iLineFeedDone = ETrue;
|
|
313 |
iReportStage = EBeginTestSet;
|
|
314 |
//iTestSet.iStartTime = TTime();
|
|
315 |
iTestSet.iStartTime.HomeTime();
|
|
316 |
}
|
|
317 |
}
|
|
318 |
|
|
319 |
|
|
320 |
EXPORT_C void CAtsLogger::EndTestSetL()
|
|
321 |
{
|
|
322 |
if (iFullReportingMode)
|
|
323 |
{
|
|
324 |
if (!IsTransitionLegal(EEndTestSet))
|
|
325 |
{
|
|
326 |
User::Leave(EEndTestSet);
|
|
327 |
}
|
|
328 |
iReportStage = EEndTestSet;
|
|
329 |
OpenTagIndentL(KAtsLoggerTagTestSetResult());
|
|
330 |
TTime current;
|
|
331 |
current.HomeTime();
|
|
332 |
HBufC* time;
|
|
333 |
time = FormatTimeLC(current.MicroSecondsFrom(iTestSet.iStartTime));
|
|
334 |
TagL(KAtsLoggerTagRunTime(), *time);
|
|
335 |
CleanupStack::PopAndDestroy(time);
|
|
336 |
CloseTagIndentL(KAtsLoggerTagTestSetResult());
|
|
337 |
CloseTagIndentL(KAtsLoggerTagTestSet());
|
|
338 |
}
|
|
339 |
}
|
|
340 |
|
|
341 |
EXPORT_C void CAtsLogger::BeginTestCaseL(const TDesC& aId,
|
|
342 |
const TDesC& aExpected,
|
|
343 |
const TDesC& aInfo,
|
|
344 |
const TDesC& aVersion)
|
|
345 |
{
|
|
346 |
TTime current;
|
|
347 |
current.HomeTime();
|
|
348 |
BeginTestCaseReportL( aId, aExpected, current, aInfo, aVersion );
|
|
349 |
}
|
|
350 |
|
|
351 |
EXPORT_C void CAtsLogger::BeginTestCaseL(const TDesC& aId,
|
|
352 |
const TInt aExpected,
|
|
353 |
const TDesC& aInfo,
|
|
354 |
const TDesC& aVersion)
|
|
355 |
{
|
|
356 |
TBuf<16> res;
|
|
357 |
res.Format(_L("%d"), aExpected);
|
|
358 |
BeginTestCaseL(aId, res, aInfo, aVersion);
|
|
359 |
}
|
|
360 |
|
|
361 |
EXPORT_C void CAtsLogger::BeginTestCaseReportL( const TDesC& aId,
|
|
362 |
const TDesC& aExpected,
|
|
363 |
const TTime& aStartTime,
|
|
364 |
const TDesC& aInfo,
|
|
365 |
const TDesC& aVersion )
|
|
366 |
{
|
|
367 |
if (iFullReportingMode)
|
|
368 |
{
|
|
369 |
if (!IsTransitionLegal(EBeginTestCase))
|
|
370 |
{
|
|
371 |
User::Leave(EBeginTestCase);
|
|
372 |
}
|
|
373 |
iReportStage = EBeginTestCase;
|
|
374 |
}
|
|
375 |
|
|
376 |
iTestCase.iStartTime = aStartTime;
|
|
377 |
|
|
378 |
HBufC* time;
|
|
379 |
time = FormatTimeLC(aStartTime.MicroSecondsFrom(iTestSet.iStartTime));
|
|
380 |
OpenTagIndentL(KAtsLoggerTagTestCase(), KAtsLoggerTimeStamp(), *time);
|
|
381 |
CleanupStack::PopAndDestroy(time);
|
|
382 |
OpenTagIndentL(KAtsLoggerTagTestCaseInit());
|
|
383 |
TagL(KAtsLoggerTagVersion, aVersion);
|
|
384 |
TagL(KAtsLoggerTagId(), aId);
|
|
385 |
TagL(KAtsLoggerTagExpected(), aExpected, KAtsLoggerTagDescription(), aInfo);
|
|
386 |
CloseTagIndentL(KAtsLoggerTagTestCaseInit());
|
|
387 |
iTestCase.iStatus.Set(KAtsLoggerNa());
|
|
388 |
iInTestCase = ETrue;
|
|
389 |
}
|
|
390 |
|
|
391 |
EXPORT_C void CAtsLogger::BeginTestCaseReportL( const TDesC& aId,
|
|
392 |
const TInt aExpected,
|
|
393 |
const TTime& aStartTime,
|
|
394 |
const TDesC& aInfo,
|
|
395 |
const TDesC& aVersion )
|
|
396 |
{
|
|
397 |
TBuf<16> res;
|
|
398 |
res.Format(_L("%d"), aExpected);
|
|
399 |
BeginTestCaseReportL( aId, res, aStartTime, aInfo, aVersion );
|
|
400 |
}
|
|
401 |
|
|
402 |
EXPORT_C void CAtsLogger::EndTestCaseL()
|
|
403 |
{
|
|
404 |
if (iFullReportingMode)
|
|
405 |
{
|
|
406 |
if (!IsTransitionLegal(EEndTestCase))
|
|
407 |
{
|
|
408 |
User::Leave(EEndTestCase);
|
|
409 |
}
|
|
410 |
iReportStage = EEndTestCase;
|
|
411 |
}
|
|
412 |
TTime current;
|
|
413 |
current.HomeTime();
|
|
414 |
OpenTagIndentL(KAtsLoggerTagTestCaseResult(), KAtsLoggerTagStatus(), iTestCase.iStatus);
|
|
415 |
if (iTestCase.iResult)
|
|
416 |
{
|
|
417 |
TagL(KAtsLoggerTagActual(), *iTestCase.iResult);
|
|
418 |
delete iTestCase.iResult;
|
|
419 |
iTestCase.iResult = NULL;
|
|
420 |
}
|
|
421 |
else
|
|
422 |
{
|
|
423 |
TagL(KAtsLoggerTagActual(), KAtsLoggerEmpty());
|
|
424 |
}
|
|
425 |
HBufC* time;
|
|
426 |
time = FormatTimeLC(current.MicroSecondsFrom(iTestCase.iStartTime));
|
|
427 |
TagL(KAtsLoggerTagRunTime(), *time);
|
|
428 |
CleanupStack::PopAndDestroy(time);
|
|
429 |
CloseTagIndentL(KAtsLoggerTagTestCaseResult());
|
|
430 |
CloseTagIndentL(KAtsLoggerTagTestCase());
|
|
431 |
iInTestCase = EFalse;
|
|
432 |
if (iDoDebugOutput)
|
|
433 |
{
|
|
434 |
WriteBufferToDebugPortL(iXmlBuffer);
|
|
435 |
}
|
|
436 |
if (iXmlLog)
|
|
437 |
{
|
|
438 |
WriteBufferToFileL(iXmlBuffer, iXmlLogFileName);
|
|
439 |
}
|
|
440 |
iXmlBuffer->Reset();
|
|
441 |
iXmlBufferLength = 0;
|
|
442 |
}
|
|
443 |
|
|
444 |
EXPORT_C void CAtsLogger::TestCasePassed()
|
|
445 |
{
|
|
446 |
if (iFullReportingMode)
|
|
447 |
{
|
|
448 |
if (!IsTransitionLegal(ESetTestCaseVerdict))
|
|
449 |
{
|
|
450 |
User::Leave(ESetTestCaseVerdict);
|
|
451 |
}
|
|
452 |
iReportStage = ESetTestCaseVerdict;
|
|
453 |
}
|
|
454 |
iTestCase.iStatus.Set(KAtsLoggerPassed());
|
|
455 |
}
|
|
456 |
|
|
457 |
EXPORT_C void CAtsLogger::TestCaseFailed()
|
|
458 |
{
|
|
459 |
if (iFullReportingMode)
|
|
460 |
{
|
|
461 |
if (!IsTransitionLegal(ESetTestCaseVerdict))
|
|
462 |
{
|
|
463 |
User::Leave(ESetTestCaseVerdict);
|
|
464 |
}
|
|
465 |
iReportStage = ESetTestCaseVerdict;
|
|
466 |
}
|
|
467 |
iTestCase.iStatus.Set(KAtsLoggerFailed());
|
|
468 |
}
|
|
469 |
|
|
470 |
EXPORT_C void CAtsLogger::TestCaseNa()
|
|
471 |
{
|
|
472 |
if (iFullReportingMode)
|
|
473 |
{
|
|
474 |
if (!IsTransitionLegal(ESetTestCaseVerdict))
|
|
475 |
{
|
|
476 |
User::Leave(ESetTestCaseVerdict);
|
|
477 |
}
|
|
478 |
iReportStage = ESetTestCaseVerdict;
|
|
479 |
}
|
|
480 |
iTestCase.iStatus.Set(KAtsLoggerNa());
|
|
481 |
}
|
|
482 |
|
|
483 |
EXPORT_C void CAtsLogger::TestCaseSkipped()
|
|
484 |
{
|
|
485 |
if (iFullReportingMode)
|
|
486 |
{
|
|
487 |
if (!IsTransitionLegal(ESetTestCaseVerdict))
|
|
488 |
{
|
|
489 |
User::Leave(ESetTestCaseVerdict);
|
|
490 |
}
|
|
491 |
iReportStage = ESetTestCaseVerdict;
|
|
492 |
}
|
|
493 |
iTestCase.iStatus.Set(KAtsLoggerSkipped());
|
|
494 |
}
|
|
495 |
|
|
496 |
EXPORT_C void CAtsLogger::SetTestCaseResultL(const TDesC& aResult)
|
|
497 |
{
|
|
498 |
if (iTestCase.iResult)
|
|
499 |
{
|
|
500 |
delete iTestCase.iResult;
|
|
501 |
iTestCase.iResult = NULL;
|
|
502 |
}
|
|
503 |
HBufC* newResult = HBufC::NewL(aResult.Length());
|
|
504 |
|
|
505 |
CleanupStack::PushL(newResult);
|
|
506 |
TPtr ptr(newResult->Des());
|
|
507 |
ptr.Copy(aResult);
|
|
508 |
CleanupStack::Pop(newResult);
|
|
509 |
|
|
510 |
iTestCase.iResult = newResult;
|
|
511 |
}
|
|
512 |
|
|
513 |
EXPORT_C void CAtsLogger::SetTestCaseResultL(const TInt aResult)
|
|
514 |
{
|
|
515 |
if (iTestCase.iResult)
|
|
516 |
{
|
|
517 |
delete iTestCase.iResult;
|
|
518 |
iTestCase.iResult = NULL;
|
|
519 |
}
|
|
520 |
HBufC* newResult = HBufC::NewL(16);
|
|
521 |
|
|
522 |
CleanupStack::PushL(newResult);
|
|
523 |
TPtr ptr(newResult->Des());
|
|
524 |
ptr.Format(_L("%d"), aResult);
|
|
525 |
CleanupStack::Pop(newResult);
|
|
526 |
|
|
527 |
iTestCase.iResult = newResult;
|
|
528 |
}
|
|
529 |
|
|
530 |
EXPORT_C void CAtsLogger::DebugL(TRefByValue<const TDesC> aFmt,...)
|
|
531 |
{
|
|
532 |
VA_LIST list;
|
|
533 |
VA_START(list, aFmt);
|
|
534 |
TBuf<0x100> buf;
|
|
535 |
buf.AppendFormatList(aFmt, list, NULL);
|
|
536 |
DebugL(buf);
|
|
537 |
}
|
|
538 |
|
|
539 |
EXPORT_C void CAtsLogger::DebugL(const TDesC& aMsg)
|
|
540 |
{
|
|
541 |
if (iInTestCase)
|
|
542 |
{
|
|
543 |
TimeStampedMessageL(KAtsLoggerTagDebug(), aMsg);
|
|
544 |
}
|
|
545 |
else
|
|
546 |
{
|
|
547 |
CommentL(aMsg);
|
|
548 |
}
|
|
549 |
}
|
|
550 |
|
|
551 |
EXPORT_C void CAtsLogger::WarningL(TRefByValue<const TDesC> aFmt,...)
|
|
552 |
{
|
|
553 |
VA_LIST list;
|
|
554 |
VA_START(list, aFmt);
|
|
555 |
TBuf<0x100> buf;
|
|
556 |
buf.AppendFormatList(aFmt, list, NULL);
|
|
557 |
WarningL(buf);
|
|
558 |
}
|
|
559 |
|
|
560 |
EXPORT_C void CAtsLogger::WarningL(const TDesC& aMsg)
|
|
561 |
{
|
|
562 |
if (iInTestCase)
|
|
563 |
{
|
|
564 |
TimeStampedMessageL(KAtsLoggerTagWarning(), aMsg);
|
|
565 |
}
|
|
566 |
else
|
|
567 |
{
|
|
568 |
CommentL(aMsg);
|
|
569 |
}
|
|
570 |
}
|
|
571 |
|
|
572 |
EXPORT_C void CAtsLogger::ErrorL(TRefByValue<const TDesC> aFmt,...)
|
|
573 |
{
|
|
574 |
VA_LIST list;
|
|
575 |
VA_START(list, aFmt);
|
|
576 |
TBuf<0x100> buf;
|
|
577 |
buf.AppendFormatList(aFmt, list, NULL);
|
|
578 |
ErrorL(buf);
|
|
579 |
}
|
|
580 |
|
|
581 |
EXPORT_C void CAtsLogger::ErrorL(const TDesC& aMsg)
|
|
582 |
{
|
|
583 |
if (iInTestCase)
|
|
584 |
{
|
|
585 |
TimeStampedMessageL(KAtsLoggerTagError(), aMsg);
|
|
586 |
}
|
|
587 |
else
|
|
588 |
{
|
|
589 |
CommentL(aMsg);
|
|
590 |
}
|
|
591 |
}
|
|
592 |
|
|
593 |
EXPORT_C void CAtsLogger::CommentL(TRefByValue<const TDesC> aFmt,...)
|
|
594 |
{
|
|
595 |
VA_LIST list;
|
|
596 |
VA_START(list, aFmt);
|
|
597 |
TBuf<0x100> buf;
|
|
598 |
buf.AppendFormatList(aFmt, list, NULL);
|
|
599 |
CommentL(buf);
|
|
600 |
}
|
|
601 |
|
|
602 |
EXPORT_C void CAtsLogger::CommentL(const TDesC& aMsg)
|
|
603 |
{
|
|
604 |
WriteL(KAtsLoggerCommentOpen());
|
|
605 |
WriteL(aMsg);
|
|
606 |
WriteL(KAtsLoggerCommentClose());
|
|
607 |
LineFeedL();
|
|
608 |
}
|
|
609 |
|
|
610 |
EXPORT_C TInt CAtsLogger::RawLogL(TRefByValue<const TDesC> aFmt,...)
|
|
611 |
{
|
|
612 |
VA_LIST list;
|
|
613 |
VA_START(list, aFmt);
|
|
614 |
TBuf<0x100> buf;
|
|
615 |
buf.AppendFormatList(aFmt, list, NULL);
|
|
616 |
RawLogL(buf);
|
|
617 |
return KErrNone;
|
|
618 |
}
|
|
619 |
|
|
620 |
EXPORT_C TInt CAtsLogger::RawLogL(const TDesC& aMsg)
|
|
621 |
{
|
|
622 |
if (iRawLog)
|
|
623 |
{
|
|
624 |
TBool lfStatus = iLineFeedDone;
|
|
625 |
iLineFeedDone = EFalse;
|
|
626 |
User::LeaveIfError(iRfs.Connect());
|
|
627 |
RFile file;
|
|
628 |
TInt err = file.Open(iRfs, iRawLogFileName, EFileWrite | EFileShareAny);
|
|
629 |
if (err == KErrNotFound)
|
|
630 |
{
|
|
631 |
User::LeaveIfError(file.Create(iRfs, iRawLogFileName, EFileWrite | EFileShareAny));
|
|
632 |
}
|
|
633 |
else
|
|
634 |
{
|
|
635 |
TInt pos = 0;
|
|
636 |
file.Seek(ESeekEnd, pos);
|
|
637 |
}
|
|
638 |
WriteL(aMsg, file);
|
|
639 |
file.Close();
|
|
640 |
iRfs.Close();
|
|
641 |
iLineFeedDone = lfStatus;
|
|
642 |
}
|
|
643 |
return KErrNone;
|
|
644 |
}
|
|
645 |
|
|
646 |
EXPORT_C void CAtsLogger::DebugOutput(const TDesC& aMsg)
|
|
647 |
{
|
|
648 |
RDebug::Print(_L("%S"), &aMsg);
|
|
649 |
}
|
|
650 |
|
|
651 |
EXPORT_C void CAtsLogger::SetFullReporting(TBool aFlag)
|
|
652 |
{
|
|
653 |
iFullReportingMode = aFlag;
|
|
654 |
}
|
|
655 |
|
|
656 |
EXPORT_C void CAtsLogger::SetDebugOutput(TBool aFlag)
|
|
657 |
{
|
|
658 |
iDoDebugOutput = aFlag;
|
|
659 |
}
|
|
660 |
|
|
661 |
EXPORT_C void CAtsLogger::SetIndentation(TBool aFlag)
|
|
662 |
{
|
|
663 |
iDoIndentation = aFlag;
|
|
664 |
}
|
|
665 |
|
|
666 |
HBufC* CAtsLogger::FormatDateLC(TDateTime aDate)
|
|
667 |
{
|
|
668 |
HBufC* buf = HBufC::NewL(19);
|
|
669 |
CleanupStack::PushL(buf);
|
|
670 |
TPtr ptr(buf->Des());
|
|
671 |
ptr.Format(_L("%d-%02d-%02d %02d:%02d:%02d"), aDate.Year(),
|
|
672 |
aDate.Month(),
|
|
673 |
aDate.Day(),
|
|
674 |
aDate.Hour(),
|
|
675 |
aDate.Minute(),
|
|
676 |
aDate.Second());
|
|
677 |
return buf;
|
|
678 |
}
|
|
679 |
|
|
680 |
HBufC* CAtsLogger::FormatTimeLC(TTimeIntervalMicroSeconds aTime)
|
|
681 |
{
|
|
682 |
//@js<--remove--> TInt seconds1 = (aTime.Int64() / TInt64(1000000)).GetTInt();
|
|
683 |
TInt seconds = (I64INT(aTime.Int64()) / I64INT(TInt64(1000000)));
|
|
684 |
|
|
685 |
TInt hours = seconds / (60*60);
|
|
686 |
TInt minutes = (seconds / 60) % 60;
|
|
687 |
seconds = (seconds) % 60;
|
|
688 |
HBufC* buf = HBufC::NewL(10);
|
|
689 |
CleanupStack::PushL(buf);
|
|
690 |
TPtr ptr(buf->Des());
|
|
691 |
ptr.Format(_L("%02d:%02d:%02d"), hours, minutes, seconds);
|
|
692 |
return buf;
|
|
693 |
}
|
|
694 |
|
|
695 |
|
|
696 |
void CAtsLogger::TimeStampedMessageL(const TDesC& aTag, const TDesC& aMsg)
|
|
697 |
{
|
|
698 |
TTime current;
|
|
699 |
current.HomeTime();
|
|
700 |
HBufC* time;
|
|
701 |
time = FormatTimeLC(current.MicroSecondsFrom(iTestSet.iStartTime));
|
|
702 |
TagL(aTag, aMsg, KAtsLoggerTimeStamp(), *time);
|
|
703 |
CleanupStack::PopAndDestroy(time);
|
|
704 |
}
|
|
705 |
|
|
706 |
void CAtsLogger::OpenTagL(const TDesC& aTag)
|
|
707 |
{
|
|
708 |
WriteL(KAtsLoggerTagOpen());
|
|
709 |
WriteL(aTag);
|
|
710 |
WriteL(KAtsLoggerTagPost());
|
|
711 |
}
|
|
712 |
|
|
713 |
void CAtsLogger::OpenTagL(const TDesC& aTag,
|
|
714 |
const TDesC& aAttribute,
|
|
715 |
const TDesC& aValue)
|
|
716 |
{
|
|
717 |
WriteL(KAtsLoggerTagOpen());
|
|
718 |
WriteL(aTag);
|
|
719 |
WriteL(KAtsLoggerSpace());
|
|
720 |
WriteL(aAttribute);
|
|
721 |
WriteL(KAtsLoggerAttr());
|
|
722 |
HBufC* encoded;
|
|
723 |
encoded = EncodeLC(aValue);
|
|
724 |
WriteL(encoded->Des());
|
|
725 |
CleanupStack::PopAndDestroy(encoded);
|
|
726 |
WriteL(KAtsLoggerAttrClose());
|
|
727 |
}
|
|
728 |
|
|
729 |
void CAtsLogger::OpenTagIndentL(const TDesC& aTag)
|
|
730 |
{
|
|
731 |
OpenTagL(aTag);
|
|
732 |
LineFeedL();
|
|
733 |
iIndentLevel++;
|
|
734 |
}
|
|
735 |
|
|
736 |
void CAtsLogger::OpenTagIndentL(const TDesC& aTag,
|
|
737 |
const TDesC& aAttribute,
|
|
738 |
const TDesC& aValue)
|
|
739 |
{
|
|
740 |
OpenTagL(aTag, aAttribute, aValue);
|
|
741 |
LineFeedL();
|
|
742 |
iIndentLevel++;
|
|
743 |
}
|
|
744 |
|
|
745 |
void CAtsLogger::CloseTagL(const TDesC& aTag)
|
|
746 |
{
|
|
747 |
WriteL(KAtsLoggerTagClose());
|
|
748 |
WriteL(aTag);
|
|
749 |
WriteL(KAtsLoggerTagPost());
|
|
750 |
}
|
|
751 |
|
|
752 |
void CAtsLogger::CloseTagIndentL(const TDesC& aTag)
|
|
753 |
{
|
|
754 |
iIndentLevel--;
|
|
755 |
CloseTagL(aTag);
|
|
756 |
LineFeedL();
|
|
757 |
}
|
|
758 |
|
|
759 |
void CAtsLogger::TagL(const TDesC& aTag, const TDesC& aMsg)
|
|
760 |
{
|
|
761 |
OpenTagL(aTag);
|
|
762 |
HBufC* encoded;
|
|
763 |
encoded = EncodeLC(aMsg);
|
|
764 |
WriteL(encoded->Des());
|
|
765 |
CleanupStack::PopAndDestroy(encoded);
|
|
766 |
CloseTagL(aTag);
|
|
767 |
LineFeedL();
|
|
768 |
}
|
|
769 |
|
|
770 |
void CAtsLogger::TagL(const TDesC& aTag,
|
|
771 |
const TDesC& aMsg,
|
|
772 |
const TDesC& aAttribute,
|
|
773 |
const TDesC& aValue)
|
|
774 |
{
|
|
775 |
OpenTagL(aTag, aAttribute, aValue);
|
|
776 |
HBufC* encoded;
|
|
777 |
encoded = EncodeLC(aMsg);
|
|
778 |
WriteL(encoded->Des());
|
|
779 |
CleanupStack::PopAndDestroy(encoded);
|
|
780 |
CloseTagL(aTag);
|
|
781 |
LineFeedL();
|
|
782 |
}
|
|
783 |
|
|
784 |
void CAtsLogger::LineFeedL()
|
|
785 |
{
|
|
786 |
WriteL(KAtsLoggerLf());
|
|
787 |
iLineFeedDone = ETrue;
|
|
788 |
}
|
|
789 |
|
|
790 |
HBufC* CAtsLogger::EncodeLC(const TDesC& aMsg)
|
|
791 |
{
|
|
792 |
TInt length = aMsg.Length();
|
|
793 |
HBufC* buf = HBufC::NewL(length);
|
|
794 |
*buf = aMsg;
|
|
795 |
TPtr ptr(buf->Des());
|
|
796 |
TInt index = 0;
|
|
797 |
TInt offset = 0;
|
|
798 |
while (index < length)
|
|
799 |
{
|
|
800 |
TPtrC16 p;
|
|
801 |
switch (ptr[index + offset])
|
|
802 |
{
|
|
803 |
case '"':
|
|
804 |
p.Set(KAtsLoggerQuot().Ptr());
|
|
805 |
break;
|
|
806 |
case '\'':
|
|
807 |
p.Set(KAtsLoggerApos().Ptr());
|
|
808 |
break;
|
|
809 |
case '<':
|
|
810 |
p.Set(KAtsLoggerLt().Ptr());
|
|
811 |
break;
|
|
812 |
case '>':
|
|
813 |
p.Set(KAtsLoggerGt().Ptr());
|
|
814 |
break;
|
|
815 |
case '&':
|
|
816 |
p.Set(KAtsLoggerAmp().Ptr());
|
|
817 |
break;
|
|
818 |
default:
|
|
819 |
p.Set(KAtsLoggerEmpty().Ptr());
|
|
820 |
break;
|
|
821 |
}
|
|
822 |
if (p.Length() > 0)
|
|
823 |
{
|
|
824 |
TInt len = ptr.Length() + p.Length();
|
|
825 |
HBufC* tmp = buf;
|
|
826 |
CleanupStack::PushL(tmp);
|
|
827 |
buf = buf->ReAllocL(len);
|
|
828 |
CleanupStack::Pop(tmp);
|
|
829 |
tmp = NULL;
|
|
830 |
ptr.Set(buf->Des());
|
|
831 |
ptr.Replace(index + offset, 1, p);
|
|
832 |
|
|
833 |
// offset has to be decrement by one because
|
|
834 |
// we have replaced a char and index remains the
|
|
835 |
// same.
|
|
836 |
offset += p.Length() - 1;
|
|
837 |
}
|
|
838 |
else
|
|
839 |
{
|
|
840 |
index++;
|
|
841 |
}
|
|
842 |
}
|
|
843 |
CleanupStack::PushL(buf);
|
|
844 |
return buf;
|
|
845 |
}
|
|
846 |
|
|
847 |
TInt CAtsLogger::BufferL(CBufBase* aBufBase, TInt& aLength, const TDesC& aBuf)
|
|
848 |
{
|
|
849 |
TInt length = aBuf.Length();
|
|
850 |
if (iDoIndentation && iLineFeedDone)
|
|
851 |
{
|
|
852 |
iLineFeedDone = EFalse;
|
|
853 |
TInt maxIndentLength = iIndentLevel * KAtsLoggerIndent8().Length();
|
|
854 |
TInt indentLength = KAtsLoggerIndent8().Length();
|
|
855 |
aBufBase->ExpandL(aLength, length + maxIndentLength);
|
|
856 |
for (TInt i = 0; i < iIndentLevel; i++)
|
|
857 |
{
|
|
858 |
aBufBase->Write(aLength + (i * indentLength), KAtsLoggerIndent8());
|
|
859 |
}
|
|
860 |
aLength += maxIndentLength;
|
|
861 |
}
|
|
862 |
else
|
|
863 |
{
|
|
864 |
aBufBase->ExpandL(aLength, length);
|
|
865 |
}
|
|
866 |
HBufC8* hBufC8;
|
|
867 |
hBufC8 = HBufC8::NewL(aBuf.Length());
|
|
868 |
CleanupStack::PushL(hBufC8);
|
|
869 |
TPtr8 ptr8(hBufC8->Des());
|
|
870 |
for (TInt i = 0; i < length; i++)
|
|
871 |
{
|
|
872 |
if (aBuf[i] != '\n' && aBuf[i] != '\r')
|
|
873 |
{
|
|
874 |
ptr8.Append((TInt8)(aBuf[i] & 0xff));
|
|
875 |
}
|
|
876 |
else
|
|
877 |
{
|
|
878 |
ptr8.Append((TInt8)('\n'));
|
|
879 |
}
|
|
880 |
}
|
|
881 |
aBufBase->Write(aLength, *hBufC8);
|
|
882 |
CleanupStack::PopAndDestroy(hBufC8);
|
|
883 |
aLength += length;
|
|
884 |
return KErrNone;
|
|
885 |
}
|
|
886 |
|
|
887 |
TInt CAtsLogger::WriteBufferToFileL(CBufBase* aCBufBase, const TDesC& aFileName)
|
|
888 |
{
|
|
889 |
User::LeaveIfError(iRfs.Connect());
|
|
890 |
RFile file;
|
|
891 |
TInt err = file.Open(iRfs, aFileName, EFileWrite | EFileShareAny);
|
|
892 |
if (err == KErrNotFound)
|
|
893 |
{
|
|
894 |
User::LeaveIfError(file.Create(iRfs, aFileName, EFileWrite | EFileShareAny));
|
|
895 |
}
|
|
896 |
else
|
|
897 |
{
|
|
898 |
TInt pos = 0;
|
|
899 |
file.Seek(ESeekEnd, pos);
|
|
900 |
}
|
|
901 |
TInt i = 0;
|
|
902 |
TPtrC8 ptr = aCBufBase->Ptr(i);
|
|
903 |
while (ptr.Length() > 0)
|
|
904 |
{
|
|
905 |
file.Write(ptr, ptr.Length());
|
|
906 |
i += ptr.Length();
|
|
907 |
ptr.Set(aCBufBase->Ptr(i));
|
|
908 |
}
|
|
909 |
file.Close();
|
|
910 |
iRfs.Close();
|
|
911 |
return KErrNone;
|
|
912 |
}
|
|
913 |
|
|
914 |
TInt CAtsLogger::WriteBufferToDebugPortL(CBufBase* aCBufBase)
|
|
915 |
{
|
|
916 |
TInt i = 0;
|
|
917 |
TPtrC8 ptr = aCBufBase->Ptr(i);
|
|
918 |
while (ptr.Length() > 0)
|
|
919 |
{
|
|
920 |
TBuf<KAtsLoggerBufferSegmentGranularity> debug;
|
|
921 |
for (TInt j = 0; j < ptr.Length(); j++)
|
|
922 |
{
|
|
923 |
debug.AppendFormat(_L("%c"), ptr[j]);
|
|
924 |
}
|
|
925 |
DebugOutput(debug);
|
|
926 |
i += ptr.Length();
|
|
927 |
ptr.Set(aCBufBase->Ptr(i));
|
|
928 |
}
|
|
929 |
return KErrNone;
|
|
930 |
}
|
|
931 |
|
|
932 |
void CAtsLogger::WriteL(const TDesC& aMsg)
|
|
933 |
{
|
|
934 |
if (iXmlLog || iDoDebugOutput)
|
|
935 |
{
|
|
936 |
BufferL(iXmlBuffer, iXmlBufferLength, aMsg);
|
|
937 |
iXmlBuffer->Compress();
|
|
938 |
}
|
|
939 |
}
|
|
940 |
|
|
941 |
void CAtsLogger::WriteL(const TDesC& aMsg, RFile& aFile)
|
|
942 |
{
|
|
943 |
if (iLineFeedDone)
|
|
944 |
{
|
|
945 |
iLineFeedDone = EFalse;
|
|
946 |
for (TInt i = 0; i < iIndentLevel; i++)
|
|
947 |
{
|
|
948 |
WriteL(KAtsLoggerIndent(), aFile);
|
|
949 |
}
|
|
950 |
}
|
|
951 |
HBufC8* hBufC8 = HBufC8::NewL(aMsg.Length());
|
|
952 |
CleanupStack::PushL(hBufC8);
|
|
953 |
TPtr8 ptr8(hBufC8->Des());
|
|
954 |
TInt length = aMsg.Length();
|
|
955 |
for (TInt i = 0; i < length; i++)
|
|
956 |
{
|
|
957 |
if (aMsg[i] != '\n' && aMsg[i] != '\r')
|
|
958 |
{
|
|
959 |
ptr8.Append((TInt8)(aMsg[i] & 0xff));
|
|
960 |
}
|
|
961 |
else
|
|
962 |
{
|
|
963 |
ptr8.Append((TInt8)('\n'));
|
|
964 |
}
|
|
965 |
}
|
|
966 |
TRequestStatus status;
|
|
967 |
aFile.Write(*hBufC8, length, status);
|
|
968 |
User::WaitForRequest(status);
|
|
969 |
CleanupStack::PopAndDestroy(hBufC8);
|
|
970 |
}
|
|
971 |
|
|
972 |
TBool CAtsLogger::IsTransitionLegal(const TReportStage& aNewStage)
|
|
973 |
{
|
|
974 |
switch (iReportStage)
|
|
975 |
{
|
|
976 |
case EUninitialized:
|
|
977 |
return (aNewStage == EUninitialized || aNewStage == EBeginTestReport);
|
|
978 |
case EBeginTestReport:
|
|
979 |
return (aNewStage == EBeginTestSet || aNewStage == EEndTestReport);
|
|
980 |
case EBeginTestSet:
|
|
981 |
return (aNewStage == EBeginTestCase || aNewStage == EEndTestSet);
|
|
982 |
case EBeginTestCase:
|
|
983 |
return (aNewStage == ESetTestCaseVerdict);
|
|
984 |
case ESetTestCaseVerdict:
|
|
985 |
return (aNewStage == EEndTestCase);
|
|
986 |
case EEndTestCase:
|
|
987 |
return (aNewStage == EEndTestSet || aNewStage == EBeginTestCase);
|
|
988 |
case EEndTestSet:
|
|
989 |
return (aNewStage == EEndTestReport || aNewStage == EBeginTestSet);
|
|
990 |
case EEndTestReport:
|
|
991 |
return (aNewStage == EFinished);
|
|
992 |
case EFinished:
|
|
993 |
default:
|
|
994 |
break;
|
|
995 |
}
|
|
996 |
return EFalse;
|
|
997 |
}
|
|
998 |
|
|
999 |
EXPORT_C const TPtrC CAtsLogger::ErrorMessage(const TInt& aError)
|
|
1000 |
{
|
|
1001 |
switch (aError)
|
|
1002 |
{
|
|
1003 |
case EUninitialized:
|
|
1004 |
return _L("Invalid report stage transition to EUninitialized");
|
|
1005 |
case EBeginTestReport:
|
|
1006 |
return _L("Invalid report stage transition to EBeginTestReport");
|
|
1007 |
case EBeginTestSet:
|
|
1008 |
return _L("Invalid report stage transition to EBeginTestSet");
|
|
1009 |
case EBeginTestCase:
|
|
1010 |
return _L("Invalid report stage transition to EBeginTestCase");
|
|
1011 |
case ESetTestCaseVerdict:
|
|
1012 |
return _L("Invalid report stage transition to ESetTestCaseVerdict");
|
|
1013 |
case EEndTestCase:
|
|
1014 |
return _L("Invalid report stage transition to EEndTestCase");
|
|
1015 |
case EEndTestSet:
|
|
1016 |
return _L("Invalid report stage transition to EEndTestSet");
|
|
1017 |
case EEndTestReport:
|
|
1018 |
return _L("Invalid report stage transition to EEndTestReport");
|
|
1019 |
case EFinished:
|
|
1020 |
return _L("Invalid report stage transition to EFinished");
|
|
1021 |
case KErrNone:
|
|
1022 |
return _L("KErrNone");
|
|
1023 |
case KErrNotFound:
|
|
1024 |
return _L("KErrNotFound");
|
|
1025 |
case KErrGeneral:
|
|
1026 |
return _L("KErrGeneral");
|
|
1027 |
case KErrCancel:
|
|
1028 |
return _L("KErrCancel");
|
|
1029 |
case KErrNoMemory:
|
|
1030 |
return _L("KErrNoMemory");
|
|
1031 |
case KErrNotSupported:
|
|
1032 |
return _L("KErrNotSupported");
|
|
1033 |
case KErrArgument:
|
|
1034 |
return _L("KErrArgument");
|
|
1035 |
case KErrTotalLossOfPrecision:
|
|
1036 |
return _L("KErrTotalLossOfPrecision");
|
|
1037 |
case KErrBadHandle:
|
|
1038 |
return _L("KErrBadHandle");
|
|
1039 |
case KErrOverflow:
|
|
1040 |
return _L("KErrOverflow");
|
|
1041 |
case KErrUnderflow:
|
|
1042 |
return _L("KErrUnderflow");
|
|
1043 |
case KErrAlreadyExists:
|
|
1044 |
return _L("KErrAlreadyExists");
|
|
1045 |
case KErrPathNotFound:
|
|
1046 |
return _L("KErrPathNotFound");
|
|
1047 |
case KErrDied:
|
|
1048 |
return _L("KErrDied");
|
|
1049 |
case KErrInUse:
|
|
1050 |
return _L("KErrInUse");
|
|
1051 |
case KErrServerTerminated:
|
|
1052 |
return _L("KErrServerTerminated");
|
|
1053 |
case KErrServerBusy:
|
|
1054 |
return _L("KErrServerBusy");
|
|
1055 |
case KErrCompletion:
|
|
1056 |
return _L("KErrCompletion");
|
|
1057 |
case KErrNotReady:
|
|
1058 |
return _L("KErrNotReady");
|
|
1059 |
case KErrUnknown:
|
|
1060 |
return _L("KErrUnknown");
|
|
1061 |
case KErrCorrupt:
|
|
1062 |
return _L("KErrCorrupt");
|
|
1063 |
case KErrAccessDenied:
|
|
1064 |
return _L("KErrAccessDenied");
|
|
1065 |
case KErrLocked:
|
|
1066 |
return _L("KErrLocked");
|
|
1067 |
case KErrWrite:
|
|
1068 |
return _L("KErrWrite");
|
|
1069 |
case KErrDisMounted:
|
|
1070 |
return _L("KErrDisMounted");
|
|
1071 |
case KErrEof:
|
|
1072 |
return _L("KErrEof");
|
|
1073 |
case KErrDiskFull:
|
|
1074 |
return _L("KErrDiskFull");
|
|
1075 |
case KErrBadDriver:
|
|
1076 |
return _L("KErrBadDriver");
|
|
1077 |
case KErrBadName:
|
|
1078 |
return _L("KErrBadName");
|
|
1079 |
case KErrCommsLineFail:
|
|
1080 |
return _L("KErrCommsLineFail");
|
|
1081 |
case KErrCommsFrame:
|
|
1082 |
return _L("KErrCommsFrame");
|
|
1083 |
case KErrCommsOverrun:
|
|
1084 |
return _L("KErrCommsOverrun");
|
|
1085 |
case KErrCommsParity:
|
|
1086 |
return _L("KErrCommsParity");
|
|
1087 |
case KErrTimedOut:
|
|
1088 |
return _L("KErrTimedOut");
|
|
1089 |
case KErrCouldNotConnect:
|
|
1090 |
return _L("KErrCouldNotConnect");
|
|
1091 |
case KErrCouldNotDisconnect:
|
|
1092 |
return _L("KErrCouldNotDisconnect");
|
|
1093 |
case KErrDisconnected:
|
|
1094 |
return _L("KErrDisconnected");
|
|
1095 |
case KErrBadLibraryEntryPoint:
|
|
1096 |
return _L("KErrBadLibraryEntryPoint");
|
|
1097 |
case KErrBadDescriptor:
|
|
1098 |
return _L("KErrBadDescriptor");
|
|
1099 |
case KErrAbort:
|
|
1100 |
return _L("KErrAbort");
|
|
1101 |
case KErrTooBig:
|
|
1102 |
return _L("KErrTooBig");
|
|
1103 |
case KErrDivideByZero:
|
|
1104 |
return _L("KErrDivideByZero");
|
|
1105 |
case KErrBadPower:
|
|
1106 |
return _L("KErrBadPower");
|
|
1107 |
case KErrDirFull:
|
|
1108 |
return _L("KErrDirFull");
|
|
1109 |
case KErrHardwareNotAvailable:
|
|
1110 |
return _L("KErrHardwareNotAvailable");
|
|
1111 |
default:
|
|
1112 |
return _L("Unknown error to ATS logger.");
|
|
1113 |
}
|
|
1114 |
}
|
|
1115 |
|
|
1116 |
|
|
1117 |
// End of File
|