author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 31 Aug 2010 16:34:26 +0300 | |
branch | RCL_3 |
changeset 43 | c1f20ce4abcf |
parent 0 | a41df078684a |
child 44 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// f32test\manager\t_romg.cpp |
|
15 |
// |
|
16 |
// |
|
17 |
||
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
18 |
#define __E32TEST_EXTENSION__ |
0 | 19 |
#include <f32file.h> |
20 |
#include <e32test.h> |
|
21 |
#include <e32rom.h> |
|
22 |
#include "..\server\t_server.h" |
|
23 |
||
24 |
const TInt KBufSize=0x10000; |
|
25 |
const TInt KFillerSize=0x100; |
|
26 |
const TInt KRomFileHeaderSize=0x100; |
|
27 |
const TInt KRomFileHeaderNameSize=0x10; |
|
28 |
||
29 |
class TRomFileHeaderBase |
|
30 |
{ |
|
31 |
public: |
|
32 |
TText8 iName[KRomFileHeaderNameSize]; |
|
33 |
TText8 iVersionStr[4]; |
|
34 |
TText8 iBuildNumStr[4]; |
|
35 |
TInt iRomSize; |
|
36 |
TInt iHeaderSize; |
|
37 |
}; |
|
38 |
||
39 |
class TRomFileHeader : public TRomFileHeaderBase |
|
40 |
{ |
|
41 |
public: |
|
42 |
TUint8 iFiller[KRomFileHeaderSize-sizeof(TRomFileHeaderBase)]; |
|
43 |
}; |
|
44 |
||
45 |
class CMemDir; |
|
46 |
class CMemEntry : public CBase |
|
47 |
{ |
|
48 |
public: |
|
49 |
static CMemEntry* New(const TEntry& anEntry); |
|
50 |
~CMemEntry(); |
|
51 |
TInt EntrySize(); |
|
52 |
void Write(); |
|
53 |
void WriteFile(); |
|
54 |
inline TBool IsDir() {return(iEntry.iAtt&KEntryAttDir);} |
|
55 |
inline CMemDir& Dir() {return(*iDir);} |
|
56 |
inline void SetDir(CMemDir& aDir) {iDir=(&aDir);} |
|
57 |
inline TInt Size() {return(iSize);} |
|
58 |
inline TLinAddr Base() {return(iBase);} |
|
59 |
inline void SetBase(); |
|
60 |
inline const TDesC& Name() {return(*iName);} |
|
61 |
inline static TInt LinkOffset() {return(_FOFF(CMemEntry,iLink));} |
|
62 |
protected: |
|
63 |
CMemEntry(const TEntry& anEntry); |
|
64 |
private: |
|
65 |
TLinAddr iBase; |
|
66 |
TInt iSize; |
|
67 |
TRomEntry iEntry; |
|
68 |
HBufC* iName; |
|
69 |
CMemDir* iDir; |
|
70 |
TDblQueLink iLink; |
|
71 |
}; |
|
72 |
||
73 |
class CMemDir : public CBase |
|
74 |
{ |
|
75 |
public: |
|
76 |
static CMemDir* NewL(); |
|
77 |
~CMemDir(); |
|
78 |
void LoadDirL(const TDesC& aPath); |
|
79 |
void SetBaseDirs(); |
|
80 |
void SetBaseFiles(); |
|
81 |
void WriteDirs(); |
|
82 |
void WriteFiles(); |
|
83 |
void Write(); |
|
84 |
TFileName Name(const TDesC& aName); |
|
85 |
inline TLinAddr Base() {return(iBase);} |
|
86 |
protected: |
|
87 |
CMemDir(); |
|
88 |
private: |
|
89 |
TInt iSize; |
|
90 |
TInt iCount; |
|
91 |
TLinAddr iBase; |
|
92 |
HBufC* iPath; |
|
93 |
TDblQue<CMemEntry> iEntryQ; |
|
94 |
}; |
|
95 |
||
96 |
class RFileX : public RFile |
|
97 |
{ |
|
98 |
public: |
|
99 |
RFileX() : RFile() {} |
|
100 |
TInt Write(const TDesC8& aDes); |
|
101 |
TInt Write(const TDesC8& aDes,TInt aLength); |
|
102 |
}; |
|
103 |
||
104 |
GLDEF_D RTest test(_L("T_ROMG")); |
|
105 |
LOCAL_D RFileX TheFile; |
|
106 |
LOCAL_D TRomHeader TheRomHeader; |
|
107 |
LOCAL_D TLinAddr TheCurrentBase; |
|
108 |
LOCAL_D CMemDir* TheRootDir; |
|
109 |
LOCAL_D TInt TheLevel; |
|
110 |
LOCAL_D TBuf8<KBufSize> TheBuf; |
|
111 |
LOCAL_D TBuf8<KFillerSize> TheFiller; |
|
112 |
#if defined(_UNICODE) |
|
113 |
LOCAL_D const TPtrC TheFileName=_L("ROMFILEU.BIN"); |
|
114 |
#else |
|
115 |
LOCAL_D const TPtrC TheFileName=_L("ROMFILE.BIN"); |
|
116 |
#endif |
|
117 |
||
118 |
TInt RFileX::Write(const TDesC8& aDes) |
|
119 |
// |
|
120 |
// Write and update the file pos |
|
121 |
// |
|
122 |
{ |
|
123 |
||
124 |
TheCurrentBase+=aDes.Size(); |
|
125 |
return(RFile::Write(aDes)); |
|
126 |
} |
|
127 |
||
128 |
TInt RFileX::Write(const TDesC8& aDes,TInt aLength) |
|
129 |
// |
|
130 |
// Write and update the file pos |
|
131 |
// |
|
132 |
{ |
|
133 |
||
134 |
TheCurrentBase+=aLength; |
|
135 |
return(RFile::Write(aDes,aLength)); |
|
136 |
} |
|
137 |
||
138 |
CMemEntry* CMemEntry::New(const TEntry& anEntry) |
|
139 |
// |
|
140 |
// Create a new entry. |
|
141 |
// |
|
142 |
{ |
|
143 |
||
144 |
CMemEntry* pE=new(ELeave) CMemEntry(anEntry); |
|
145 |
pE->iName=anEntry.iName.Alloc(); |
|
146 |
test(pE->iName!=NULL); |
|
147 |
return(pE); |
|
148 |
} |
|
149 |
||
150 |
#pragma warning( disable : 4705 ) // statement has no effect |
|
151 |
CMemEntry::CMemEntry(const TEntry& anEntry) |
|
152 |
// |
|
153 |
// Constructor. |
|
154 |
// |
|
155 |
{ |
|
156 |
||
157 |
iEntry.iAtt=(TUint8)(anEntry.iAtt|KEntryAttReadOnly); // All rom files are read only |
|
158 |
iEntry.iSize=anEntry.iSize; |
|
159 |
iEntry.iNameLength=(TUint8)anEntry.iName.Size(); |
|
160 |
iSize=Align4(anEntry.iSize); |
|
161 |
__DECLARE_NAME(_S("CMemEntry")); |
|
162 |
} |
|
163 |
#pragma warning( default : 4705 ) |
|
164 |
||
165 |
CMemEntry::~CMemEntry() |
|
166 |
// |
|
167 |
// Destruct. |
|
168 |
// |
|
169 |
{ |
|
170 |
||
171 |
if (iLink.iNext!=NULL) |
|
172 |
iLink.Deque(); |
|
173 |
delete iName; |
|
174 |
if (IsDir()) |
|
175 |
delete iDir; |
|
176 |
} |
|
177 |
||
178 |
void CMemEntry::SetBase() |
|
179 |
// |
|
180 |
// Set the entries base address. |
|
181 |
// |
|
182 |
{ |
|
183 |
||
184 |
iBase=TheCurrentBase; |
|
185 |
iEntry.iAddressLin=TheCurrentBase; |
|
186 |
} |
|
187 |
||
188 |
TInt CMemEntry::EntrySize() |
|
189 |
// |
|
190 |
// Calculate the entries size. |
|
191 |
// |
|
192 |
{ |
|
193 |
||
194 |
return(Align4(KRomEntrySize+iEntry.iNameLength)); |
|
195 |
} |
|
196 |
||
197 |
void CMemEntry::Write() |
|
198 |
// |
|
199 |
// Write the current entry. |
|
200 |
// |
|
201 |
{ |
|
202 |
||
203 |
test(TheFile.Write(TPtrC8((TUint8*)&iEntry,KRomEntrySize))==KErrNone); |
|
204 |
test(TheFile.Write(TPtrC8((TUint8*)iName->Ptr(),iName->Size()))==KErrNone); |
|
205 |
TInt rem=EntrySize()-iName->Size()-KRomEntrySize; |
|
206 |
if (rem) |
|
207 |
test(TheFile.Write(TheFiller,rem)==KErrNone); |
|
208 |
} |
|
209 |
||
210 |
void CMemEntry::WriteFile() |
|
211 |
// |
|
212 |
// Write the current entries file. |
|
213 |
// |
|
214 |
{ |
|
215 |
||
216 |
test(iBase==TheCurrentBase); |
|
217 |
TAutoClose<RFile> f; |
|
218 |
TFileName n=Dir().Name(*iName); |
|
219 |
test(f.iObj.Open(TheFs,n,EFileStream|EFileRead)==KErrNone); |
|
220 |
TInt size=0; |
|
221 |
do |
|
222 |
{ |
|
223 |
test(f.iObj.Read(TheBuf)==KErrNone); |
|
224 |
test(TheFile.Write(TheBuf)==KErrNone); |
|
225 |
size+=TheBuf.Length(); |
|
226 |
} while (TheBuf.Length()==TheBuf.MaxLength()); |
|
227 |
test(iEntry.iSize==size); |
|
228 |
TInt rem=iSize-size; |
|
229 |
if (rem) |
|
230 |
test(TheFile.Write(TheFiller,rem)==KErrNone); |
|
231 |
} |
|
232 |
||
233 |
CMemDir* CMemDir::NewL() |
|
234 |
// |
|
235 |
// Create a new directory. |
|
236 |
// |
|
237 |
{ |
|
238 |
||
239 |
return(new(ELeave) CMemDir); |
|
240 |
} |
|
241 |
||
242 |
CMemDir::CMemDir() |
|
243 |
// |
|
244 |
// Constructor. |
|
245 |
// |
|
246 |
: iEntryQ(CMemEntry::LinkOffset()) |
|
247 |
{ |
|
248 |
||
249 |
__DECLARE_NAME(_S("CMemDir")); |
|
250 |
} |
|
251 |
||
252 |
CMemDir::~CMemDir() |
|
253 |
// |
|
254 |
// Destruct. |
|
255 |
// |
|
256 |
{ |
|
257 |
||
258 |
while (!iEntryQ.IsEmpty()) |
|
259 |
{ |
|
260 |
CMemEntry* pE=iEntryQ.First(); |
|
261 |
delete pE; |
|
262 |
} |
|
263 |
delete iPath; |
|
264 |
} |
|
265 |
||
266 |
void CMemDir::SetBaseDirs() |
|
267 |
// |
|
268 |
// Set the base address of the directory and any sub-directories. |
|
269 |
// |
|
270 |
{ |
|
271 |
||
272 |
iBase=TheCurrentBase; |
|
273 |
iSize=sizeof(TInt); |
|
274 |
TDblQueIter<CMemEntry> q(iEntryQ); |
|
275 |
CMemEntry* pE; |
|
276 |
while ((pE=q++)!=NULL) |
|
277 |
{ |
|
278 |
iCount++; |
|
279 |
iSize+=pE->EntrySize(); |
|
280 |
} |
|
281 |
TheCurrentBase+=iSize; |
|
282 |
q.SetToFirst(); |
|
283 |
while ((pE=q++)!=NULL) |
|
284 |
{ |
|
285 |
if (pE->IsDir()) |
|
286 |
{ |
|
287 |
pE->SetBase(); |
|
288 |
pE->Dir().SetBaseDirs(); |
|
289 |
} |
|
290 |
} |
|
291 |
} |
|
292 |
||
293 |
void CMemDir::SetBaseFiles() |
|
294 |
// |
|
295 |
// Set the base address of each file. |
|
296 |
// |
|
297 |
{ |
|
298 |
||
299 |
TDblQueIter<CMemEntry> q(iEntryQ); |
|
300 |
CMemEntry* pE; |
|
301 |
while ((pE=q++)!=NULL) |
|
302 |
{ |
|
303 |
if (!pE->IsDir()) |
|
304 |
{ |
|
305 |
pE->SetBase(); |
|
306 |
TheCurrentBase+=pE->Size(); |
|
307 |
} |
|
308 |
} |
|
309 |
q.SetToFirst(); |
|
310 |
while ((pE=q++)!=NULL) |
|
311 |
{ |
|
312 |
if (pE->IsDir()) |
|
313 |
pE->Dir().SetBaseFiles(); |
|
314 |
} |
|
315 |
} |
|
316 |
||
317 |
void CMemDir::WriteDirs() |
|
318 |
// |
|
319 |
// Write the directory and any sub-directories. |
|
320 |
// |
|
321 |
{ |
|
322 |
||
323 |
TheLevel++; |
|
324 |
TFileName name=Name(_L("")); |
|
325 |
test.Printf(_L("%*p%S\n"),TheLevel<<1,&name); |
|
326 |
Write(); |
|
327 |
TDblQueIter<CMemEntry> q(iEntryQ); |
|
328 |
CMemEntry* pE; |
|
329 |
while ((pE=q++)!=NULL) |
|
330 |
{ |
|
331 |
if (pE->IsDir()) |
|
332 |
pE->Dir().WriteDirs(); |
|
333 |
} |
|
334 |
TheLevel--; |
|
335 |
} |
|
336 |
||
337 |
void CMemDir::WriteFiles() |
|
338 |
// |
|
339 |
// Set the base address of each file. |
|
340 |
// |
|
341 |
{ |
|
342 |
||
343 |
TheLevel++; |
|
344 |
TFileName name=Name(_L("")); |
|
345 |
test.Printf(_L("%*p%S\n"),TheLevel<<1,&name); |
|
346 |
TDblQueIter<CMemEntry> q(iEntryQ); |
|
347 |
CMemEntry* pE; |
|
348 |
while ((pE=q++)!=NULL) |
|
349 |
{ |
|
350 |
if (!pE->IsDir()) |
|
351 |
{ |
|
352 |
test.Printf(_L("%*p%S\n"),(TheLevel<<1)+2,&pE->Name()), |
|
353 |
pE->WriteFile(); |
|
354 |
} |
|
355 |
} |
|
356 |
q.SetToFirst(); |
|
357 |
while ((pE=q++)!=NULL) |
|
358 |
{ |
|
359 |
if (pE->IsDir()) |
|
360 |
pE->Dir().WriteFiles(); |
|
361 |
} |
|
362 |
TheLevel--; |
|
363 |
} |
|
364 |
||
365 |
void CMemDir::Write() |
|
366 |
// |
|
367 |
// Write the current directory. |
|
368 |
// |
|
369 |
{ |
|
370 |
||
371 |
test(iBase==TheCurrentBase); |
|
372 |
TInt size=iSize-sizeof(TInt); |
|
373 |
test(TheFile.Write(TPtrC8((TUint8*)&size,sizeof(TInt)))==KErrNone); |
|
374 |
TDblQueIter<CMemEntry> q(iEntryQ); |
|
375 |
CMemEntry* pE; |
|
376 |
while ((pE=q++)!=NULL) |
|
377 |
pE->Write(); |
|
378 |
TInt sz=(TheCurrentBase-iBase); |
|
379 |
test(sz==iSize); |
|
380 |
} |
|
381 |
||
382 |
TFileName CMemDir::Name(const TDesC& aName) |
|
383 |
// |
|
384 |
// Make a full path name from aName. |
|
385 |
// |
|
386 |
{ |
|
387 |
||
388 |
TFileName n(*iPath); |
|
389 |
n+=_L("\\"); |
|
390 |
n+=aName; |
|
391 |
return(n); |
|
392 |
} |
|
393 |
||
394 |
void CMemDir::LoadDirL(const TDesC& aPath) |
|
395 |
// |
|
396 |
// Load a directory. |
|
397 |
// |
|
398 |
{ |
|
399 |
||
400 |
TheLevel++; |
|
401 |
iPath=aPath.AllocL(); |
|
402 |
TFileName name=Name(_L("*.*")); |
|
403 |
test.Printf(_L("%*p%S\n"),TheLevel<<1,&name); |
|
404 |
CDir* pD; |
|
405 |
test(TheFs.GetDir(Name(_L("*.*")),KEntryAttMatchMask,EDirsFirst|ESortByName,pD)==KErrNone); |
|
406 |
TInt count=pD->Count(); |
|
407 |
TInt i=0; |
|
408 |
while (i<count) |
|
409 |
{ |
|
410 |
const TEntry& e=(*pD)[i++]; |
|
411 |
TParse parse; |
|
412 |
parse.Set(e.iName,NULL,NULL); |
|
413 |
if (!parse.Ext().CompareF(_L(".NCB"))) |
|
414 |
continue; // Ignore .ncb files - cannot open/read them. |
|
415 |
CMemEntry* pE=CMemEntry::New(e); |
|
416 |
iEntryQ.AddLast(*pE); |
|
417 |
} |
|
418 |
delete pD; |
|
419 |
TDblQueIter<CMemEntry> q(iEntryQ); |
|
420 |
CMemEntry* pE; |
|
421 |
while ((pE=q++)!=NULL) |
|
422 |
{ |
|
423 |
if (pE->IsDir()) |
|
424 |
{ |
|
425 |
CMemDir* pM=CMemDir::NewL(); |
|
426 |
pE->SetDir(*pM); |
|
427 |
pM->LoadDirL(Name(pE->Name())); |
|
428 |
} |
|
429 |
else |
|
430 |
pE->SetDir(*this); |
|
431 |
} |
|
432 |
TheLevel--; |
|
433 |
} |
|
434 |
||
435 |
LOCAL_C void buildRomImageL() |
|
436 |
// |
|
437 |
// Build the ROM image. |
|
438 |
// |
|
439 |
{ |
|
440 |
||
441 |
test.Start(_L("Parse command line")); |
|
442 |
HBufC* buf=HBufC::New(RProcess().CommandLineLength()); |
|
443 |
test(buf!=NULL); |
|
444 |
TPtr cmd = buf->Des(); |
|
445 |
RProcess().CommandLine(cmd); |
|
446 |
TLex lex(*buf); |
|
447 |
TFileName n=lex.NextToken(); |
|
448 |
if (n.Length()==0) |
|
449 |
n=_L("\\F32"); |
|
450 |
test(n.Length()!=0); |
|
451 |
if (n.Right(1)==_L("\\")) |
|
452 |
n.SetLength(n.Length()-1); |
|
453 |
// |
|
454 |
test.Next(_L("Create root mem dir")); |
|
455 |
TRAPD(r,TheRootDir=CMemDir::NewL()); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
456 |
test_KErrNone(r); |
0 | 457 |
// |
458 |
test.Next(_L("Load directory structure")); |
|
459 |
TheLevel=(-1); |
|
460 |
TRAP(r,TheRootDir->LoadDirL(n)); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
461 |
test_KErrNone(r); |
0 | 462 |
test(TheLevel==(-1)); |
463 |
// |
|
464 |
delete buf; |
|
465 |
test.End(); |
|
466 |
} |
|
467 |
||
468 |
LOCAL_C void baseRomImage() |
|
469 |
// |
|
470 |
// Set base addresses for the ROM image. |
|
471 |
// |
|
472 |
{ |
|
473 |
||
474 |
test.Start(_L("Setting up the header")); |
|
475 |
Mem::FillZ(&TheRomHeader,sizeof(TRomHeader)); |
|
476 |
test.Printf(_L("1")); |
|
477 |
TheRomHeader.iVersion=TVersion(1,0,1); |
|
478 |
test.Printf(_L("2")); |
|
479 |
TTime t; |
|
480 |
t.HomeTime(); |
|
481 |
test.Printf(_L("3")); |
|
482 |
TheRomHeader.iTime=t.Int64(); |
|
483 |
test.Printf(_L("4")); |
|
484 |
TheRomHeader.iRomBase=UserSvr::RomHeaderAddress(); |
|
485 |
test.Printf(_L("5")); |
|
486 |
TheRomHeader.iRomRootDirectoryList=TheCurrentBase=UserSvr::RomHeaderAddress()+sizeof(TRomHeader); |
|
487 |
test.Printf(_L("6")); |
|
488 |
// |
|
489 |
test.Next(_L("Set dirs base")); |
|
490 |
TheRootDir->SetBaseDirs(); |
|
491 |
// |
|
492 |
test.Next(_L("Set files base")); |
|
493 |
TheRootDir->SetBaseFiles(); |
|
494 |
TheRomHeader.iRomSize=TheCurrentBase-UserSvr::RomHeaderAddress(); |
|
495 |
// |
|
496 |
test.End(); |
|
497 |
} |
|
498 |
||
499 |
LOCAL_C void writeRomImage() |
|
500 |
// |
|
501 |
// Write the ROM image. |
|
502 |
// |
|
503 |
{ |
|
504 |
||
505 |
test.Start(_L("Write rom file header")); |
|
506 |
// |
|
507 |
TPckgBuf<TRomFileHeader> fileHeadB; |
|
508 |
fileHeadB.FillZ(fileHeadB.MaxLength()); |
|
509 |
TRomFileHeader& fileHead=fileHeadB(); |
|
510 |
Mem::Copy(&fileHead.iName[0],"EPOC468 ROM ",KRomFileHeaderNameSize); |
|
511 |
Mem::Copy(&fileHead.iVersionStr[0],"0.01",4); |
|
512 |
Mem::Copy(&fileHead.iBuildNumStr[0]," 1",4); |
|
513 |
fileHead.iRomSize=TheRomHeader.iRomSize; |
|
514 |
fileHead.iHeaderSize=KRomFileHeaderSize; |
|
515 |
test(TheFile.Write(fileHeadB)==KErrNone); |
|
516 |
// |
|
517 |
test.Next(_L("Write rom header")); |
|
518 |
TheFiller.FillZ(TheFiller.MaxLength()); |
|
519 |
TPckgC<TRomHeader> head(TheRomHeader); |
|
520 |
test(TheFile.Write(head)==KErrNone); |
|
521 |
TheCurrentBase=UserSvr::RomHeaderAddress()+sizeof(TheRomHeader); |
|
522 |
// |
|
523 |
test.Next(_L("Write directories")); |
|
524 |
TheLevel=(-1); |
|
525 |
TheRootDir->WriteDirs(); |
|
526 |
test(TheLevel==(-1)); |
|
527 |
// |
|
528 |
test.Next(_L("Write files")); |
|
529 |
TheLevel=(-1); |
|
530 |
TheRootDir->WriteFiles(); |
|
531 |
test(TheLevel==(-1)); |
|
532 |
// |
|
533 |
test.End(); |
|
534 |
} |
|
535 |
||
536 |
GLDEF_C void CallTestsL(void) |
|
537 |
// |
|
538 |
// Test the file server. |
|
539 |
// |
|
540 |
{ |
|
541 |
test.Title(); |
|
542 |
||
543 |
#if defined(__WINS__) |
|
544 |
test.Printf(_L("Running on WINS. Skipping ROM test")); |
|
545 |
return; |
|
546 |
#endif |
|
547 |
// |
|
548 |
test.Start(_L("Testing rom")); |
|
549 |
||
550 |
TInt r=TheFs.Delete(TheFileName); |
|
551 |
if (r==KErrAccessDenied) |
|
552 |
{ |
|
553 |
test.Printf(_L("Error: Cannot access %S"),&TheFileName); |
|
554 |
test.End(); |
|
555 |
return; |
|
556 |
} |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
557 |
test_Value(r, r == KErrNone || r==KErrNotFound); |
0 | 558 |
// |
559 |
test.Next(_L("Generating ROM image")); |
|
560 |
TRAP(r,buildRomImageL()); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
561 |
test_KErrNone(r); |
0 | 562 |
// |
563 |
test.Next(_L("Basing the rom image")); |
|
564 |
baseRomImage(); |
|
565 |
// |
|
566 |
TBuf<0x80> b=_L("Writing ROM file "); |
|
567 |
b+=TheFileName; |
|
568 |
test.Next(b); |
|
569 |
r=TheFile.Replace(TheFs,TheFileName,EFileStream|EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
570 |
test_KErrNone(r); |
0 | 571 |
writeRomImage(); |
572 |
TheFile.Close(); |
|
573 |
delete TheRootDir; |
|
574 |
||
575 |
test.End(); |
|
576 |
return; |
|
577 |
} |
|
578 |