sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_ssmsimstatusobserver.cpp
changeset 0 4e1aa6a622a0
child 21 ccb4f6b3db21
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2008-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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @test
       
    19  @internalComponent - Internal Symbian test code  
       
    20 */
       
    21 
       
    22 #include <etelmm.h>
       
    23 #include <centralrepository.h> 
       
    24 #include <ssm/ssmuiproviderdll.h>
       
    25 
       
    26 // Include the header file for the class under test
       
    27 #include "ssmsimstatusobserver.h"
       
    28 #include "cmdpublishsimownedandchanged.h"
       
    29 
       
    30 #include "ssmclayer.h"
       
    31 
       
    32 #include "ssmdebug.h"
       
    33 
       
    34 #include "tclayer_step_ssmsimstatusobserver.h"
       
    35 
       
    36 //Include the test wrappers/helpers
       
    37 #include "adaptationcliwrapper.h"
       
    38 #include "ssmcmnwrapper.h"
       
    39 #include "activestopper.h"
       
    40 
       
    41 /**
       
    42  * Constructs a complete CCLayerTestSsmSimStatusObserver object
       
    43  * @internalComponent
       
    44  */
       
    45 CCLayerTestSsmSimStatusObserver::CCLayerTestSsmSimStatusObserver()
       
    46     :iAsyncStopScheduler(NULL),
       
    47     iActiveScheduler(NULL)  
       
    48 	{
       
    49 	
       
    50 	}
       
    51 
       
    52 /**
       
    53  * Releases any resources associated with this test
       
    54  * @internalComponent
       
    55  */
       
    56 CCLayerTestSsmSimStatusObserver::~CCLayerTestSsmSimStatusObserver()
       
    57 	{
       
    58 	
       
    59 	}
       
    60 
       
    61 /**
       
    62  * Test step preamble
       
    63  * @internalComponent
       
    64  */
       
    65 TVerdict CCLayerTestSsmSimStatusObserver::doTestStepPreambleL()
       
    66 	{
       
    67     iActiveScheduler = new(ELeave) CActiveScheduler;
       
    68     CActiveScheduler::Install (iActiveScheduler);
       
    69 
       
    70     //Needed for calling callback for stopping active scheduler
       
    71     iAsyncStopScheduler = new(ELeave) CAsyncCallBack(CActive::EPriorityIdle);
       
    72 	return CTestStep::doTestStepPreambleL();
       
    73 	}
       
    74 /**
       
    75  * CallBackL
       
    76  * @internalComponent
       
    77  */
       
    78 static TInt CallBackL(TAny* aCCLayerTestSsmSimStatusObserver)
       
    79     {
       
    80     //Call back function to stop active scheduler
       
    81     CCLayerTestSsmSimStatusObserver* test = reinterpret_cast<CCLayerTestSsmSimStatusObserver*>(aCCLayerTestSsmSimStatusObserver);
       
    82     test->CallBackRunL();
       
    83     return KErrNone;
       
    84     }
       
    85 /**
       
    86  * 
       
    87  * CallBackRunL
       
    88  * @internalComponent
       
    89  */
       
    90 void CCLayerTestSsmSimStatusObserver::CallBackRunL()
       
    91     {
       
    92     //Stop the active scheduler if the request is completed else
       
    93     //callback once again
       
    94     if(iRequestStatus != KRequestPending)
       
    95         {
       
    96         CActiveScheduler::Stop();
       
    97         }
       
    98     else
       
    99         {
       
   100         iAsyncStopScheduler->CallBack();
       
   101         }
       
   102     }
       
   103 
       
   104 /**
       
   105  * Test step - a single test step performs a series of tests.
       
   106  * 
       
   107  * See the individual doTest... methods on this class for details of the tests.
       
   108  * 
       
   109  * @internalComponent
       
   110  */
       
   111 TVerdict CCLayerTestSsmSimStatusObserver::doTestStepL()
       
   112 	{
       
   113 	INFO_PRINTF1(_L("Entering test for compatibility layer SSM SIM status observer"));
       
   114 	
       
   115 	__UHEAP_MARK;
       
   116 	
       
   117 	TRAPD(err, doTestSimChangedAndOwnedL());
       
   118 	TEST(err == KErrNone);
       
   119 	
       
   120 	TRAP(err, doTestInitalizationAndDestructionL());
       
   121 	TEST(err == KErrNone);
       
   122 	
       
   123 	TRAP(err, doTestSimEventsL());
       
   124 	TEST(err == KErrNone);
       
   125 	
       
   126 	__UHEAP_MARKEND;
       
   127 	
       
   128 	INFO_PRINTF1(_L("Leaving test for compatibility layer SSM SIM status observer"));
       
   129 	return TestStepResult();
       
   130 	}
       
   131 
       
   132 /**
       
   133  * Test step postamble
       
   134  * @internalComponent
       
   135  */
       
   136 TVerdict CCLayerTestSsmSimStatusObserver::doTestStepPostambleL()
       
   137 	{
       
   138 	delete iActiveScheduler;
       
   139     delete iAsyncStopScheduler;
       
   140    	return CTestStep::doTestStepPostambleL();
       
   141 	}
       
   142 	
       
   143 /**
       
   144 Old Test CaseID 		AFSS-CLAYER-0023
       
   145 New Test CaseID 		DEVSRVS-SSREFPLUGINS-CLAYER-0023
       
   146  */	
       
   147 
       
   148 void CCLayerTestSsmSimStatusObserver::doTestInitalizationAndDestructionL()
       
   149 	{
       
   150 	INFO_PRINTF1(_L("Entering test for intialization and destruction of SSM SIM status observer"));
       
   151 	__UHEAP_MARK;
       
   152 
       
   153 	INFO_PRINTF1(_L("Testing constructor for SSM SIM status observer"));
       
   154 	
       
   155 	CSsmSimStatusObserver* simObserver = new (ELeave) CSsmSimStatusObserver();
       
   156 	CleanupStack::PushL(simObserver);
       
   157 	
       
   158 	// Now cleanup
       
   159 	simObserver->Release();
       
   160 	CleanupStack::Pop(simObserver);
       
   161 	simObserver = NULL;
       
   162 	
       
   163 	INFO_PRINTF1(_L("Testing exported NewL() for SSM SIM status observer"));
       
   164 	
       
   165 	MSsmUtility* ssmUtility = CSsmSimStatusObserver::NewL();
       
   166 	CleanupStack::PushL(ssmUtility);
       
   167 	
       
   168 	// Now cleanup
       
   169 	ssmUtility->Release();
       
   170 	CleanupStack::Pop(ssmUtility);
       
   171 	ssmUtility = NULL;
       
   172 	
       
   173 	__UHEAP_MARKEND;
       
   174 	INFO_PRINTF1(_L("Leaving test for intialization and destruction of SSM SIM status observer"));
       
   175 	}
       
   176 
       
   177 /**
       
   178 Old Test CaseID 		AFSS-CLAYER-0024
       
   179 New Test CaseID 		DEVSRVS-SSREFPLUGINS-CLAYER-0023
       
   180  */	
       
   181 
       
   182 void CCLayerTestSsmSimStatusObserver::doTestSimChangedAndOwnedL()
       
   183 	{
       
   184 	INFO_PRINTF1(_L("Entering test for change and owned parts of SSM SIM status observer/cmd"));
       
   185 	__UHEAP_MARK;
       
   186 	
       
   187 	// Delete any existing defines, ignore return value
       
   188 	(void) RProperty::Delete(CSsmUiSpecific::StartupPSUid(), KPSSimChanged);
       
   189 	(void) RProperty::Delete(CSsmUiSpecific::StartupPSUid(), KPSSimOwned);
       
   190 	TInt err = KErrNone;
       
   191 	
       
   192 	INFO_PRINTF1(_L("Constructing SSM SIM publish cmd"));	
       
   193 	CCustomCmdPublishSimOwnedAndChanged* simCustomCmd = CCustomCmdPublishSimOwnedAndChanged::NewL();
       
   194 	CleanupReleasePushL(*simCustomCmd);	
       
   195 	simCustomCmd->Initialize(NULL);
       
   196 	CleanupClosePushL(*simCustomCmd);
       
   197 	
       
   198 	INFO_PRINTF1(_L("Executing SSM SIM publish cmd without defining SIM properties"));
       
   199 	TBuf8<1> emptyBuf;
       
   200 	simCustomCmd->Execute(emptyBuf, iRequestStatus);
       
   201 	TEST(iRequestStatus == KRequestPending);
       
   202 
       
   203 	INFO_PRINTF1(_L("Adding callBack"));
       
   204 	TCallBack stop(CallBackL, this);
       
   205     iAsyncStopScheduler->Set(stop);
       
   206     
       
   207     iAsyncStopScheduler->CallBack();
       
   208 	INFO_PRINTF1(_L("Testing running active scheduler for publish startup mode without property defined"));
       
   209 	iActiveScheduler->Start();
       
   210 	User::WaitForRequest(iRequestStatus);
       
   211 	
       
   212 	TEST(iRequestStatus == KErrNotFound);
       
   213 	
       
   214 	INFO_PRINTF1(_L("Checking execute cancel does nothing"));
       
   215 	simCustomCmd->ExecuteCancel();
       
   216 	
       
   217 	INFO_PRINTF1(_L("Cleaning up SSM SIM publish cmd"));
       
   218 	
       
   219 	// Close simCustomCmd
       
   220 	CleanupStack::PopAndDestroy(simCustomCmd);
       
   221 	// Release simCustomCmd
       
   222 	CleanupStack::PopAndDestroy(simCustomCmd);
       
   223 	simCustomCmd = NULL;
       
   224 		
       
   225 	INFO_PRINTF1(_L("Constructing SSM SIM publish cmd"));	
       
   226 	simCustomCmd = CCustomCmdPublishSimOwnedAndChanged::NewL();
       
   227 	CleanupReleasePushL(*simCustomCmd);
       
   228 	simCustomCmd->Initialize(NULL);
       
   229 	CleanupClosePushL(*simCustomCmd);
       
   230 	
       
   231 	INFO_PRINTF1(_L("Initializing SSM SIM status observer without defining SIM changed property"));
       
   232 	err = RProperty::Define(CSsmUiSpecific::StartupPSUid(), KPSSimOwned, RProperty::EInt);
       
   233 	TEST(err == KErrNone);
       
   234 	simCustomCmd->Execute(emptyBuf, iRequestStatus);
       
   235 	
       
   236 	INFO_PRINTF1(_L("Adding callback"));
       
   237 	iAsyncStopScheduler->CallBack();
       
   238 	INFO_PRINTF1(_L("Testing running active scheduler for publish startup mode without defining SIM changed property"));
       
   239 	iActiveScheduler->Start();
       
   240 	User::WaitForRequest(iRequestStatus);
       
   241 	TEST(iRequestStatus == KErrNotFound);
       
   242 	
       
   243 	INFO_PRINTF1(_L("Cleaning up SSM SIM publish cmd"));
       
   244 	
       
   245 	// Close simCustomCmd
       
   246 	CleanupStack::PopAndDestroy(simCustomCmd);
       
   247 	// Release simCustomCmd
       
   248 	CleanupStack::PopAndDestroy(simCustomCmd);
       
   249 	simCustomCmd = NULL;
       
   250 
       
   251 	INFO_PRINTF1(_L("Constructing SSM SIM publish cmd"));	
       
   252 	simCustomCmd = CCustomCmdPublishSimOwnedAndChanged::NewL();
       
   253 	CleanupReleasePushL(*simCustomCmd);
       
   254 	simCustomCmd->Initialize(NULL);
       
   255 	CleanupClosePushL(*simCustomCmd);
       
   256 	
       
   257 	INFO_PRINTF1(_L("Initializing SSM SIM status observer with defined SIM properties, both false"));
       
   258 	AdaptationCliWrapper::SetSimOwned(EFalse);
       
   259 	AdaptationCliWrapper::SetSimChanged(EFalse);
       
   260 	err = RProperty::Define(CSsmUiSpecific::StartupPSUid(), KPSSimChanged, RProperty::EInt);
       
   261 	TEST(err == KErrNone);
       
   262 	simCustomCmd->Execute(emptyBuf, iRequestStatus);
       
   263 	
       
   264 	INFO_PRINTF1(_L("callback"));
       
   265     iAsyncStopScheduler->CallBack();
       
   266 	INFO_PRINTF1(_L("Testing running active scheduler for publish startup mode with defined SIM properties, both false"));
       
   267 	iActiveScheduler->Start();	
       
   268 	User::WaitForRequest(iRequestStatus);
       
   269 	
       
   270 	
       
   271 	TEST(iRequestStatus == KErrPermissionDenied);
       
   272 	TInt simChangedValue = 0;
       
   273 	TInt simOwnedValue = 0;
       
   274 	err = RProperty::Get(CSsmUiSpecific::StartupPSUid(), KPSSimChanged, simChangedValue);
       
   275 	TEST(err == KErrNone);
       
   276 	TEST(simChangedValue == ESimChanged);
       
   277 	err = RProperty::Get(CSsmUiSpecific::StartupPSUid(), KPSSimOwned, simOwnedValue);
       
   278 	TEST(err == KErrNone);
       
   279 	TEST(simOwnedValue == ESimNotOwned);
       
   280 	
       
   281 	INFO_PRINTF1(_L("Cleaning up SSM SIM publish cmd"));
       
   282 	// Close simCustomCmd
       
   283 	CleanupStack::PopAndDestroy(simCustomCmd);
       
   284 	// Release simCustomCmd
       
   285 	CleanupStack::PopAndDestroy(simCustomCmd);
       
   286 	simCustomCmd = NULL;
       
   287 
       
   288 	INFO_PRINTF1(_L("Constructing SSM SIM publish cmd"));	
       
   289 	simCustomCmd = CCustomCmdPublishSimOwnedAndChanged::NewL();
       
   290 	CleanupReleasePushL(*simCustomCmd);
       
   291 	simCustomCmd->Initialize(NULL);
       
   292 	CleanupClosePushL(*simCustomCmd);
       
   293 	
       
   294 	INFO_PRINTF1(_L("Initializing SSM SIM status observer with get owned failure"));
       
   295 	AdaptationCliWrapper::SetSimOwned(ETrue);
       
   296 	AdaptationCliWrapper::SetSimOwnedReturnValue(KErrNotSupported);
       
   297 	simCustomCmd->Execute(emptyBuf, iRequestStatus);
       
   298 	
       
   299 	INFO_PRINTF1(_L("callback"));
       
   300     iAsyncStopScheduler->CallBack();
       
   301 	INFO_PRINTF1(_L("Testing running active scheduler for publish startup mode with get owned failure"));
       
   302 	iActiveScheduler->Start();	
       
   303 	User::WaitForRequest(iRequestStatus);
       
   304 	
       
   305 	TEST(iRequestStatus == KErrPermissionDenied);
       
   306 	err = RProperty::Get(CSsmUiSpecific::StartupPSUid(), KPSSimChanged, simChangedValue);
       
   307 	TEST(err == KErrNone);
       
   308 	TEST(simChangedValue == ESimChanged);
       
   309 	err = RProperty::Get(CSsmUiSpecific::StartupPSUid(), KPSSimOwned, simOwnedValue);
       
   310 	TEST(err == KErrNone);
       
   311 	TEST(simOwnedValue == ESimNotOwned);
       
   312 	AdaptationCliWrapper::SetSimOwnedReturnValue(KErrNone);
       
   313 	AdaptationCliWrapper::SetSimOwned(EFalse);
       
   314 	
       
   315 	INFO_PRINTF1(_L("Cleaning up SSM SIM publish cmd"));
       
   316 	// Close simCustomCmd
       
   317 	CleanupStack::PopAndDestroy(simCustomCmd);
       
   318 	// Release simCustomCmd
       
   319 	CleanupStack::PopAndDestroy(simCustomCmd);
       
   320 	simCustomCmd = NULL;
       
   321 
       
   322 	INFO_PRINTF1(_L("Constructing SSM SIM publish cmd"));	
       
   323 	simCustomCmd = CCustomCmdPublishSimOwnedAndChanged::NewL();
       
   324 	CleanupReleasePushL(*simCustomCmd);
       
   325 	simCustomCmd->Initialize(NULL);
       
   326 	CleanupClosePushL(*simCustomCmd);
       
   327 	
       
   328 	INFO_PRINTF1(_L("Initializing SSM SIM status observer with get changed failure"));
       
   329 	AdaptationCliWrapper::SetSimChangedReturnValue(KErrNotSupported);
       
   330 	simCustomCmd->Execute(emptyBuf, iRequestStatus);
       
   331 	
       
   332 	INFO_PRINTF1(_L("callback"));
       
   333     iAsyncStopScheduler->CallBack();
       
   334 	INFO_PRINTF1(_L("Testing running active scheduler for publish startup mode SIM status observer with get changed failure"));
       
   335 	iActiveScheduler->Start();	
       
   336 	User::WaitForRequest(iRequestStatus);
       
   337 	
       
   338 	TEST(iRequestStatus == KErrPermissionDenied);
       
   339 	err = RProperty::Get(CSsmUiSpecific::StartupPSUid(), KPSSimChanged, simChangedValue);
       
   340 	TEST(err == KErrNone);
       
   341 	TEST(simChangedValue == ESimChanged);
       
   342 	err = RProperty::Get(CSsmUiSpecific::StartupPSUid(), KPSSimOwned, simOwnedValue);
       
   343 	TEST(err == KErrNone);
       
   344 	TEST(simOwnedValue == ESimNotOwned);
       
   345 	AdaptationCliWrapper::SetSimChangedReturnValue(KErrNone);
       
   346 	
       
   347 	INFO_PRINTF1(_L("Cleaning up SSM SIM publish cmd"));
       
   348 	// Close simCustomCmd
       
   349 	CleanupStack::PopAndDestroy(simCustomCmd);
       
   350 	// Release simCustomCmd
       
   351 	CleanupStack::PopAndDestroy(simCustomCmd);
       
   352 	simCustomCmd = NULL;
       
   353 
       
   354 	INFO_PRINTF1(_L("Constructing SSM SIM publish cmd"));	
       
   355 	simCustomCmd = CCustomCmdPublishSimOwnedAndChanged::NewL();
       
   356 	CleanupReleasePushL(*simCustomCmd);
       
   357 	simCustomCmd->Initialize(NULL);
       
   358 	CleanupClosePushL(*simCustomCmd);
       
   359 	
       
   360 	INFO_PRINTF1(_L("Initializing SSM SIM status observer with defined SIM properties, both true"));
       
   361 	AdaptationCliWrapper::SetSimOwned(ETrue);
       
   362 	AdaptationCliWrapper::SetSimChanged(ETrue);
       
   363 	simCustomCmd->Execute(emptyBuf, iRequestStatus);
       
   364 	
       
   365 	INFO_PRINTF1(_L("callback"));
       
   366 	iAsyncStopScheduler->CallBack();
       
   367 	INFO_PRINTF1(_L("Testing running active scheduler for publish startup mode with defined SIM properties, both true"));
       
   368 	iActiveScheduler->Start();	
       
   369 	User::WaitForRequest(iRequestStatus);	
       
   370 		
       
   371 	TEST(iRequestStatus == KErrPermissionDenied);
       
   372 	err = RProperty::Get(CSsmUiSpecific::StartupPSUid(), KPSSimChanged, simChangedValue);
       
   373 	TEST(err == KErrNone);
       
   374 	TEST(simChangedValue == ESimChanged);
       
   375 	err = RProperty::Get(CSsmUiSpecific::StartupPSUid(), KPSSimOwned, simOwnedValue);
       
   376 	TEST(err == KErrNone);
       
   377 	TEST(simOwnedValue == ESimOwned);
       
   378 	
       
   379 	INFO_PRINTF1(_L("Cleaning up SSM SIM publish cmd"));
       
   380 	// Close simCustomCmd
       
   381 	CleanupStack::PopAndDestroy(simCustomCmd);
       
   382 	// Release simCustomCmd
       
   383 	CleanupStack::PopAndDestroy(simCustomCmd);
       
   384 	simCustomCmd = NULL;
       
   385 		
       
   386 	__UHEAP_MARKEND;
       
   387 	INFO_PRINTF1(_L("Leaving test for change and owned parts of SSM SIM status observer/cmd"));
       
   388 	}
       
   389 
       
   390 /**
       
   391 Old Test CaseID 		AFSS-CLAYER-0025
       
   392 New Test CaseID 		DEVSRVS-SSREFPLUGINS-CLAYER-0023
       
   393  */	
       
   394 
       
   395 void CCLayerTestSsmSimStatusObserver::doTestSimEventsL()
       
   396 	{
       
   397 	INFO_PRINTF1(_L("Entering test for SIM events parts of SSM SIM status observer"));
       
   398 	__UHEAP_MARK;
       
   399 		
       
   400 	INFO_PRINTF1(_L("Constructing SSM SIM status observer"));	
       
   401 	CSsmSimStatusObserver* simObserver = new (ELeave) CSsmSimStatusObserver();
       
   402 	CleanupStack::PushL(simObserver);
       
   403 	
       
   404 	INFO_PRINTF1(_L("Initializing SSM SIM status observer with defined SIM properties, both true"));
       
   405 	TRAPD(err, simObserver->InitializeL());
       
   406 	TEST(err == KErrNone);
       
   407 	
       
   408 	INFO_PRINTF1(_L("Adding active stopper"));
       
   409 	CActiveStopper* stopper = new (ELeave) CActiveStopper();
       
   410 	CleanupStack::PushL(stopper);
       
   411 	    
       
   412 	INFO_PRINTF1(_L("Starting SSM SIM status observer"));
       
   413 	simObserver->StartL();
       
   414 	
       
   415 	TPckgBuf<TSsmSimEventType> simEventPckg;
       
   416 	INFO_PRINTF1(_L("Testing with event ESsmSimUsable"));
       
   417 	simEventPckg() = ESsmSimUsable;
       
   418 	AdaptationCliWrapper::GetSimEventPckg()->Copy(simEventPckg);
       
   419 	// Notify the waiting observer
       
   420 	TRequestStatus* statusPtr = AdaptationCliWrapper::GetSimNotifyStatus();
       
   421 	User::RequestComplete(statusPtr, KErrNone);
       
   422 	iActiveScheduler->Start();
       
   423 	TSsmSwp lastSwp(SsmCmnWrapper::GetLastSwpTransition());
       
   424 	TEST(lastSwp.Key() == CSsmUiSpecific::SimStatusPropertyKey());
       
   425 	TEST(lastSwp.Value() == ESimUsable);
       
   426 	
       
   427 	INFO_PRINTF1(_L("Testing with event ESsmSimReadable"));
       
   428 	simEventPckg() = ESsmSimReadable;
       
   429 	AdaptationCliWrapper::GetSimEventPckg()->Copy(simEventPckg);
       
   430 	// Notify the waiting observer
       
   431 	statusPtr = AdaptationCliWrapper::GetSimNotifyStatus();
       
   432 	User::RequestComplete(statusPtr, KErrNone);
       
   433 	iActiveScheduler->Start();
       
   434 	lastSwp = SsmCmnWrapper::GetLastSwpTransition();
       
   435 	TEST(lastSwp.Key() == CSsmUiSpecific::SimStatusPropertyKey());
       
   436 	TEST(lastSwp.Value() == ESimReadable);
       
   437 	
       
   438 	INFO_PRINTF1(_L("Testing with event ESsmSimNotReady"));
       
   439 	simEventPckg() = ESsmSimNotReady;
       
   440 	AdaptationCliWrapper::GetSimEventPckg()->Copy(simEventPckg);
       
   441 	// Notify the waiting observer
       
   442 	statusPtr = AdaptationCliWrapper::GetSimNotifyStatus();
       
   443 	User::RequestComplete(statusPtr, KErrNone);
       
   444 	iActiveScheduler->Start();
       
   445 	lastSwp = SsmCmnWrapper::GetLastSwpTransition();
       
   446 	TEST(lastSwp.Key() == CSsmUiSpecific::SimStatusPropertyKey());
       
   447 	TEST(lastSwp.Value() == ESimNotReady);
       
   448 		
       
   449 	INFO_PRINTF1(_L("Testing with event ESsmSimRemoved"));
       
   450 	simEventPckg() = ESsmSimRemoved;
       
   451 	AdaptationCliWrapper::GetSimEventPckg()->Copy(simEventPckg);
       
   452 	// Notify the waiting observer
       
   453 	statusPtr = AdaptationCliWrapper::GetSimNotifyStatus();
       
   454 	User::RequestComplete(statusPtr, KErrNone);
       
   455 	iActiveScheduler->Start();
       
   456 	lastSwp = SsmCmnWrapper::GetLastSwpTransition();
       
   457 	TEST(lastSwp.Key() == CSsmUiSpecific::SimStatusPropertyKey());
       
   458 	TEST(lastSwp.Value() == ESimNotPresent);
       
   459 	
       
   460 	INFO_PRINTF1(_L("Cleaning up active stopper"));
       
   461 	CleanupStack::PopAndDestroy(stopper);
       
   462 	
       
   463 	INFO_PRINTF1(_L("Cleaning up SSM SIM status observer"));
       
   464 	simObserver->Release();
       
   465 	CleanupStack::Pop(simObserver);
       
   466 	simObserver = NULL;
       
   467 
       
   468 			
       
   469 	__UHEAP_MARKEND;	
       
   470 	INFO_PRINTF1(_L("Leaving test for SIM events parts of SSM SIM status observer"));	
       
   471 	}