rtp/srtpstack/tsrc/ut_srtpstack/src/UT_CSRTPStreamIn.cpp
branchRCL_3
changeset 44 0dcb073356a5
parent 43 b5e99d8877c7
equal deleted inserted replaced
43:b5e99d8877c7 44:0dcb073356a5
   345 
   345 
   346 void UT_CSRTPStreamIn::Teardown(  )
   346 void UT_CSRTPStreamIn::Teardown(  )
   347     {
   347     {
   348     delete iDecryptedPayload;
   348     delete iDecryptedPayload;
   349     delete iTestPayload160Bits;
   349     delete iTestPayload160Bits;
   350 	
       
   351 	iDecryptedPayload = NULL;
       
   352     iTestPayload160Bits = NULL;
       
   353 
       
   354 
   350 
   355 
   351 
   356     delete iStreamIn;
   352     delete iStreamIn;
   357     delete iStreamInLateBD;
   353     delete iStreamInLateBD;
   358     delete iSRTPSession;    
   354     delete iSRTPSession;    
   359 	
       
   360 	iStreamIn = NULL;
       
   361     iStreamInLateBD = NULL;
       
   362     iSRTPSession = NULL; 
       
   363 
   355 
   364    
   356    
   365     delete iRFC3711_SessionEncrKey128bits;
   357     delete iRFC3711_SessionEncrKey128bits;
   366     delete iRFC3711_SessionSaltKey128bits;
   358     delete iRFC3711_SessionSaltKey128bits;
   367     delete iRFC3711_SessionAuthKey128bits;    
   359     delete iRFC3711_SessionAuthKey128bits;    
   368     delete iRFC3711_RtcpEncrKey128bits;
   360     delete iRFC3711_RtcpEncrKey128bits;
   369 	delete iRFC3711_RtcpSaltKey128bits;
   361 	delete iRFC3711_RtcpSaltKey128bits;
   370 	delete iRFC3711_RtcpAuthKey128bits;
   362 	delete iRFC3711_RtcpAuthKey128bits;
   371 	
   363     }
   372 	iRFC3711_SessionEncrKey128bits = NULL;
   364 
   373     iRFC3711_SessionSaltKey128bits = NULL;
   365 void UT_CSRTPStreamIn::UT_CSRTPStreamIn_NewL_1L(  )
   374     iRFC3711_SessionAuthKey128bits = NULL;    
       
   375     iRFC3711_RtcpEncrKey128bits = NULL;
       
   376 	iRFC3711_RtcpSaltKey128bits = NULL;
       
   377 	iRFC3711_RtcpAuthKey128bits = NULL;
       
   378     }
       
   379 
       
   380 void UT_CSRTPStreamIn::UT_CSRTPStreamIn_NewL_OneL(  )
       
   381     {        
   366     {        
   382     CSRTPStreamIn* tempStreamIn = CSRTPStreamIn::NewL(*iSRTPSession, (TUint)1);
   367     CSRTPStreamIn* tempStreamIn = CSRTPStreamIn::NewL(*iSRTPSession, (TUint)1);
   383     EUNIT_ASSERT(tempStreamIn->SSRC()== 1);
   368     EUNIT_ASSERT(tempStreamIn->SSRC()== 1);
   384     delete tempStreamIn;
   369     delete tempStreamIn;
   385     }
   370     }
   386 
   371 
   387 void UT_CSRTPStreamIn::UT_CSRTPStreamIn_NewL_TwoL(  )
   372 void UT_CSRTPStreamIn::UT_CSRTPStreamIn_NewL_2L(  )
   388     {
   373     {
   389     HBufC8* masterKey = HBufC8::NewL(KRFC3711_TestMasterKey128bits().Length());
   374     HBufC8* masterKey = HBufC8::NewL(KRFC3711_TestMasterKey128bits().Length());
   390     CleanupStack::PushL( masterKey );
   375     CleanupStack::PushL( masterKey );
   391     *masterKey = KRFC3711_TestMasterKey128bits;
   376     *masterKey = KRFC3711_TestMasterKey128bits;
   392 
   377 
   419     EUNIT_ASSERT(tempStreamIn->SSRC()== 1);
   404     EUNIT_ASSERT(tempStreamIn->SSRC()== 1);
   420     delete tempStreamIn;    
   405     delete tempStreamIn;    
   421      CleanupStack::PopAndDestroy( srtpSession );                   
   406      CleanupStack::PopAndDestroy( srtpSession );                   
   422     }
   407     }
   423 
   408 
   424 void UT_CSRTPStreamIn::UT_CSRTPStreamIn_NewL_ThreeL(  )
   409 void UT_CSRTPStreamIn::UT_CSRTPStreamIn_NewL_3L(  )
   425     {
   410     {
   426     HBufC8* masterKey = HBufC8::NewL(KRFC3711_TestMasterKey128bits().Length());
   411     HBufC8* masterKey = HBufC8::NewL(KRFC3711_TestMasterKey128bits().Length());
   427     CleanupStack::PushL( masterKey );
   412     CleanupStack::PushL( masterKey );
   428     *masterKey = KRFC3711_TestMasterKey128bits;
   413     *masterKey = KRFC3711_TestMasterKey128bits;
   429 
   414 
   455     
   440     
   456     EUNIT_ASSERT(tempStreamIn->GetCryptoContext().Valid()==ETrue); 
   441     EUNIT_ASSERT(tempStreamIn->GetCryptoContext().Valid()==ETrue); 
   457     delete tempStreamIn;   
   442     delete tempStreamIn;   
   458     CleanupStack::PopAndDestroy( srtpSession );                   
   443     CleanupStack::PopAndDestroy( srtpSession );                   
   459     }
   444     }
   460 void UT_CSRTPStreamIn::UT_CSRTPStreamIn_NewL_FourL(  )
   445 void UT_CSRTPStreamIn::UT_CSRTPStreamIn_NewL_4L(  )
   461     {
   446     {
   462      HBufC8* masterKey = HBufC8::NewL(KRFC3711_TestMasterKey128bits().Length());
   447      HBufC8* masterKey = HBufC8::NewL(KRFC3711_TestMasterKey128bits().Length());
   463     CleanupStack::PushL( masterKey );
   448     CleanupStack::PushL( masterKey );
   464     *masterKey = KRFC3711_TestMasterKey128bits;
   449     *masterKey = KRFC3711_TestMasterKey128bits;
   465 
   450 
   492     EUNIT_ASSERT(tempStreamIn->GetCryptoContext().Valid()==ETrue); 
   477     EUNIT_ASSERT(tempStreamIn->GetCryptoContext().Valid()==ETrue); 
   493     delete tempStreamIn;  
   478     delete tempStreamIn;  
   494     CleanupStack::PopAndDestroy( srtpSession );
   479     CleanupStack::PopAndDestroy( srtpSession );
   495     }
   480     }
   496     
   481     
   497 void UT_CSRTPStreamIn::UT_CSRTPStreamIn_NewL_FiveL(  )
   482 void UT_CSRTPStreamIn::UT_CSRTPStreamIn_NewL_5L(  )
   498     {
   483     {
   499      HBufC8* masterKey = HBufC8::NewL(KRFC3711_TestMasterKey128bits().Length());
   484      HBufC8* masterKey = HBufC8::NewL(KRFC3711_TestMasterKey128bits().Length());
   500     CleanupStack::PushL( masterKey );
   485     CleanupStack::PushL( masterKey );
   501     *masterKey = KRFC3711_TestMasterKey128bits;
   486     *masterKey = KRFC3711_TestMasterKey128bits;
   502 
   487 
  1049 EUNIT_TEST(
  1034 EUNIT_TEST(
  1050     "NewL1 - test ",
  1035     "NewL1 - test ",
  1051     "CSRTPStreamIn",
  1036     "CSRTPStreamIn",
  1052     "NewL1",
  1037     "NewL1",
  1053     "FUNCTIONALITY",
  1038     "FUNCTIONALITY",
  1054     SetupL, UT_CSRTPStreamIn_NewL_OneL, Teardown)
  1039     SetupL, UT_CSRTPStreamIn_NewL_1L, Teardown)
  1055 
  1040 
  1056 EUNIT_TEST(
  1041 EUNIT_TEST(
  1057     "NewL2 - test ",
  1042     "NewL2 - test ",
  1058     "CSRTPStreamIn",
  1043     "CSRTPStreamIn",
  1059     "NewL2",
  1044     "NewL2",
  1060     "FUNCTIONALITY",
  1045     "FUNCTIONALITY",
  1061     SetupL, UT_CSRTPStreamIn_NewL_TwoL, Teardown)
  1046     SetupL, UT_CSRTPStreamIn_NewL_2L, Teardown)
  1062 
  1047 
  1063 EUNIT_TEST(
  1048 EUNIT_TEST(
  1064     "NewL3 - test ",
  1049     "NewL3 - test ",
  1065     "CSRTPStreamIn",
  1050     "CSRTPStreamIn",
  1066     "NewL3",
  1051     "NewL3",
  1067     "FUNCTIONALITY",
  1052     "FUNCTIONALITY",
  1068     SetupL, UT_CSRTPStreamIn_NewL_ThreeL, Teardown)
  1053     SetupL, UT_CSRTPStreamIn_NewL_3L, Teardown)
  1069     
  1054     
  1070 EUNIT_TEST(
  1055 EUNIT_TEST(
  1071     "NewL4 - test ",
  1056     "NewL4 - test ",
  1072     "CSRTPStreamIn",
  1057     "CSRTPStreamIn",
  1073     "NewL4",
  1058     "NewL4",
  1074     "FUNCTIONALITY",
  1059     "FUNCTIONALITY",
  1075     SetupL, UT_CSRTPStreamIn_NewL_FourL, Teardown)    
  1060     SetupL, UT_CSRTPStreamIn_NewL_4L, Teardown)    
  1076 
  1061 
  1077 EUNIT_TEST(
  1062 EUNIT_TEST(
  1078     "NewL5 - test ",
  1063     "NewL5 - test ",
  1079     "CSRTPStreamIn",
  1064     "CSRTPStreamIn",
  1080     "NewL5",
  1065     "NewL5",
  1081     "FUNCTIONALITY",
  1066     "FUNCTIONALITY",
  1082     SetupL, UT_CSRTPStreamIn_NewL_FiveL, Teardown)    
  1067     SetupL, UT_CSRTPStreamIn_NewL_5L, Teardown)    
  1083 EUNIT_TEST(
  1068 EUNIT_TEST(
  1084     "UnprotectSrtpL - test ",
  1069     "UnprotectSrtpL - test ",
  1085     "CSRTPStreamIn",
  1070     "CSRTPStreamIn",
  1086     "UnprotectSrtpL",
  1071     "UnprotectSrtpL",
  1087     "FUNCTIONALITY",
  1072     "FUNCTIONALITY",