appfw/apparchitecture/tef/T_OOMStep.cpp
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 // Copyright (c) 2005-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Performs the Out of Memory Tests.\n
       
    15 // 
       
    16 // t_oomstep.cpp
       
    17 //
       
    18 
       
    19 /**
       
    20  @file t_oomstep.cpp
       
    21  @internalComponent - Internal Symbian test code  
       
    22 */
       
    23 
       
    24 #include <f32file.h>
       
    25 #include <apaid.h>
       
    26 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    27 #include <apaidpartner.h>
       
    28 #include <apgicnflpartner.h>
       
    29 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
       
    30 #include <apgaplst.h>
       
    31 #include <apgicnfl.h>
       
    32 #include <apgdoor.h>
       
    33 #include "tstapp.h"
       
    34 #include <fbs.h>
       
    35 #include <s32std.h> 
       
    36 #include <s32stor.h> 
       
    37 #include <s32file.h> 
       
    38 #include <s32mem.h>
       
    39 #include "T_OOMStep.h"
       
    40 //
       
    41 #if !defined(__E32TEST_H__)
       
    42 #include <e32test.h>
       
    43 #endif
       
    44 
       
    45 
       
    46 void CT_OOMStep::setup()
       
    47 	{
       
    48 #if defined(__EPOC32__)
       
    49 	TFullName filePath=_L("c:\\docs\\tstapp.doc");
       
    50 	TFullName tempPath=_L("c:\\system\\temp\\");
       
    51 	// if we're on the rack create the directories we need
       
    52 	TParse parser;
       
    53 	parser.Set(filePath,NULL,NULL);
       
    54 	iFs.MkDirAll(parser.DriveAndPath());
       
    55 	parser.Set(tempPath,NULL,NULL);
       
    56 	iFs.MkDirAll(parser.DriveAndPath());
       
    57 #endif
       
    58 	}
       
    59 
       
    60 
       
    61 
       
    62 /**
       
    63   Auxiliary Fn for Test Case ID T-OOMStep-TestOOMConstructionL 
       
    64  
       
    65   This function adds a new document to the app DLL and associates a 
       
    66   temporary store. The document is then initialized with the default settings.
       
    67 */
       
    68 CApaDocument* CT_OOMStep::CreateTestDocL(CApaProcess* aProcess)
       
    69 	{
       
    70 
       
    71 	TFileName dllname=_L("tstapp.app");
       
    72 	TFullName filePath=_L("c:\\docs\\tstapp.doc");
       
    73 	// create a new main doc of type tstapp
       
    74 	CApaDocument* doc=NULL;
       
    75 	
       
    76 	TApaApplicationFactory appFact(KUidTestApp);
       
    77 	doc=aProcess->AddNewDocumentL(appFact);
       
    78 
       
    79 	aProcess->SetMainDocument(doc);
       
    80 	//
       
    81 	// create the store and initialise it
       
    82 	CFileStore* store = doc->CreateFileStoreLC(aProcess->FsSession(),filePath);
       
    83 	CleanupStack::Pop(); // store
       
    84 	((CTestAppDoc*)aProcess->MainDocument())->iStore = store;
       
    85 	aProcess->SetMainDocFileName(filePath);
       
    86 	//
       
    87 	// initialise the document with factory settings
       
    88 	doc->NewDocumentL();
       
    89 	//
       
    90 	return doc;
       
    91 	}
       
    92 
       
    93 
       
    94 /**
       
    95   Auxiliary Fn for Test Case ID T-OOMStep-TestOOMConstructionL 
       
    96  
       
    97   This function creates a test document for app DLL and saves
       
    98   the document.
       
    99   
       
   100 */
       
   101 void CT_OOMStep::CreateTestDocFileL()
       
   102 	{
       
   103 
       
   104 	TFullName filePath=_L("c:\\docs\\tstapp.doc");
       
   105 	// delete the file to be created by the testcode
       
   106 	iFs.Delete(filePath);
       
   107 	iFs.MkDir(_L("c:\\docs\\"));
       
   108 
       
   109 	// create an appfinder and process
       
   110 	CApaProcess* process = CApaProcess::NewL(iFs);
       
   111 	CApaDocument* doc = CreateTestDocL(process);
       
   112 
       
   113 	// save it 
       
   114 	doc->SaveL();
       
   115 
       
   116 	// tidy up
       
   117 	process->DestroyDocument(doc);
       
   118 	delete process;
       
   119 	}
       
   120 
       
   121 /**
       
   122    @SYMTestCaseID T-OOMStep-TestOOMConstructionL
       
   123   
       
   124    @SYMPREQ
       
   125   
       
   126    @SYMTestCaseDesc Test methods CApaScanningAppFinder::NewL, CApaProcess::NewL,
       
   127    CApaProcess::AddNewDocumentL, CApaProcess::OpenNewDocumentL and CApaDocument::SaveL
       
   128    when device goes Out of Memory.
       
   129    
       
   130    @SYMTestPriority High 
       
   131  
       
   132    @SYMTestStatus Implemented
       
   133    
       
   134    @SYMTestActions \n OOM Test for CApaScanningAppFinder::NewL:\n
       
   135    Use macro __UHEAP_SETFAIL() to simulate the out of memory
       
   136    situation. Call CApaScanningAppFinder::NewL() to allocate memory. Observe
       
   137    the leave that occurs. Observe after how many allocations the leave occurs.\n\n
       
   138    OOM Test for CApaProcess::NewL:\n
       
   139    Use macro __UHEAP_SETFAIL() to simulate the out of memory situation. Call
       
   140    CApaProcess::NewL() to allocate memory. Observe the leave that occurs.
       
   141    Observe after how many allocations the leave occurs.\n\n
       
   142    OOM Test for CApaProcess::AddNewDocumentL:\n
       
   143    Use macro __UHEAP_SETFAIL() to simulate the out of memory situation. Call
       
   144    CApaProcess::AddNewDocumentL() to allocate memory. Observe the leave that
       
   145    occurs. Observe after how many allocations the leave occurs.\n\n
       
   146    OOM Test for CApaProcess::OpenNewDocumentL:\n
       
   147    Use macro __UHEAP_SETFAIL() to simulate the out of memory situation. Call
       
   148    CApaProcess::OpenNewDocumentL() to allocate memory. Observe the leave that
       
   149    occurs. Observe after how many allocations the leave occurs.\n\n
       
   150    OOM Test for CApaDocument::SaveL:\n
       
   151    Create and initialize a document for tstapp. Use macro __UHEAP_SETFAIL()
       
   152    to simulate the out of memory situation. Call CApaDocument::SaveL() to
       
   153    allocate memory for the document to be saved. Observe the leave that occurs.
       
   154    Observe after how many allocations the leave occurs.\n\n
       
   155    API Calls:\n	
       
   156    CApaScanningAppFinder::NewL(const RFs& aFs)\n
       
   157    CApaProcess::NewL(const RFs& aFs,CApaAppFinder& aAppFinder)\n
       
   158    CApaProcess::AddNewDocumentL(const TDesC& aDllFileName,TUid aDllUid=KNullUid)\n
       
   159    CApaProcess::OpenNewDocumentL(CFileStore*& aStore,CStreamDictionary*& aStreamDic,const TDesC& aDocFullFileName,TUint aFileMode)\n
       
   160    CApaDocument::SaveL()\n
       
   161    
       
   162    @SYMTestExpectedResults Tests should complete without any memory leaks. It should
       
   163    also observe the no of allocations which occur before OOM situation.
       
   164     
       
   165  */
       
   166 void CT_OOMStep::TestOOMConstructionL()
       
   167 	{
       
   168 	TInt failRate=0;
       
   169 	TFullName filePath=_L("c:\\docs\\tstapp.doc");
       
   170 
       
   171 	__UHEAP_RESET;
       
   172 
       
   173 	// CApaProcess
       
   174 	INFO_PRINTF1(_L("CApaProcess construction under OOM"));
       
   175 	CApaProcess* process=NULL;
       
   176 	for (failRate=1;;failRate++)
       
   177 		{
       
   178 		__UHEAP_RESET;
       
   179 		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
       
   180 		__UHEAP_MARK;
       
   181 
       
   182 		TRAPD(ret, process = CApaProcess::NewL(iFs));
       
   183 		
       
   184 			TEST((ret==KErrNone || ret==KErrNoMemory));
       
   185 		if (ret!=KErrNone)
       
   186 			{
       
   187 			__UHEAP_MARKEND;
       
   188 			TEST(process==NULL);
       
   189 			}
       
   190 		else
       
   191 			{
       
   192 			TEST(process!=NULL);
       
   193 			delete process;
       
   194 			process = NULL;
       
   195 			REComSession::FinalClose();
       
   196 			__UHEAP_MARKEND;
       
   197 			break;
       
   198 			}
       
   199 		}
       
   200 	__UHEAP_RESET;
       
   201 	INFO_PRINTF2(_L("  #allocs for c'tion: %d\n"),failRate-1);
       
   202 	//
       
   203 	// creating CApaDocument
       
   204 	INFO_PRINTF1(_L("CApaDocument construction under OOM"));
       
   205 	CApaDocument* doc=NULL;
       
   206 	//
       
   207 	for (failRate=1;;failRate++)
       
   208 		{
       
   209 		__UHEAP_RESET;
       
   210 		process = CApaProcess::NewL(iFs);		
       
   211 			TEST(process!=NULL);
       
   212 		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
       
   213 		__UHEAP_MARK;
       
   214 		
       
   215 		TApaApplicationFactory appFact(KUidTestApp);
       
   216 		TRAPD(ret,doc=process->AddNewDocumentL(appFact));
       
   217 
       
   218 		TEST((ret==KErrNone || ret==KErrNoMemory));
       
   219 		if (ret!=KErrNone)
       
   220 			{
       
   221 			delete process;
       
   222 			REComSession::FinalClose();
       
   223 			__UHEAP_MARKEND;
       
   224 			TEST(doc==NULL);
       
   225 			}
       
   226 		else
       
   227 			{
       
   228 			TEST(doc!=NULL);
       
   229 			process->DestroyDocument(doc);
       
   230 			delete process;
       
   231 			REComSession::FinalClose();
       
   232 			__UHEAP_MARKEND;
       
   233 			break;
       
   234 			}
       
   235 		}
       
   236 	__UHEAP_RESET;
       
   237 	INFO_PRINTF2(_L("  #allocs for c'tion: %d\n"),failRate-1);
       
   238 	//
       
   239 	// opening a CApaDocument
       
   240 	INFO_PRINTF1(_L("CApaDocument Restoration under OOM"));
       
   241 	TRAPD(err,CreateTestDocFileL());
       
   242 		TEST(err==KErrNone);
       
   243 	//
       
   244 	for (failRate=1;;failRate++)
       
   245 		{
       
   246 		__UHEAP_RESET;
       
   247 		doc = NULL;
       
   248 		process = CApaProcess::NewL(iFs);		
       
   249 
       
   250 		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
       
   251 		__UHEAP_MARK;
       
   252 		CFileStore* store=NULL;
       
   253 		CStreamDictionary* streamDic=NULL;
       
   254 		TRAPD(ret, doc=process->OpenNewDocumentL(store,streamDic,filePath,EFileShareExclusive|EFileWrite));
       
   255 			TEST((ret==KErrNone || ret==KErrNoMemory));
       
   256 		if (ret!=KErrNone)
       
   257 			{
       
   258 			delete streamDic;
       
   259 			delete store;
       
   260 			delete process;
       
   261 			REComSession::FinalClose();
       
   262 			__UHEAP_MARKEND;
       
   263 			TEST(doc==NULL);
       
   264 			}
       
   265 		else
       
   266 			{
       
   267 			TEST(doc!=NULL);
       
   268 			TEST(streamDic!=NULL);
       
   269 			TEST(store!=NULL);
       
   270 			delete streamDic;
       
   271 			delete store;
       
   272 			process->DestroyDocument(doc);
       
   273 			delete process;
       
   274 			REComSession::FinalClose();
       
   275 			__UHEAP_MARKEND;
       
   276 			break;
       
   277 			}
       
   278 		}
       
   279 	__UHEAP_RESET;
       
   280 	INFO_PRINTF2(_L("  #allocs for c'tion: %d\n"),failRate-1);
       
   281 	//
       
   282 	// saving a CApaDocument
       
   283 	INFO_PRINTF1(_L("CApaDocument Storing under OOM"));
       
   284 	//
       
   285 	for (failRate=1;;failRate++)
       
   286 		{
       
   287 		__UHEAP_RESET;
       
   288 		// delete the file to be created by the testcode
       
   289 		iFs.Delete(filePath);
       
   290 		process = CApaProcess::NewL(iFs);		
       
   291 		doc = CreateTestDocL(process);
       
   292 		// attempt to save
       
   293 		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
       
   294 		__UHEAP_MARK;
       
   295 		TRAPD(ret, doc->SaveL());
       
   296 			TEST((ret==KErrNone || ret==KErrNoMemory));
       
   297 		if (ret!=KErrNone)
       
   298 			{
       
   299 			process->DestroyDocument(doc);
       
   300 			delete process;
       
   301 			REComSession::FinalClose();
       
   302 			__UHEAP_MARKEND;
       
   303 			}
       
   304 		else
       
   305 			{
       
   306 			process->DestroyDocument(doc);
       
   307 			delete process;
       
   308 			REComSession::FinalClose();
       
   309 			__UHEAP_MARKEND;
       
   310 			break;
       
   311 			}
       
   312 		}
       
   313 	__UHEAP_RESET;
       
   314 	INFO_PRINTF2(_L("  #allocs for c'tion: %d\n"),failRate-1);
       
   315 	//
       
   316 	}
       
   317 
       
   318 /**
       
   319    @SYMTestCaseID T-OOMStep-TestDoorOOML
       
   320   
       
   321    @SYMPREQ
       
   322   
       
   323    @SYMTestCaseDesc Test CApaDoor APIs NewL(), StoreL(), Restore() when device
       
   324    goes Out of Memory.
       
   325    
       
   326    @SYMTestPriority High 
       
   327   
       
   328    @SYMTestStatus Implemented
       
   329    
       
   330    @SYMTestActions The method simulates an OOM scenario to test CApaDoor APIs NewL(),
       
   331    StoreL() and Restore().\n\n
       
   332    To test CApaDoor::NewL(), the method creates a process and adds a new document
       
   333    to app DLL using AddNewDocumentL(). Using the macro __UHEAP_SETFAIL() OOM
       
   334    scenario is simulated. Call CApaDoor::NewL() to observe the leave returned.\n\n
       
   335    To test CApaDoor::StoreL(), the method creates a process and adds a new 
       
   336    document to app DLL using AddNewDocumentL(). It calls CApaDoor::NewL() to
       
   337    create a wrapper for the document. A temporary buffer store is created.
       
   338    Now Use macro __UHEAP_SETFAIL() to simulate the OOM scenario.
       
   339    Call CApaDoor::StoreL() to store the document in the specified store.
       
   340    Observe the leave returned.\n\n
       
   341    To test CApaDoor::Restore(), the method creates a process and adds a new
       
   342    document to app DLL using AddNewDocumentL(). It calls CApaDoor::NewL()
       
   343    to create a wrapper for the document. A temporary buffer store is created.
       
   344    Now Call CApaDoor::StoreL() to store the document in the specified store.
       
   345    Use macro __UHEAP_SETFAIL() to simulate the OOM scenario. Call
       
   346    CApaDoor::RestoreL() to restore the document from the specified store.
       
   347    Observe the leave returned.\n
       
   348    API Calls:\n	
       
   349    CApaDoor::NewL(RFs& aFs, CApaDocument& aDoc,const TSize& aDefaultIconSizeInTwips)\n
       
   350    CApaDoor::StoreL(CStreamStore& aStore) const\n
       
   351    CApaDoor::RestoreL(const CStreamStore& aStore,TStreamId aHeadStreamId)\n
       
   352    
       
   353    @SYMTestExpectedResults Tests should complete without any memory leaks.
       
   354     
       
   355  */
       
   356 void CT_OOMStep::TestDoorOOML()
       
   357 	{
       
   358 	CApaProcess* process=NULL;
       
   359 	CApaDocument* doc=NULL;
       
   360 	CApaDoor* door=NULL;
       
   361 	TInt failRate=0;
       
   362 	//
       
   363 	INFO_PRINTF1(_L("CApaDoor construction under OOM"));
       
   364 	//
       
   365 	__UHEAP_MARK;
       
   366 	//Create a session with F & B server
       
   367 	TInt ret=RFbsSession::Connect();
       
   368 		TEST(!ret);
       
   369 	
       
   370 	for (failRate=1;;failRate++)
       
   371 		{
       
   372 		__UHEAP_RESET;
       
   373 		door = NULL;
       
   374 		process = CApaProcess::NewL(iFs);
       
   375 		TApaApplicationFactory appFact(KUidTestApp);
       
   376 		doc=process->AddNewDocumentL(appFact);
       
   377 
       
   378 		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
       
   379 
       
   380 		door = NULL;
       
   381 		TRAPD(ret,door=CApaDoor::NewL(iFs,*doc,TSize(400,400)));
       
   382 			TEST((ret==KErrNone || ret==KErrNoMemory));
       
   383 		if (ret!=KErrNone)
       
   384 			{
       
   385 			delete process;
       
   386 			TEST(door==NULL);
       
   387 			}
       
   388 		else
       
   389 			{
       
   390 			TEST(door!=NULL);
       
   391 			delete door;
       
   392 
       
   393 			delete process;
       
   394 			break;
       
   395 			}
       
   396 		}
       
   397 	__UHEAP_RESET;
       
   398 	INFO_PRINTF2(_L("  #allocs for c'tion: %d\n"),failRate-1);
       
   399 	//
       
   400 	INFO_PRINTF1(_L("CApaDoor Store() under OOM"));
       
   401 	//
       
   402 	CBufStore* store=NULL;
       
   403 	for (failRate=1;;failRate++)
       
   404 		{
       
   405 		__UHEAP_RESET;
       
   406 		door = NULL;
       
   407 		process = CApaProcess::NewL(iFs);	
       
   408 		TApaApplicationFactory appFact(KUidTestApp);
       
   409 		doc=process->AddNewDocumentL(appFact);	
       
   410 		
       
   411 		door = CApaDoor::NewL(iFs,*doc,TSize(400,400)); // owns doc
       
   412 		store = CBufStore::NewL(10);
       
   413 		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
       
   414 
       
   415 		TStreamId id=KNullStreamId;
       
   416 		TRAPD(ret,id=door->StoreL(*store));
       
   417 			TEST((ret==KErrNone || ret==KErrNoMemory));
       
   418 		if (ret!=KErrNone)
       
   419 			{
       
   420 			TEST(id==KNullStreamId);
       
   421 			delete store;
       
   422 			delete door;
       
   423 
       
   424 			delete process;
       
   425 			}
       
   426 		else
       
   427 			{
       
   428 			TEST(id!=KNullStreamId);
       
   429 			delete store;
       
   430 
       
   431 			delete door;
       
   432 			delete process;
       
   433 			break;
       
   434 			}
       
   435 		}
       
   436 	__UHEAP_RESET;
       
   437 	INFO_PRINTF2(_L("  #allocs: %d\n"),failRate-1);
       
   438 	//
       
   439 	INFO_PRINTF1(_L("CApaDoor Restore() under OOM"));
       
   440 	//
       
   441 	for (failRate=1;;failRate++)
       
   442 		{
       
   443 		__UHEAP_RESET;
       
   444 		door = NULL;
       
   445 		process = CApaProcess::NewL(iFs);
       
   446 		TApaApplicationFactory appFact(KUidTestApp);
       
   447 		doc = process->AddNewDocumentL(appFact);
       
   448 		door = CApaDoor::NewL(iFs,*doc,TSize(400,400)); // owns doc
       
   449 		store = CBufStore::NewL(10);
       
   450 		TStreamId id = door->StoreL(*store);
       
   451 		__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
       
   452 
       
   453 		TRAPD(ret,door->RestoreL(*store,id));
       
   454 			TEST((ret==KErrNone || ret==KErrNoMemory));
       
   455 		if (ret!=KErrNone)
       
   456 			{
       
   457 			delete store;
       
   458 			delete door;
       
   459 
       
   460 			delete process;
       
   461 			}
       
   462 		else
       
   463 			{
       
   464 			delete store;
       
   465 			delete door;
       
   466 
       
   467 			delete process;
       
   468 			break;
       
   469 			}
       
   470 		}
       
   471 	__UHEAP_RESET;
       
   472 	INFO_PRINTF2(_L("  #allocs: %d\n"),failRate-1);
       
   473 	//
       
   474 	//Close the session F & B server.
       
   475 	RFbsSession::Disconnect();
       
   476 	REComSession::FinalClose();
       
   477 	__UHEAP_MARKEND;
       
   478 	}
       
   479 
       
   480 
       
   481 /**
       
   482   Auxiliary Fn for all Test Cases.
       
   483  
       
   484   This method creates and installs an active scheduler and puts the
       
   485   test code on the scheduler as a CIdle object. The method initiates
       
   486   all tests by calling the static method CT-OOMStepCallBack::CallBack().
       
   487  
       
   488 */
       
   489 void CT_OOMStep::DoTestsInCallBackL()
       
   490 	{
       
   491 	// create an active scheduler
       
   492 	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
       
   493 	CActiveScheduler::Install(scheduler);
       
   494 	CleanupStack::PushL(scheduler);
       
   495 
       
   496 	// put the test code onto the scheduler as an idle object
       
   497 	CIdle* idle=CIdle::NewL(-20);
       
   498 	CleanupStack::PushL(idle);
       
   499 
       
   500 	CT_OOMStepCallBack* callBack = new(ELeave) CT_OOMStepCallBack(this);
       
   501 	CleanupStack::PushL(callBack);
       
   502 
       
   503 	idle->Start(TCallBack(CT_OOMStepCallBack::CallBack,callBack));
       
   504 	// start the test code
       
   505 	CActiveScheduler::Start();
       
   506 
       
   507 	// all outstanding requests complete - kill the scheduler
       
   508 	CleanupStack::PopAndDestroy(3); //scheduler, callBack, idle
       
   509 	}
       
   510 
       
   511 
       
   512 
       
   513 CT_OOMStepCallBack::CT_OOMStepCallBack(CT_OOMStep* aTestStep)
       
   514 {
       
   515 	iTestStep = aTestStep;
       
   516 }
       
   517 
       
   518 
       
   519 CT_OOMStepCallBack::~CT_OOMStepCallBack()
       
   520 {
       
   521 
       
   522 }
       
   523 /**
       
   524   Auxiliary Fn for all Test Cases.
       
   525  
       
   526   The method initiates all tests to be performed.
       
   527  
       
   528 */
       
   529 void CT_OOMStep::DoStepTests()
       
   530 {
       
   531 	__UHEAP_MARK;
       
   532 	
       
   533 	INFO_PRINTF1(_L("About to test OOM resilience"));
       
   534 	TRAPD(r,TestOOMConstructionL());
       
   535 		TEST(r==KErrNone);
       
   536 	__UHEAP_MARKEND;
       
   537 	
       
   538  	__UHEAP_MARK;
       
   539 	INFO_PRINTF1(_L("About to test door OOM resilience"));
       
   540 	TRAP(r,TestDoorOOML());
       
   541 		TEST(r==KErrNone);
       
   542 	__UHEAP_MARKEND;
       
   543 }
       
   544 
       
   545 TInt CT_OOMStepCallBack::CallBack(TAny* callBack/*aThis*/)
       
   546 /**
       
   547   This static method is the callback function of CIdle object. The method
       
   548   calls the non-static method DoStepTests() which initiates all the tests. 
       
   549 */
       
   550 	{
       
   551 
       
   552 	//Do Tests.
       
   553 	((CT_OOMStepCallBack *)callBack)->iTestStep->DoStepTests();
       
   554 
       
   555 	CActiveScheduler::Stop();
       
   556 	return EFalse; // don't call back again
       
   557 	}
       
   558 
       
   559 
       
   560 
       
   561 
       
   562 CT_OOMStep::~CT_OOMStep()
       
   563 /**
       
   564    Destructor
       
   565  */
       
   566 	{
       
   567 	}
       
   568 
       
   569 CT_OOMStep::CT_OOMStep()
       
   570 /**
       
   571    Constructor
       
   572  */
       
   573 	{
       
   574 	// Call base class method to set up the human readable name for logging
       
   575 	SetTestStepName(KT_OOMStep);
       
   576 	}
       
   577 
       
   578 TVerdict CT_OOMStep::doTestStepPreambleL()
       
   579 /**
       
   580    @return - TVerdict code
       
   581    Override of base class virtual
       
   582  */
       
   583 	{
       
   584 	SetTestStepResult(EPass);
       
   585 	return TestStepResult();
       
   586 	}
       
   587 
       
   588 TVerdict CT_OOMStep::doTestStepPostambleL()
       
   589 /**
       
   590    @return - TVerdict code
       
   591    Override of base class virtual
       
   592  */
       
   593 	{
       
   594 	return TestStepResult();
       
   595 	}
       
   596 
       
   597 TVerdict CT_OOMStep::doTestStepL()
       
   598 /**
       
   599   @return - TVerdict code
       
   600   Override of base class virtual
       
   601 */
       
   602 {
       
   603 	INFO_PRINTF1(_L("Testing Apparch...OOM tests"));
       
   604 	//
       
   605 	// set up an fbs
       
   606 	FbsStartup();
       
   607 	//
       
   608 	// set up the directory structure
       
   609 	iFs.Connect();
       
   610 	setup();
       
   611 	//
       
   612 	// run the testcode
       
   613 
       
   614 	TRAPD(ret,DoTestsInCallBackL())
       
   615 		TEST(ret==KErrNone);
       
   616 	
       
   617 	iFs.Close();
       
   618 	return TestStepResult();
       
   619 }
       
   620