rtp/srtpstack/tsrc/ut_srtpstack/src/UT_CSRTPStreamOut.cpp
branchRCL_3
changeset 43 b5e99d8877c7
parent 0 307788aac0a8
child 44 0dcb073356a5
equal deleted inserted replaced
41:f54bfd820e04 43:b5e99d8877c7
   332 
   332 
   333 void UT_CSRTPStreamOut::Teardown(  )
   333 void UT_CSRTPStreamOut::Teardown(  )
   334     {
   334     {
   335     delete iDecryptedPayload;
   335     delete iDecryptedPayload;
   336     delete iTestPayload160Bits;
   336     delete iTestPayload160Bits;
       
   337 	
       
   338 	iDecryptedPayload = NULL;
       
   339     iTestPayload160Bits = NULL;
   337     //delete iTestMKI128Bits;
   340     //delete iTestMKI128Bits;
   338 
   341 
   339     delete iStreamOut;
   342     delete iStreamOut;
   340     delete iSRTPSession;    
   343     delete iSRTPSession;    
       
   344 	
       
   345 	iStreamOut = NULL;
       
   346     iSRTPSession = NULL; 
   341 
   347 
   342     
   348     
   343     delete iRFC3711_SessionEncrKey128bits;
   349     delete iRFC3711_SessionEncrKey128bits;
   344     delete iRFC3711_SessionSaltKey128bits;
   350     delete iRFC3711_SessionSaltKey128bits;
   345     delete iRFC3711_SessionAuthKey128bits;    
   351     delete iRFC3711_SessionAuthKey128bits;    
   346     delete iRFC3711_RtcpEncrKey128bits;
   352     delete iRFC3711_RtcpEncrKey128bits;
   347 	delete iRFC3711_RtcpSaltKey128bits;
   353 	delete iRFC3711_RtcpSaltKey128bits;
   348 	delete iRFC3711_RtcpAuthKey128bits;    
   354 	delete iRFC3711_RtcpAuthKey128bits;    
   349 
   355     
   350     }
   356 	iRFC3711_SessionEncrKey128bits = NULL;
   351 
   357     iRFC3711_SessionSaltKey128bits = NULL;
   352 void UT_CSRTPStreamOut::UT_CSRTPStreamOut_NewL_1L(  )
   358     iRFC3711_SessionAuthKey128bits = NULL;    
       
   359     iRFC3711_RtcpEncrKey128bits = NULL;
       
   360 	iRFC3711_RtcpSaltKey128bits = NULL;
       
   361 	iRFC3711_RtcpAuthKey128bits = NULL;
       
   362     }
       
   363 
       
   364 void UT_CSRTPStreamOut::UT_CSRTPStreamOut_NewL_OneL(  )
   353     {
   365     {
   354     CSRTPStreamOut* tempStreamOut = CSRTPStreamOut::NewL(*iSRTPSession, (TUint)1);
   366     CSRTPStreamOut* tempStreamOut = CSRTPStreamOut::NewL(*iSRTPSession, (TUint)1);
   355     EUNIT_ASSERT(tempStreamOut->SSRC()== 1);
   367     EUNIT_ASSERT(tempStreamOut->SSRC()== 1);
   356     delete tempStreamOut;
   368     delete tempStreamOut;
   357     }
   369     }
   358 
   370 
   359 void UT_CSRTPStreamOut::UT_CSRTPStreamOut_NewL_2L(  )
   371 void UT_CSRTPStreamOut::UT_CSRTPStreamOut_NewL_TwoL(  )
   360     {
   372     {
   361         HBufC8* masterKey = HBufC8::NewL(KRFC3711_TestMasterKey128bits().Length());
   373         HBufC8* masterKey = HBufC8::NewL(KRFC3711_TestMasterKey128bits().Length());
   362     CleanupStack::PushL( masterKey );
   374     CleanupStack::PushL( masterKey );
   363     *masterKey = KRFC3711_TestMasterKey128bits;
   375     *masterKey = KRFC3711_TestMasterKey128bits;
   364 
   376 
   397     EUNIT_ASSERT(tempStreamOut->GetCryptoContext().Valid()==ETrue); 
   409     EUNIT_ASSERT(tempStreamOut->GetCryptoContext().Valid()==ETrue); 
   398     delete tempStreamOut;    
   410     delete tempStreamOut;    
   399     delete srtpSession;                     
   411     delete srtpSession;                     
   400     }
   412     }
   401 
   413 
   402 void UT_CSRTPStreamOut::UT_CSRTPStreamOut_NewL_3L(  )
   414 void UT_CSRTPStreamOut::UT_CSRTPStreamOut_NewL_ThreeL(  )
   403     {
   415     {
   404         HBufC8* masterKey = HBufC8::NewL(KRFC3711_TestMasterKey128bits().Length());
   416         HBufC8* masterKey = HBufC8::NewL(KRFC3711_TestMasterKey128bits().Length());
   405     CleanupStack::PushL( masterKey );
   417     CleanupStack::PushL( masterKey );
   406     *masterKey = KRFC3711_TestMasterKey128bits;
   418     *masterKey = KRFC3711_TestMasterKey128bits;
   407 
   419 
   762 EUNIT_TEST(
   774 EUNIT_TEST(
   763     "NewL1 - test ",
   775     "NewL1 - test ",
   764     "CSRTPStreamOut",
   776     "CSRTPStreamOut",
   765     "NewL",
   777     "NewL",
   766     "FUNCTIONALITY",
   778     "FUNCTIONALITY",
   767     SetupL, UT_CSRTPStreamOut_NewL_1L, Teardown)
   779     SetupL, UT_CSRTPStreamOut_NewL_OneL, Teardown)
   768 
   780 
   769 EUNIT_TEST(
   781 EUNIT_TEST(
   770     "NewL2 - test ",
   782     "NewL2 - test ",
   771     "CSRTPStreamOut",
   783     "CSRTPStreamOut",
   772     "NewL2",
   784     "NewL2",
   773     "FUNCTIONALITY",
   785     "FUNCTIONALITY",
   774     SetupL, UT_CSRTPStreamOut_NewL_2L, Teardown)
   786     SetupL, UT_CSRTPStreamOut_NewL_TwoL, Teardown)
   775 EUNIT_TEST(
   787 EUNIT_TEST(
   776     "NewL3 - test ",
   788     "NewL3 - test ",
   777     "CSRTPStreamOut",
   789     "CSRTPStreamOut",
   778     "NewL3",
   790     "NewL3",
   779     "FUNCTIONALITY",
   791     "FUNCTIONALITY",
   780     SetupL, UT_CSRTPStreamOut_NewL_3L, Teardown)
   792     SetupL, UT_CSRTPStreamOut_NewL_ThreeL, Teardown)
   781 
   793 
   782 EUNIT_TEST(
   794 EUNIT_TEST(
   783     "ProtectRtpL - test ",
   795     "ProtectRtpL - test ",
   784     "CSRTPStreamOut",
   796     "CSRTPStreamOut",
   785     "ProtectRtpL",
   797     "ProtectRtpL",