Update contrib.
1 // Copyright (c) 2003-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 "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
22 #include <barsread2.h>
23 #include <t_compressed_unicode_1.rsg>
24 #include <t_compressed_unicode_2.rsg>
26 RTest test(_L("T_RESOURCE_COMPRESSION2"));
27 RFs fileServerSession;
28 _LIT8(KRscFileHeaderData, "0123456789ABCDEF");
29 _LIT(KRomResourceFileHeader, "z:\\system\\data\\RscHeader.bin");
31 LOCAL_D const TPtrC rsc_files[] =
33 _L("T_COMPRESSED_UNICODE_1.RSC")
34 , _L("T_COMPRESSED_UNICODE_2.RSC")
35 , _L("T_DICTIONARY_COMPRESSED_VERSIO_OF_2.RSC")
36 , _L("T_CALYPSO_TEST_RESOURCE_FILE_1.RSC")
37 , _L("T_NotRscFile.RSC")
38 , _L("TRscROMCalypsoComprNewFmt.rsc")
40 _LIT(KZDir, "z:\\system\\data\\");
43 LOCAL_C void DeleteDataFile(const TDesC& aFullName)
45 // make sure the file is read/write
46 TInt err = fileServerSession.SetAtt(aFullName,0, KEntryAttReadOnly);
49 RDebug::Print(_L("error changing attributes file = %d"),err);
52 err = BaflUtils::DeleteFile(fileServerSession, aFullName);
55 RDebug::Print(_L("error deleting file = %d"),err);
59 LOCAL_C TInt FileSizeL(const TDesC& aFileName)
62 User::LeaveIfError(file.Open(fileServerSession, aFileName, EFileRead));
63 CleanupClosePushL(file);
65 User::LeaveIfError(file.Size(size));
66 CleanupStack::PopAndDestroy(&file);
70 LOCAL_C void CreateFileFromL(const TDesC& aDestFileName, const TDesC& aSrcFileName)
75 CleanupClosePushL(destFile);
76 CleanupClosePushL(srcFile);
78 BaflUtils::DeleteFile(fileServerSession, aDestFileName);
79 User::LeaveIfError(destFile.Create(fileServerSession, aDestFileName, EFileRead | EFileWrite));
81 User::LeaveIfError(srcFile.Open(fileServerSession, aSrcFileName, EFileRead));
83 User::LeaveIfError(srcFile.Size(size));
84 HBufC8* buf = HBufC8::NewMaxLC(size);
85 TPtr8 ptr = buf->Des();
88 destFile.Write(KRscFileHeaderData);
91 CleanupStack::PopAndDestroy(buf);
92 CleanupStack::PopAndDestroy(&srcFile);
93 CleanupStack::PopAndDestroy(&destFile);
96 LOCAL_C void CreateFileFromL(TDes& aDestFilePath, const TDesC& aDestFileName, const TDesC& aSrcFilePath)
98 aDestFilePath.Copy(KCDir);
99 aDestFilePath += _L("N_");
100 aDestFilePath += aDestFileName;
101 CreateFileFromL(aDestFilePath, aSrcFilePath);
104 LOCAL_C void Test1L(const TDesC& aResourceFileName, TUint aFileOffset = 0, TInt aFileSize = 0)
106 CResourceFile* resourceFile = CResourceFile::NewLC(fileServerSession, aResourceFileName, aFileOffset, aFileSize);
107 test(resourceFile->UidType()==TUidType(TUid::Uid(0x101f4a6b), TUid::Uid(0x000eb205), TUid::Uid(TUint(T_COMPRESSED_UNICODE_1_RESOURCE_1)>>12)));
108 HBufC8* resource = NULL;
109 RResourceReader resourceReader;
111 resource=resourceFile->AllocReadLC(1);
112 test(resource->Length()%sizeof(TText)==0);
113 test(TPtrC((TText*)resource->Ptr(), resource->Length()/sizeof(TText))==_L("Gruezi miteinander"));
114 CleanupStack::PopAndDestroy(resource);
117 resourceReader.OpenLC(resourceFile, 2);
118 test(resourceReader.ReadUint16L()==4);
119 test(resourceReader.ReadTPtrCL()==_L("Bonjour"));
120 test(resourceReader.ReadTPtrCL()==_L("Ni3 hao3"));
121 test(resourceReader.ReadTPtrCL()==_L("Konnichiwa"));
122 test(resourceReader.ReadTPtrCL()==_L("Zdravstvuit'e"));
123 CleanupStack::PopAndDestroy(1, &resourceReader);
126 resourceReader.OpenLC(resourceFile, 3);
127 test(resourceReader.ReadUint16L()==3);
128 test(resourceReader.ReadTPtrCL()==_L("Gamarjoba"));
129 test(resourceReader.ReadTPtrCL()==_L("Gasou"));
130 test(resourceReader.ReadTPtrCL()==_L("Ola"));
131 CleanupStack::PopAndDestroy(1, &resourceReader);
134 resourceReader.OpenLC(resourceFile, 4);
135 test(resourceReader.ReadUint16L()==3);
136 test(resourceReader.ReadUint8L()==0xbd);
137 test(resourceReader.ReadUint8L()==0x5e);
138 test(resourceReader.ReadUint8L()==0xf1);
139 CleanupStack::PopAndDestroy(1, &resourceReader);
142 resourceReader.OpenLC(resourceFile, 5);
143 test(resourceReader.ReadUint32L()==4);
144 test(resourceReader.ReadUint32L()==T_COMPRESSED_UNICODE_1_RESOURCE_5);
145 CleanupStack::PopAndDestroy(1, &resourceReader);
148 resource=resourceFile->AllocReadLC(6);
149 test(resource->Length()%sizeof(TText)==0);
150 test(TPtrC((TText*)resource->Ptr(), resource->Length()/sizeof(TText))==_L("_"));
151 CleanupStack::PopAndDestroy(resource);
154 resourceReader.OpenLC(resourceFile, 7);
155 test(resourceReader.ReadUint8L()==9);
156 test(resourceReader.ReadTPtrCL()==_L("To"));
157 test(resourceReader.ReadUint8L()==97);
158 CleanupStack::PopAndDestroy(1, &resourceReader);
161 resourceReader.OpenLC(resourceFile, 8);
162 test(resourceReader.ReadUint16L()==999);
163 test(resourceReader.ReadTPtrCL()==_L("To"));
164 test(resourceReader.ReadUint8L()==79);
165 CleanupStack::PopAndDestroy(1, &resourceReader);
168 resourceReader.OpenLC(resourceFile, 9);
169 test(resourceReader.ReadUint16L()==53132);
170 test(resourceReader.ReadTPtrCL()==_L("T"));
171 test(resourceReader.ReadUint8L()==62);
172 CleanupStack::PopAndDestroy(1, &resourceReader);
175 resourceReader.OpenLC(resourceFile, 10);
176 test(resourceReader.ReadInt32L()==1253869);
177 test(resourceReader.ReadInt32L()==-986324);
178 test(resourceReader.ReadUint32L()==0x600ddea1u);
179 CleanupStack::PopAndDestroy(1, &resourceReader);
182 CleanupStack::PopAndDestroy(resourceFile);
185 LOCAL_C void Test2L(const TDesC& aResourceFileName, TUid aFirstUid, TUint aFileOffset = 0, TInt aFileSize = 0)
187 CResourceFile* resourceFile = CResourceFile::NewLC(fileServerSession, aResourceFileName, aFileOffset, aFileSize);
188 test(resourceFile->UidType()==TUidType(aFirstUid, TUid::Null(), TUid::Uid(TUint(T_COMPRESSED_UNICODE_2_RESOURCE_1)>>12)));
189 HBufC8* resource = NULL;
190 RResourceReader resourceReader;
192 resourceReader.OpenLC(resourceFile, 1);
193 test(resourceReader.ReadUint32L()==4);
194 test(resourceReader.ReadUint32L()==T_COMPRESSED_UNICODE_2_RESOURCE_1);
195 CleanupStack::PopAndDestroy(1, &resourceReader);
198 resource=resourceFile->AllocReadLC(2);
199 test(resource->Length()%sizeof(TText)==0);
200 test(TPtrC((TText*)resource->Ptr(), resource->Length()/sizeof(TText))==_L("My program is cool"));
201 CleanupStack::PopAndDestroy(resource);
204 resource=resourceFile->AllocReadLC(3);
205 test(resource->Length()%sizeof(TText)==0);
206 test(TPtrC((TText*)resource->Ptr(), resource->Length()/sizeof(TText))==_L("z:\\system\\data\\eikon.mbm"));
207 CleanupStack::PopAndDestroy(resource);
210 resourceReader.OpenLC(resourceFile, 4);
211 test(resourceReader.ReadInt32L()==9174804);
212 test(resourceReader.ReadUint8L()==6);
213 test(resourceReader.ReadInt32L()==-6208493);
214 test(resourceReader.ReadUint16L()==0x3176);
215 CleanupStack::PopAndDestroy(1, &resourceReader);
218 resourceReader.OpenLC(resourceFile, 5);
219 test(resourceReader.ReadInt32L()==-120727);
220 test(resourceReader.ReadInt32L()==-82385253);
221 test(resourceReader.ReadUint16L()==0x3176);
222 CleanupStack::PopAndDestroy(1, &resourceReader);
225 resourceReader.OpenLC(resourceFile, 6);
226 test(resourceReader.ReadUint8L()==2);
227 test(resourceReader.ReadTPtrCL()==_L("z:\\system\\data\\uikon.mbm"));
228 test(resourceReader.ReadTPtrCL()==_L("z:\\system\\apps\\my_program\\my_program.mbm"));
229 CleanupStack::PopAndDestroy(1, &resourceReader);
232 CleanupStack::PopAndDestroy(resourceFile);
235 LOCAL_C void Test3L(const TDesC& aResourceFileName, TUint aFileOffset = 0, TInt aFileSize = 0)
237 /* This function tests the calypso resoruce file format loading/reading
238 * and was derived from the Test1 function above. Therefore the resource
239 * file it reads is also derived from the file used in test 1.
242 CResourceFile* resourceFile = CResourceFile::NewLC(fileServerSession, aResourceFileName, aFileOffset, aFileSize);
243 HBufC8* resource = NULL;
244 RResourceReader resourceReader;
246 resource=resourceFile->AllocReadLC(1);
247 test(resource->Length()%sizeof(TText)==0);
248 test(TPtrC((TText*)resource->Ptr(), resource->Length()/sizeof(TText))==_L("Gruezi miteinander"));
249 CleanupStack::PopAndDestroy(resource);
252 resourceReader.OpenLC(resourceFile, 2);
253 test(resourceReader.ReadUint16L()==4);
254 test(resourceReader.ReadTPtrCL()==_L("Bonjour"));
255 test(resourceReader.ReadTPtrCL()==_L("Ni3 hao3"));
256 test(resourceReader.ReadTPtrCL()==_L("Konnichiwa"));
257 test(resourceReader.ReadTPtrCL()==_L("Zdravstvuit'e"));
258 CleanupStack::PopAndDestroy(1, &resourceReader);
261 resourceReader.OpenLC(resourceFile, 3);
262 test(resourceReader.ReadUint16L()==3);
263 test(resourceReader.ReadTPtrCL()==_L("Gamarjoba"));
264 test(resourceReader.ReadTPtrCL()==_L("Gasou"));
265 test(resourceReader.ReadTPtrCL()==_L("Ola"));
266 CleanupStack::PopAndDestroy(1, &resourceReader);
269 resourceReader.OpenLC(resourceFile, 4);
270 test(resourceReader.ReadUint16L()==3);
271 test(resourceReader.ReadUint8L()==0xbd);
272 test(resourceReader.ReadUint8L()==0x5e);
273 test(resourceReader.ReadUint8L()==0xf1);
274 CleanupStack::PopAndDestroy(1, &resourceReader);
277 resourceReader.OpenLC(resourceFile, 5);
278 test(resourceReader.ReadUint32L()==4);
279 test(resourceReader.ReadUint32L()==T_COMPRESSED_UNICODE_1_RESOURCE_5);
280 CleanupStack::PopAndDestroy(1, &resourceReader);
283 resource=resourceFile->AllocReadLC(6);
284 test(resource->Length()%sizeof(TText)==0);
285 test(TPtrC((TText*)resource->Ptr(), resource->Length()/sizeof(TText))==_L("_"));
286 CleanupStack::PopAndDestroy(resource);
289 resourceReader.OpenLC(resourceFile, 7);
290 test(resourceReader.ReadUint8L()==9);
291 test(resourceReader.ReadTPtrCL()==_L("To"));
292 test(resourceReader.ReadUint8L()==97);
293 CleanupStack::PopAndDestroy(1, &resourceReader);
296 resourceReader.OpenLC(resourceFile, 8);
297 test(resourceReader.ReadUint16L()==999);
298 test(resourceReader.ReadTPtrCL()==_L("To"));
299 test(resourceReader.ReadUint8L()==79);
300 CleanupStack::PopAndDestroy(1, &resourceReader);
303 resourceReader.OpenLC(resourceFile, 9);
304 test(resourceReader.ReadUint16L()==53132);
305 test(resourceReader.ReadTPtrCL()==_L("T"));
306 test(resourceReader.ReadUint8L()==62);
307 CleanupStack::PopAndDestroy(1, &resourceReader);
310 resourceReader.OpenLC(resourceFile, 10);
311 test(resourceReader.ReadInt32L()==1253869);
312 test(resourceReader.ReadInt32L()==-986324);
313 test(resourceReader.ReadUint32L()==0x600ddea1u);
314 CleanupStack::PopAndDestroy(1, &resourceReader);
317 // reading resource 11 takes some time, as it is long
318 // and gets compressed.
319 // This is useful for the timing measurements in TestDef044572L()
320 resourceReader.OpenLC(resourceFile, 11);
321 CleanupStack::PopAndDestroy(1, &resourceReader);
324 CleanupStack::PopAndDestroy(resourceFile);
327 LOCAL_C void Test4L(const TDesC& aResourceFileName, TUint aFileOffset = 0, TInt aFileSize = 0)
329 /* This function tests the behaviour of bafl when reading a calypso resource file
330 * for a signature. Calypso resource files do not have signatures.
333 CResourceFile* resourceFile = CResourceFile::NewLC(fileServerSession, aResourceFileName, aFileOffset, aFileSize);
335 // Need to pass the TInt as required, but doesn't
336 // use it. Legacy for BC sake.
338 TRAP(err, resourceFile->ConfirmSignatureL(1));
339 test(err == KErrCorrupt);
341 // New function that has further test to confirm absence of signature
342 // Hopefully we can get clients to move over to this in future.
343 TRAP(err, resourceFile->ConfirmSignatureL());
344 test(err == KErrCorrupt);
346 CleanupStack::PopAndDestroy(resourceFile);
349 LOCAL_C void Test5L(const TDesC& aResourceFileName, TUint aFileOffset = 0, TInt aFileSize = 0)
351 /* This function tests the behaviour of bafl when reading a resource file
353 * In this case the signature is present and is NOT the first resource.
356 CResourceFile* resourceFile = CResourceFile::NewLC(fileServerSession, aResourceFileName, aFileOffset, aFileSize);
358 // Need to pass the TInt as required, but doesn't
359 // use it. Legacy for BC sake.
361 TRAP(err, resourceFile->ConfirmSignatureL(1));
362 test(err == KErrCorrupt);
364 // New function that has further test to confirm absence of signature
365 // Hopefully we can get clients to move over to this in future.
366 TRAP(err, resourceFile->ConfirmSignatureL());
367 test(err == KErrCorrupt);
369 CleanupStack::PopAndDestroy(resourceFile);
372 LOCAL_C void Test6L(const TDesC& aResourceFileName, TUint aFileOffset = 0, TInt aFileSize = 0)
374 /* This function tests the behaviour of bafl when reading a resource file
376 * In this case the signature is present and is the first resource.
379 CResourceFile* resourceFile = CResourceFile::NewLC(fileServerSession, aResourceFileName, aFileOffset, aFileSize);
381 // Need to pass the TInt as required, but doesn't
382 // use it. Legacy for BC sake.
384 TRAP(err, resourceFile->ConfirmSignatureL(1));
385 test(err == KErrNone);
387 // New function that has further test to confirm absence of signature
388 // Hopefully we can get clients to move over to this in future.
389 TRAP(err, resourceFile->ConfirmSignatureL());
390 test(err == KErrNone);
392 CleanupStack::PopAndDestroy(resourceFile);
395 LOCAL_C void Test7L(const TDesC& aResourceFileName, TUint aFileOffset = 0, TInt aFileSize = 0)
397 /* This function tests the behaviour of bafl when reading a non resource file.
399 TRAPD(err, (void)CResourceFile::NewL(fileServerSession, aResourceFileName, aFileOffset, aFileSize));
400 test(err != KErrNotFound && err != KErrNone);
404 @SYMTestCaseID SYSLIB-BAFL-CT-0480
405 @SYMTestCaseDesc Testing resource files containing Unicode-compressed text
406 @SYMTestPriority High
407 @SYMTestActions Wrapper function calling up Test1L() and Test2L() functions
408 @SYMTestExpectedResults Tests must not fail
411 LOCAL_C void SubTest1L()
413 test.Start(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0480 Testing resource files containing Unicode-compressed text "));
418 z_path += rsc_files[0];
420 CreateFileFromL(c_path, rsc_files[0], z_path);
421 Test1L(c_path, KRscFileHeaderData().Length(), FileSizeL(z_path));
422 DeleteDataFile(c_path);
425 z_path.Append(rsc_files[1]);
426 Test2L(z_path, TUid::Uid(0x101f4a6b));
427 CreateFileFromL(c_path, rsc_files[1], z_path);
428 Test2L(c_path, TUid::Uid(0x101f4a6b), KRscFileHeaderData().Length(), FileSizeL(z_path));
429 DeleteDataFile(c_path);
433 @SYMTestCaseID SYSLIB-BAFL-CT-0481
434 @SYMTestCaseDesc Testing dictionary-compressed resource files
435 @SYMTestPriority High
436 @SYMTestActions Wrapper function calling up Test2L() function
437 @SYMTestExpectedResults Tests must not fail
440 LOCAL_C void SubTest2L()
442 test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0481 Testing dictionary-compressed resource files "));
447 z_path.Append(rsc_files[2]);
448 Test2L(z_path, TUid::Uid(0x101f5010));
449 CreateFileFromL(c_path, rsc_files[2], z_path);
450 Test2L(c_path, TUid::Uid(0x101f5010), KRscFileHeaderData().Length(), FileSizeL(z_path));
451 DeleteDataFile(c_path);
455 @SYMTestCaseID SYSLIB-BAFL-CT-0482-0001
456 @SYMTestCaseDesc Testing Calypso ER5u format dictionary-compressed resource files
457 @SYMTestPriority High
458 @SYMTestActions Wrapper function calling up Test3L() function
459 @SYMTestExpectedResults Tests must not fail
462 LOCAL_C void SubTest3L()
464 test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0482-0001 Testing Calypso ER5u format dictionary-compressed resource files "));
469 z_path.Append(rsc_files[3]);
471 CreateFileFromL(c_path, rsc_files[3], z_path);
472 Test3L(c_path, KRscFileHeaderData().Length(), FileSizeL(z_path));
473 DeleteDataFile(c_path);
476 z_path.Append(rsc_files[5]);
477 Test3L(z_path, FileSizeL(KRomResourceFileHeader), FileSizeL(z_path) - FileSizeL(KRomResourceFileHeader));
481 @SYMTestCaseID SYSLIB-BAFL-CT-0483-0001
482 @SYMTestCaseDesc Testing resource file missing signature behaviour
483 @SYMTestPriority High
484 @SYMTestActions Wrapper function calling up Test4L() function
485 @SYMTestExpectedResults Tests must not fail
488 LOCAL_C void SubTest4L()
490 test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0483-0001 Testing resource file missing signature behaviour "));
495 z_path.Append(rsc_files[3]);
497 CreateFileFromL(c_path, rsc_files[3], z_path);
498 Test4L(c_path, KRscFileHeaderData().Length(), FileSizeL(z_path));
499 DeleteDataFile(c_path);
503 @SYMTestCaseID SYSLIB-BAFL-CT-0484-0001
504 @SYMTestCaseDesc Testing resource file signature present and not in order behaviour
505 @SYMTestPriority High
506 @SYMTestActions Wrapper function calling up Test5() function
507 @SYMTestExpectedResults Tests must not fail
510 LOCAL_C void SubTest5L()
512 test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0484-0001 Testing resource file signature present and not in order behaviour "));
517 z_path.Append(rsc_files[0]);
519 CreateFileFromL(c_path, rsc_files[0], z_path);
520 Test5L(c_path, KRscFileHeaderData().Length(), FileSizeL(z_path));
521 DeleteDataFile(c_path);
525 @SYMTestCaseID SYSLIB-BAFL-CT-0485-0001
526 @SYMTestCaseDesc Testing resource file signature present and in order behaviour
527 @SYMTestPriority High
528 @SYMTestActions Wrapper function calling up Test6L() function
529 @SYMTestExpectedResults Tests must not fail
532 LOCAL_C void SubTest6L()
534 test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0485-0001 Testing resource file signature present and in order behaviour "));
539 z_path.Append(rsc_files[1]);
541 CreateFileFromL(c_path, rsc_files[1], z_path);
542 Test6L(c_path, KRscFileHeaderData().Length(), FileSizeL(z_path));
543 DeleteDataFile(c_path);
547 @SYMTestCaseID SYSLIB-BAFL-CT-0486-0001
548 @SYMTestCaseDesc Testing invalid resource file
549 @SYMTestPriority High
550 @SYMTestActions Wrapper function calling up Test7L() function
551 @SYMTestExpectedResults Tests must not fail
554 LOCAL_C void SubTest7L()
556 test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0486-0001 Testing invalid resource file "));
561 z_path.Append(rsc_files[4]);
563 CreateFileFromL(c_path, rsc_files[4], z_path);
564 Test7L(c_path, KRscFileHeaderData().Length(), FileSizeL(z_path));
565 DeleteDataFile(c_path);
569 This test is for measuring the performance improvements from
570 compressed resource file dictionary cache (added DEF044572)
572 @SYMTestCaseID SYSLIB-BAFL-CT-0487-0001
573 @SYMTestCaseDesc Tests for defect number Def044572L
574 @SYMTestPriority High
575 @SYMTestActions Attempt for measuring the performance improvements from compressed resource file dictionary cache
576 @SYMTestExpectedResults Tests must not fail
579 LOCAL_C void TestDef044572L()
581 test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0487-0001 "));
582 // measure the time taken to run this test 10 times.
583 TTime startTime, stopTime;
584 startTime.UniversalTime();
586 // run the test 20 times to make the time easier to measure
587 for (TInt repeat=0;repeat<20;repeat++)
589 // SubTest3 which uses "Calypso ER5u format dictionary-compressed resource files"
593 // display the time taken
594 // for WINSCW this increase from 3.4 to 1.3 seconds when the
595 // compressed resource file dictionary cache was added DEF044572
596 stopTime.UniversalTime();
597 TTimeIntervalMicroSeconds timeTaken = stopTime.MicroSecondsFrom(startTime);
598 test.Printf(_L("Time taken for Subtest3:%d microseconds\n"), timeTaken.Int64() );
602 This test checks reading resource files for memory leaks,
603 when running Out Of Memory.(added as part of DEF044572)
605 @SYMTestCaseID SYSLIB-BAFL-CT-0488-0001
606 @SYMTestCaseDesc Out of memory tests
607 @SYMTestPriority High
608 @SYMTestActions Tests for memory leaks while reading resource files.
609 @SYMTestExpectedResults Tests must not fail
612 LOCAL_C void MemoryLeakTestL()
614 test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0488-0001 "));
615 TInt ret = KErrNoMemory;
619 // increasing the value of pass until the test completes with KErrNone
620 while (ret != KErrNone )
622 // check that the test is failing with KErrNoMemory
623 test(ret==KErrNoMemory);
625 __UHEAP_FAILNEXT(pass);
626 TRAP(ret, SubTest3L());
632 // disable the heap fail
639 LOCAL_C void DoE32MainL()
641 CleanupClosePushL(fileServerSession);
642 User::LeaveIfError(fileServerSession.Connect());
654 CleanupStack::PopAndDestroy(1, &fileServerSession);
657 GLDEF_C TInt E32Main()
660 CTrapCleanup* trapCleanup=CTrapCleanup::New();
661 TRAPD(error, DoE32MainL());
662 test(error == KErrNone);