multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/src/UT_CMCESIPManager.cpp
branchRCL_3
changeset 18 91f50911ea81
parent 0 1bce908db942
equal deleted inserted replaced
17:a5ac35ca6d81 18:91f50911ea81
   478 void UT_CMceSipManager::UT_CMceSipManager_OrphanSubSessionCountL()
   478 void UT_CMceSipManager::UT_CMceSipManager_OrphanSubSessionCountL()
   479     {
   479     {
   480   	EUNIT_ASSERT( iManager->OrphanSubSessionCount() == 0 );
   480   	EUNIT_ASSERT( iManager->OrphanSubSessionCount() == 0 );
   481     }
   481     }
   482 
   482 
       
   483 void UT_CMceSipManager::UT_CMceSipManager_UpdateProfileToSubSessionsL()
       
   484     {
       
   485     iIds.iProfileID = 1;
       
   486     iIds.iManagerType = KMceCSSIPSession;
       
   487     iIds.iDialogType = KMceDlgTypeInvite;
       
   488     
       
   489 	CDesC8ArrayFlat* params = new (ELeave) CDesC8ArrayFlat( KMceArrayGranularity );
       
   490 	CleanupStack::PushL( params );
       
   491 	params->AppendL( _L8("User <user2@host>") );
       
   492 	params->AppendL( _L8("User <user@host>") );
       
   493     
       
   494     CMceCsSubSession* subsession = 
       
   495         iManager->CreateSubSessionL( *iSession, iIds, *params );
       
   496     CleanupStack::PushL( subsession );
       
   497     
       
   498     CSIPProfile& profileOld = subsession->Profile();
       
   499   	EUNIT_ASSERT( &profileOld != NULL );
       
   500     CSIPProfile& profileNew = iManager->ProfileL( 2 );
       
   501   	EUNIT_ASSERT( &profileNew != NULL );
       
   502 
       
   503   	CMceCsSessionImplementation& session = iManager->iClients[ 0 ]->Implementation();
       
   504   	RPointerArray<CMceCsSubSession>& subSessions = session.SubSessions();
       
   505   	subSessions.AppendL(subsession);
       
   506   	
       
   507   	iManager->UpdateProfileToSubSessions(profileNew, profileOld);
       
   508   	EUNIT_ASSERT(&subsession->Profile() == &profileNew)
       
   509   	subSessions.Remove(0);
       
   510 
       
   511   	iManager->AddOrphanSubSessionL( subsession );
       
   512   	iManager->UpdateProfileToSubSessions(profileOld, profileNew);
       
   513   	RPointerArray<CMceCsSubSession>& orphanSubSessions = iManager->iOrphanSubSessions->SubSessions();
       
   514   	EUNIT_ASSERT(&subsession->Profile() == &profileOld)
       
   515 
       
   516   	CleanupStack::Pop( subsession );
       
   517   	CleanupStack::PopAndDestroy( params );
       
   518     }
       
   519 
   483 
   520 
   484 //  TEST TABLE
   521 //  TEST TABLE
   485 
   522 
   486 EUNIT_BEGIN_TEST_TABLE( 
   523 EUNIT_BEGIN_TEST_TABLE( 
   487     UT_CMceSipManager,
   524     UT_CMceSipManager,
   619     "CMceSipManager",
   656     "CMceSipManager",
   620     "OrphanSubSessionCount",
   657     "OrphanSubSessionCount",
   621     "FUNCTIONALITY",
   658     "FUNCTIONALITY",
   622     SetupL, UT_CMceSipManager_OrphanSubSessionCountL, Teardown)
   659     SetupL, UT_CMceSipManager_OrphanSubSessionCountL, Teardown)
   623 
   660 
       
   661 EUNIT_TEST(
       
   662     "UpdateProfileToSubSessions - test ",
       
   663     "CMceSipManager",
       
   664     "UpdateProfileToSubSessions",
       
   665     "FUNCTIONALITY",
       
   666     SetupL, UT_CMceSipManager_UpdateProfileToSubSessionsL, Teardown)
   624 
   667 
   625 EUNIT_END_TEST_TABLE
   668 EUNIT_END_TEST_TABLE
   626 
   669 
   627 //  END OF FILE
   670 //  END OF FILE