|
1 /* |
|
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // CLASS HEADER |
|
22 #include "UT_CMccSymDlStream.h" |
|
23 |
|
24 // EXTERNAL INCLUDES |
|
25 #include <digia/eunit/eunitmacros.h> |
|
26 |
|
27 |
|
28 // INTERNAL INCLUDES |
|
29 #include "Mccsymdlstream.h" |
|
30 #include "Mccrtpmanager.h" |
|
31 #include "Mcctesteventhandler.h" |
|
32 #include "mmccinterfacedef.h" |
|
33 #include "mccresourcepool_stub.h" |
|
34 #include "mcccodecconfigurator.h" |
|
35 #include "mccmultiplexer.h" |
|
36 #include "mmcccryptocontext.h" |
|
37 #include "mccjitterbuffer.h" |
|
38 |
|
39 #include "mccunittestmacros.h" |
|
40 |
|
41 const TUid KRtpDataSource = { KImplUidRtpDataSource }; |
|
42 const TInt KAmrNbBitrate122 = 12200; |
|
43 const TInt KIlbcBitrate20 = 15200; |
|
44 const TInt KIlbcBitrate30 = 13330; |
|
45 |
|
46 // CONSTRUCTION |
|
47 UT_CMccSymDlStream* UT_CMccSymDlStream::NewL() |
|
48 { |
|
49 UT_CMccSymDlStream* self = UT_CMccSymDlStream::NewLC(); |
|
50 CleanupStack::Pop(); |
|
51 |
|
52 return self; |
|
53 } |
|
54 |
|
55 UT_CMccSymDlStream* UT_CMccSymDlStream::NewLC() |
|
56 { |
|
57 UT_CMccSymDlStream* self = new( ELeave ) UT_CMccSymDlStream(); |
|
58 CleanupStack::PushL( self ); |
|
59 |
|
60 self->ConstructL(); |
|
61 |
|
62 return self; |
|
63 } |
|
64 |
|
65 // Destructor (virtual by CBase) |
|
66 UT_CMccSymDlStream::~UT_CMccSymDlStream() |
|
67 { |
|
68 } |
|
69 |
|
70 // Default constructor |
|
71 UT_CMccSymDlStream::UT_CMccSymDlStream() |
|
72 { |
|
73 } |
|
74 |
|
75 // Second phase construct |
|
76 void UT_CMccSymDlStream::ConstructL() |
|
77 { |
|
78 // The ConstructL from the base class CEUnitTestSuiteClass must be called. |
|
79 // It generates the test case table. |
|
80 CEUnitTestSuiteClass::ConstructL(); |
|
81 } |
|
82 |
|
83 // METHODS |
|
84 void UT_CMccSymDlStream::SetupL() |
|
85 { |
|
86 iResources = CMccResourcePoolStub::NewL(); |
|
87 iStreamId = 1; |
|
88 iHandler = CMccTestEventHandler::NewL(); |
|
89 iRtpMan = CMccRtpManager::NewL( *iHandler, *iResources, iMccSessionId ); |
|
90 iStream = CMccSymDlStream::NewLC( iStreamId, iHandler, iResources, iRtpMan, 201 ); |
|
91 CleanupStack::Pop( iStream ); |
|
92 |
|
93 TPckgBuf<TInt> params( 30000 ); |
|
94 iSourceStub = MDataSource::NewSourceL( KRtpDataSource, params ); |
|
95 iSinkStub = MDataSink::NewSinkL( KUidMmfAudioOutput, KNullDesC8 ); |
|
96 |
|
97 iStream->AddSinkAndSourceL( iSinkStub, iSourceStub ); |
|
98 |
|
99 TMccCodecInfo cInfo; |
|
100 cInfo.iFourCC = TFourCC( KMccFourCCIdAMRNB ); |
|
101 cInfo.iBitrate = KAmrNbBitrate122; |
|
102 cInfo.iHwFrameTime = 20; |
|
103 cInfo.iFrameSize = 32; |
|
104 cInfo.iPtime = 20; |
|
105 cInfo.iMaxPtime = 400; // recommended "limit" 200ms |
|
106 cInfo.iJitterBufBufferLength = 100; |
|
107 cInfo.iPayloadType = KMinDynamicPT; |
|
108 cInfo.iCodecMode = EBandwidthEfficient; |
|
109 cInfo.iPayloadFormatEncoder = KImplUidAmrPayloadFormatEncode; |
|
110 cInfo.iPayloadFormatDecoder = KImplUidAmrPayloadFormatDecode; |
|
111 _LIT8( KFmtp, "octet-align=0" ); |
|
112 TBuf8<13> buf( KFmtp() ); |
|
113 iStream->LoadCodecL( cInfo, buf ); |
|
114 |
|
115 TUint port; |
|
116 iRtpMan->CreateSessionL( port, ETrue, EFalse ); |
|
117 } |
|
118 |
|
119 void UT_CMccSymDlStream::Setup2L() |
|
120 { |
|
121 iResources = CMccResourcePoolStub::NewL(); |
|
122 iStreamId = 1; |
|
123 iHandler = CMccTestEventHandler::NewL(); |
|
124 iRtpMan = CMccRtpManager::NewL( *iHandler, *iResources, iMccSessionId ); |
|
125 iStream = CMccSymDlStream::NewLC( iStreamId, iHandler, iResources, iRtpMan, 201 ); |
|
126 CleanupStack::Pop( iStream ); |
|
127 |
|
128 TPckgBuf<TInt> params( 30000 ); |
|
129 iSourceStub = MDataSource::NewSourceL( KRtpDataSource, params ); |
|
130 iSinkStub = MDataSink::NewSinkL( KUidMmfAudioOutput, KNullDesC8 ); |
|
131 |
|
132 iStream->AddSinkAndSourceL( iSinkStub, iSourceStub ); |
|
133 } |
|
134 |
|
135 void UT_CMccSymDlStream::SetupIlbcL() |
|
136 { |
|
137 iResources = CMccResourcePoolStub::NewL(); |
|
138 iStreamId = 1; |
|
139 iHandler = CMccTestEventHandler::NewL(); |
|
140 iRtpMan = CMccRtpManager::NewL( *iHandler, *iResources,iMccSessionId ); |
|
141 iStream = CMccSymDlStream::NewLC( iStreamId, iHandler, iResources, iRtpMan, 201 ); |
|
142 CleanupStack::Pop( iStream ); |
|
143 |
|
144 TPckgBuf<TInt> params( 30000 ); |
|
145 iSourceStub = MDataSource::NewSourceL( KRtpDataSource, params ); |
|
146 iSinkStub = MDataSink::NewSinkL( KUidMmfAudioOutput, KNullDesC8 ); |
|
147 |
|
148 iStream->AddSinkAndSourceL( iSinkStub, iSourceStub ); |
|
149 |
|
150 TMccCodecInfo cInfo; |
|
151 cInfo.iFourCC = TFourCC( KMccFourCCIdILBC ); |
|
152 cInfo.iBitrate = KIlbcBitrate20; |
|
153 cInfo.iHwFrameTime = 20; |
|
154 cInfo.iFrameSize = 0; |
|
155 cInfo.iPtime = 20; |
|
156 cInfo.iMaxPtime = 200; |
|
157 cInfo.iJitterBufBufferLength = 100; |
|
158 cInfo.iPayloadType = KMinDynamicPT; |
|
159 cInfo.iPayloadFormatEncoder = KImplUidiLBCPayloadFormatEncode; |
|
160 cInfo.iPayloadFormatDecoder = KImplUidiLBCPayloadFormatDecode; |
|
161 |
|
162 iStream->LoadCodecL( cInfo, KNullDesC8 ); |
|
163 |
|
164 TUint port; |
|
165 iRtpMan->CreateSessionL( port, ETrue, EFalse ); |
|
166 } |
|
167 |
|
168 void UT_CMccSymDlStream::Teardown() |
|
169 { |
|
170 if ( iStream ) |
|
171 { |
|
172 delete iStream; |
|
173 } |
|
174 |
|
175 if ( iRtpMan ) |
|
176 { |
|
177 delete iRtpMan; |
|
178 } |
|
179 |
|
180 if ( iHandler ) |
|
181 { |
|
182 delete iHandler; |
|
183 } |
|
184 |
|
185 delete iSourceStub; |
|
186 delete iSinkStub; |
|
187 delete iResources; |
|
188 } |
|
189 |
|
190 void UT_CMccSymDlStream::UT_CMccSymDlStream_SetPrioritySettingsLL( ) |
|
191 { |
|
192 TMMFPrioritySettings priority; |
|
193 |
|
194 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->SetPrioritySettingsL( priority ) ); |
|
195 |
|
196 iStream->iDatasink = NULL; |
|
197 |
|
198 MCC_EUNIT_ASSERT_SPECIFIC_LEAVE( iStream->SetPrioritySettingsL( priority ), KErrNotReady ); |
|
199 } |
|
200 |
|
201 void UT_CMccSymDlStream::UT_CMccSymDlStream_CreatePayloadFormatDecoderL() |
|
202 { |
|
203 MCC_EUNIT_ASSERT_SPECIFIC_LEAVE( iStream->CreatePayloadFormatDecoderL(), KErrAlreadyExists ); |
|
204 |
|
205 TMccCodecInfo cInfo; |
|
206 cInfo.iFourCC = TFourCC( KMccFourCCIdAMRNB ); |
|
207 cInfo.iBitrate = KAmrNbBitrate122; |
|
208 cInfo.iAlgoUsed = EGenRedUsed; |
|
209 cInfo.iHwFrameTime = 20; |
|
210 cInfo.iFrameSize = 32; |
|
211 cInfo.iPtime = 20; |
|
212 cInfo.iMaxPtime = 400; // recommended "limit" 200ms |
|
213 cInfo.iJitterBufBufferLength = 100; |
|
214 cInfo.iPayloadType = KMinDynamicPT; |
|
215 cInfo.iRedundantPayload = KMinDynamicPT; |
|
216 cInfo.iCodecMode = EBandwidthEfficient; |
|
217 cInfo.iPayloadFormatEncoder = KImplUidAmrPayloadFormatEncode; |
|
218 cInfo.iPayloadFormatDecoder = KImplUidAmrPayloadFormatDecode; |
|
219 _LIT8( KFmtp, "octet-align=0" ); |
|
220 TBuf8<13> buf( KFmtp() ); |
|
221 |
|
222 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->LoadCodecL( cInfo, buf ) ); |
|
223 |
|
224 delete iStream->iFormatDecode; |
|
225 iStream->iFormatDecode = NULL; |
|
226 delete iStream->iRedFormatDecode; |
|
227 iStream->iRedFormatDecode = NULL; |
|
228 |
|
229 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->CreatePayloadFormatDecoderL() ); |
|
230 |
|
231 cInfo.iAlgoUsed = ENoAlgoUsed; |
|
232 iStream->iCodecInfo = cInfo; |
|
233 |
|
234 delete iStream->iFormatDecode; |
|
235 iStream->iFormatDecode = NULL; |
|
236 delete iStream->iRedFormatDecode; |
|
237 iStream->iRedFormatDecode = NULL; |
|
238 |
|
239 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->CreatePayloadFormatDecoderL() ); |
|
240 |
|
241 } |
|
242 |
|
243 void UT_CMccSymDlStream::UT_CMccSymDlStream_DoDynamicFrameSizeChangeL() |
|
244 { |
|
245 |
|
246 MCC_EUNIT_ASSERT_SPECIFIC_LEAVE( iStream->DoDynamicFrameSizeChangeL( 20 ), KErrNotReady ); |
|
247 /* |
|
248 TMccCodecInfo cInfo; |
|
249 cInfo.iFourCC = TFourCC( KMccFourCCIdAMRNB ); |
|
250 cInfo.iBitrate = KAmrNbBitrate122; |
|
251 cInfo.iAlgoUsed = EGenRedUsed; |
|
252 cInfo.iHwFrameTime = 20; |
|
253 cInfo.iFrameSize = 32; |
|
254 cInfo.iPtime = 20; |
|
255 cInfo.iMaxPtime = 400; // recommended "limit" 200ms |
|
256 cInfo.iJitterBufBufferLength = 100; |
|
257 cInfo.iPayloadType = KMinDynamicPT; |
|
258 cInfo.iRedundantPayload = KMinDynamicPT; |
|
259 cInfo.iCodecMode = EBandwidthEfficient; |
|
260 cInfo.iPayloadFormatEncoder = KImplUidAmrPayloadFormatEncode; |
|
261 cInfo.iPayloadFormatDecoder = KImplUidAmrPayloadFormatDecode; |
|
262 _LIT8( KFmtp, "octet-align=0" ); |
|
263 TBuf8<13> buf( KFmtp() ); |
|
264 |
|
265 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->LoadCodecL( cInfo, buf ) ); |
|
266 |
|
267 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->DoDynamicFrameSizeChangeL( 20 ) ); |
|
268 */ |
|
269 } |
|
270 |
|
271 void UT_CMccSymDlStream::UT_CMccSymDlStream_MultiplexerSink() |
|
272 { |
|
273 iStream->iCodecInfo.iAlgoUsed = EGenRedUsed; |
|
274 MDataSink* sink = iStream->MultiplexerSink(); |
|
275 EUNIT_ASSERT( !sink ); |
|
276 iStream->iCodecInfo.iAlgoUsed = ENoAlgoUsed; |
|
277 sink = iStream->MultiplexerSink(); |
|
278 EUNIT_ASSERT( sink ); |
|
279 } |
|
280 |
|
281 void UT_CMccSymDlStream::UT_CMccSymDlStream_AddSinkAndSourceLL( ) |
|
282 { |
|
283 // These two will fail because of the NULL |
|
284 EUNIT_ASSERT_LEAVE( iStream->AddSinkAndSourceL( reinterpret_cast<MDataSink*>( this ), NULL ) ); |
|
285 EUNIT_ASSERT_LEAVE( iStream->AddSinkAndSourceL( NULL, reinterpret_cast<MDataSource*>( this ) ) ); |
|
286 } |
|
287 |
|
288 void UT_CMccSymDlStream::UT_CMccSymDlStream_LoadCodecLL( ) |
|
289 { |
|
290 TMccCodecInfo cInfo; |
|
291 cInfo.iFourCC = TFourCC( KMccFourCCIdAMRNB ); |
|
292 cInfo.iBitrate = KAmrNbBitrate122; |
|
293 cInfo.iHwFrameTime = 20; |
|
294 cInfo.iFrameSize = 32; |
|
295 cInfo.iPtime = 20; |
|
296 cInfo.iMaxPtime = 400; // recommended "limit" 200ms |
|
297 cInfo.iJitterBufBufferLength = 100; |
|
298 cInfo.iPayloadType = KMinDynamicPT; |
|
299 cInfo.iCodecMode = EBandwidthEfficient; |
|
300 cInfo.iPayloadFormatEncoder = KImplUidAmrPayloadFormatEncode; |
|
301 cInfo.iPayloadFormatDecoder = KImplUidAmrPayloadFormatDecode; |
|
302 _LIT8( KFmtp, "octet-align=0" ); |
|
303 TBuf8<13> buf( KFmtp() ); |
|
304 |
|
305 EUNIT_ASSERT( iStream->CurrentCodecState() == CMccSymStreamBase::EStateCodecNone ); |
|
306 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->LoadCodecL( cInfo, buf ) ); |
|
307 |
|
308 EUNIT_ASSERT( iStream->CurrentCodecState() == CMccSymStreamBase::EStateCodecNegotiated ); |
|
309 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->LoadCodecL( cInfo, buf ) ); |
|
310 |
|
311 EUNIT_ASSERT( iStream->CurrentCodecState() == CMccSymStreamBase::EStateCodecPrepared ); |
|
312 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->LoadCodecL( cInfo, buf ) ); |
|
313 |
|
314 // It seems that loading the real codec causes memory leak |
|
315 EUNIT_ASSERT( iStream->CurrentCodecState() == CMccSymStreamBase::EStateCodecPrepared ); |
|
316 iStream->UpdateCodecLoadingPermission( ETrue ); |
|
317 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->LoadCodecL( cInfo, buf ) ); |
|
318 |
|
319 EUNIT_ASSERT( iStream->CurrentCodecState() == CMccSymStreamBase::EStateCodecLoaded ); |
|
320 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->LoadCodecL( cInfo, buf ) ); |
|
321 } |
|
322 |
|
323 void UT_CMccSymDlStream::UT_CMccSymDlStream_UpdateCodecInformationLL( ) |
|
324 { |
|
325 TMccCodecInfo cInfo; |
|
326 |
|
327 // iFormatDecode == NULL |
|
328 EUNIT_ASSERT_LEAVE( iStream->UpdateCodecInformationL( iStream->iCodecInfo, cInfo ) ); |
|
329 |
|
330 cInfo.iFourCC = TFourCC( KMccFourCCIdAMRNB ); |
|
331 cInfo.iBitrate = KAmrNbBitrate122; |
|
332 cInfo.iHwFrameTime = 20; |
|
333 cInfo.iFrameSize = 32; |
|
334 cInfo.iPtime = 20; |
|
335 cInfo.iMaxPtime = 400; // recommended "limit" 200ms |
|
336 cInfo.iJitterBufBufferLength = 100; |
|
337 cInfo.iPayloadType = KMinDynamicPT; |
|
338 cInfo.iCodecMode = EBandwidthEfficient; |
|
339 cInfo.iPayloadFormatEncoder = KImplUidAmrPayloadFormatEncode; |
|
340 cInfo.iPayloadFormatDecoder = KImplUidAmrPayloadFormatDecode; |
|
341 _LIT8( KFmtp, "octet-align=0" ); |
|
342 TBuf8<13> buf( KFmtp() ); |
|
343 |
|
344 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->LoadCodecL( cInfo, buf ) ); |
|
345 // TUint port; |
|
346 // iRtpMan->CreateSessionL( port, ETrue, EFalse ); |
|
347 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->UpdateCodecInformationL( iStream->iCodecInfo, cInfo ) ); |
|
348 |
|
349 iStream->iDatasink = NULL; |
|
350 |
|
351 MCC_EUNIT_ASSERT_SPECIFIC_LEAVE( iStream->UpdateCodecInformationL( |
|
352 iStream->iCodecInfo, cInfo ), KErrNotReady ); |
|
353 } |
|
354 |
|
355 void UT_CMccSymDlStream::IlbcModeChangeTestL() |
|
356 { |
|
357 RDebug::Print( _L("UT_CMccSymDlStream::IlbcModeChangeTestL IN") ); |
|
358 |
|
359 iStream->PrimeL( 0 ); |
|
360 |
|
361 TMccCodecInfo cInfo; |
|
362 cInfo.iFourCC = TFourCC( KMccFourCCIdILBC ); |
|
363 cInfo.iBitrate = KIlbcBitrate20; |
|
364 cInfo.iHwFrameTime = 20; |
|
365 cInfo.iFrameSize = 0; |
|
366 cInfo.iPtime = 20; |
|
367 cInfo.iMaxPtime = 200; |
|
368 cInfo.iJitterBufBufferLength = 100; |
|
369 cInfo.iPayloadType = KMinDynamicPT; |
|
370 cInfo.iPayloadFormatEncoder = KImplUidiLBCPayloadFormatEncode; |
|
371 cInfo.iPayloadFormatDecoder = KImplUidiLBCPayloadFormatDecode; |
|
372 |
|
373 iStream->iState = CMccSymStreamBase::EStateStreaming; |
|
374 |
|
375 // First update ptime |
|
376 cInfo.iPtime = 40; |
|
377 MCC_EUNIT_ASSERT_NO_LEAVE( |
|
378 iStream->UpdateCodecInformationL( iStream->iCodecInfo, cInfo ) ); |
|
379 |
|
380 // Then update bitrate which requires also ptime adjustment |
|
381 cInfo.iBitrate = KIlbcBitrate30; |
|
382 cInfo.iPtime = 30; |
|
383 cInfo.iMaxPtime = 180; |
|
384 MCC_EUNIT_ASSERT_NO_LEAVE( |
|
385 iStream->UpdateCodecInformationL( iStream->iCodecInfo, cInfo ) ); |
|
386 |
|
387 RDebug::Print( _L("UT_CMccSymDlStream::IlbcModeChangeTestL OUT") ); |
|
388 } |
|
389 |
|
390 void UT_CMccSymDlStream::UT_CMccSymDlStream_PrimeLL( ) |
|
391 { |
|
392 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->PrimeL(0) ); |
|
393 |
|
394 // Can be called twice |
|
395 iResources->iControlled = EFalse; |
|
396 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->PrimeL(0) ); |
|
397 } |
|
398 |
|
399 void UT_CMccSymDlStream::UT_CMccSymDlStream_PlayLL( ) |
|
400 { |
|
401 UT_CMccSymDlStream_PrimeLL(); |
|
402 |
|
403 TBool streamPaused( EFalse ); |
|
404 TBool enableRtcp( EFalse ); |
|
405 |
|
406 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->PlayL( 0, streamPaused, enableRtcp ) ); |
|
407 } |
|
408 |
|
409 void UT_CMccSymDlStream::UT_CMccSymDlStream_PauseLL( ) |
|
410 { |
|
411 UT_CMccSymDlStream_PlayLL(); |
|
412 |
|
413 TBool enableRtcp( EFalse ); |
|
414 |
|
415 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->PauseL( 0, enableRtcp ) ); |
|
416 } |
|
417 |
|
418 void UT_CMccSymDlStream::UT_CMccSymDlStream_ResumeLL( ) |
|
419 { |
|
420 UT_CMccSymDlStream_PauseLL(); |
|
421 |
|
422 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->ResumeL( 0, ETrue ) ); |
|
423 } |
|
424 |
|
425 void UT_CMccSymDlStream::UT_CMccSymDlStream_StopLL( ) |
|
426 { |
|
427 UT_CMccSymDlStream_PlayLL(); |
|
428 |
|
429 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->StopL( 0 ) ); |
|
430 } |
|
431 |
|
432 void UT_CMccSymDlStream::UT_CMccSymDlStream_SetBalanceLL( ) |
|
433 { |
|
434 TInt left( 0 ), right( 0 ); |
|
435 |
|
436 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->SetBalanceL( left, right ) ); |
|
437 } |
|
438 |
|
439 void UT_CMccSymDlStream::UT_CMccSymDlStream_GetBalanceLL( ) |
|
440 { |
|
441 TInt left( 0 ), right( 0 ); |
|
442 |
|
443 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->GetBalanceL( left, right ) ); |
|
444 } |
|
445 |
|
446 void UT_CMccSymDlStream::UT_CMccSymDlStream_GetSSRCLL( ) |
|
447 { |
|
448 TUint32 ssrc; |
|
449 |
|
450 // KErrNotSupported |
|
451 EUNIT_ASSERT_LEAVE( iStream->GetSSRCL( ssrc ) ); |
|
452 } |
|
453 |
|
454 void UT_CMccSymDlStream::UT_CMccSymDlStream_ResetCountersLL( ) |
|
455 { |
|
456 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->ResetCountersL() ); |
|
457 } |
|
458 |
|
459 void UT_CMccSymDlStream::UT_CMccSymDlStream_SendMediaSignalL() |
|
460 { |
|
461 TMccEvent mmcevent; |
|
462 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->SendMediaSignalL(mmcevent) ); |
|
463 |
|
464 iStream->iDatasource = NULL; |
|
465 MCC_EUNIT_ASSERT_SPECIFIC_LEAVE( iStream->SendMediaSignalL(mmcevent), KErrNotReady ); |
|
466 |
|
467 } |
|
468 |
|
469 void UT_CMccSymDlStream::UT_CMccSymDlStream_SendRTCPReceiverReportLL( ) |
|
470 { |
|
471 MCC_EUNIT_ASSERT_SPECIFIC_LEAVE( iStream->SendRTCPReceiverReportL(), KErrNotReady ); |
|
472 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->PrimeL(0) ); |
|
473 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->SendRTCPReceiverReportL() ); |
|
474 iStream->iDatasource = NULL; |
|
475 EUNIT_ASSERT_LEAVE( iStream->SendRTCPReceiverReportL() ); |
|
476 } |
|
477 |
|
478 void UT_CMccSymDlStream::UT_CMccSymDlStream_SendRTCPSenderReportLL( ) |
|
479 { |
|
480 EUNIT_ASSERT_LEAVE( iStream->SendRTCPSenderReportL() ); |
|
481 } |
|
482 |
|
483 void UT_CMccSymDlStream::UT_CMccSymDlStream_StartInactivityTimerLL( ) |
|
484 { |
|
485 TUint32 timeoutTime( 5000 ); |
|
486 |
|
487 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->StartInactivityTimerL( timeoutTime ) ); |
|
488 } |
|
489 |
|
490 void UT_CMccSymDlStream::UT_CMccSymDlStream_StopInactivityTimerLL( ) |
|
491 { |
|
492 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->StopInactivityTimerL() ); |
|
493 } |
|
494 |
|
495 void UT_CMccSymDlStream::UT_CMccSymDlStream_AudioRoutingLL() |
|
496 { |
|
497 TUint32 route; |
|
498 |
|
499 // This actually works currently in emulator. |
|
500 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->SetAudioRouteL( KMccAudioToPublic ) ); |
|
501 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->GetAudioRouteL( route ) ); |
|
502 EUNIT_ASSERT( KMccAudioToPublic == route ); |
|
503 |
|
504 // KMccAudioToPrivate |
|
505 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->SetAudioRouteL( KMccAudioToPrivate ) ); |
|
506 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->GetAudioRouteL( route ) ); |
|
507 EUNIT_ASSERT( KMccAudioToPrivate == route ); |
|
508 } |
|
509 |
|
510 void UT_CMccSymDlStream::UT_CMccSymDlStream_IsUplink() |
|
511 { |
|
512 EUNIT_ASSERT( !iStream->IsUplink() ); |
|
513 } |
|
514 |
|
515 void UT_CMccSymDlStream::UT_CMccSymDlStream_StandByL() |
|
516 { |
|
517 MCC_EUNIT_ASSERT_NO_LEAVE( iStream->StandByL() ); |
|
518 iStream->iDatasource = NULL; |
|
519 EUNIT_ASSERT_LEAVE( iStream->StandByL() ); |
|
520 |
|
521 } |
|
522 |
|
523 void UT_CMccSymDlStream::UT_CMccSymDlStream_JitterBufferError() |
|
524 { |
|
525 TInt err = MJitterBufferObserver::EBufferOverflow; |
|
526 iStream->JitterBufferError( err ); |
|
527 |
|
528 err = MJitterBufferObserver::EBufferUnderflow; |
|
529 iStream->JitterBufferError( err ); |
|
530 } |
|
531 |
|
532 void UT_CMccSymDlStream::UT_CMccSymDlStream_BindContextIntoStreamL() |
|
533 { |
|
534 |
|
535 TMccCryptoContext context; |
|
536 TUint32 endpointId = 0; |
|
537 MCC_EUNIT_ASSERT_SPECIFIC_LEAVE( iStream->BindContextIntoStreamL( endpointId, context ), KErrNotFound ); |
|
538 endpointId = (TUint32)( iStream->iDatasource ); |
|
539 |
|
540 // Key ok (stubbed) |
|
541 iStream->BindContextIntoStreamL( endpointId, context ); |
|
542 } |
|
543 |
|
544 // TEST TABLE |
|
545 |
|
546 EUNIT_BEGIN_TEST_TABLE( |
|
547 UT_CMccSymDlStream, |
|
548 "CMccSymDlStream", |
|
549 "UNIT" ) |
|
550 |
|
551 EUNIT_TEST( |
|
552 "LoadCodecL - test ", |
|
553 "CMccSymDlStream", |
|
554 "LoadCodecL", |
|
555 "FUNCTIONALITY", |
|
556 Setup2L, UT_CMccSymDlStream_LoadCodecLL, Teardown) |
|
557 |
|
558 EUNIT_TEST( |
|
559 "SetPrioritySettingsL - test ", |
|
560 "CMccSymDlStream", |
|
561 "SetPrioritySettingsL", |
|
562 "FUNCTIONALITY", |
|
563 SetupL, UT_CMccSymDlStream_SetPrioritySettingsLL, Teardown) |
|
564 |
|
565 EUNIT_TEST( |
|
566 "CreatePayloadFormatDecoderL - test ", |
|
567 "CMccSymDlStream", |
|
568 "CreatePayloadFormatDecoderL", |
|
569 "FUNCTIONALITY", |
|
570 SetupL, UT_CMccSymDlStream_CreatePayloadFormatDecoderL, Teardown) |
|
571 |
|
572 EUNIT_TEST( |
|
573 "DoDynamicFrameSizeChangeL - test ", |
|
574 "CMccSymDlStream", |
|
575 "DoDynamicFrameSizeChangeL", |
|
576 "FUNCTIONALITY", |
|
577 Setup2L, UT_CMccSymDlStream_DoDynamicFrameSizeChangeL, Teardown) |
|
578 |
|
579 |
|
580 EUNIT_TEST( |
|
581 "MultiplexerSink - test ", |
|
582 "CMccSymDlStream", |
|
583 "MultiplexerSink", |
|
584 "FUNCTIONALITY", |
|
585 SetupL, UT_CMccSymDlStream_MultiplexerSink, Teardown) |
|
586 |
|
587 |
|
588 EUNIT_TEST( |
|
589 "AddSinkAndSourceL - test ", |
|
590 "CMccSymDlStream", |
|
591 "AddSinkAndSourceL", |
|
592 "FUNCTIONALITY", |
|
593 SetupL, UT_CMccSymDlStream_AddSinkAndSourceLL, Teardown) |
|
594 |
|
595 EUNIT_TEST( |
|
596 "UpdateCodecInformationL - test ", |
|
597 "CMccSymDlStream", |
|
598 "UpdateCodecInformationL", |
|
599 "FUNCTIONALITY", |
|
600 Setup2L, UT_CMccSymDlStream_UpdateCodecInformationLL, Teardown) |
|
601 |
|
602 EUNIT_TEST( |
|
603 "IlbcModeChange - test ", |
|
604 "CMccSymDlStream", |
|
605 "IlbcModeChangeTestL", |
|
606 "FUNCTIONALITY", |
|
607 SetupIlbcL, IlbcModeChangeTestL, Teardown) |
|
608 |
|
609 EUNIT_TEST( |
|
610 "PrimeL - test ", |
|
611 "CMccSymDlStream", |
|
612 "PrimeL", |
|
613 "FUNCTIONALITY", |
|
614 SetupL, UT_CMccSymDlStream_PrimeLL, Teardown) |
|
615 |
|
616 EUNIT_TEST( |
|
617 "PlayL - test ", |
|
618 "CMccSymDlStream", |
|
619 "PlayL", |
|
620 "FUNCTIONALITY", |
|
621 SetupL, UT_CMccSymDlStream_PlayLL, Teardown) |
|
622 |
|
623 EUNIT_TEST( |
|
624 "PauseL - test ", |
|
625 "CMccSymDlStream", |
|
626 "PauseL", |
|
627 "FUNCTIONALITY", |
|
628 SetupL, UT_CMccSymDlStream_PauseLL, Teardown) |
|
629 |
|
630 EUNIT_TEST( |
|
631 "ResumeL - test ", |
|
632 "CMccSymDlStream", |
|
633 "ResumeL", |
|
634 "FUNCTIONALITY", |
|
635 SetupL, UT_CMccSymDlStream_ResumeLL, Teardown) |
|
636 |
|
637 EUNIT_TEST( |
|
638 "StopL - test ", |
|
639 "CMccSymDlStream", |
|
640 "StopL", |
|
641 "FUNCTIONALITY", |
|
642 SetupL, UT_CMccSymDlStream_StopLL, Teardown) |
|
643 |
|
644 EUNIT_TEST( |
|
645 "SetBalanceL - test ", |
|
646 "CMccSymDlStream", |
|
647 "SetBalanceL", |
|
648 "FUNCTIONALITY", |
|
649 SetupL, UT_CMccSymDlStream_SetBalanceLL, Teardown) |
|
650 |
|
651 EUNIT_TEST( |
|
652 "GetBalanceL - test ", |
|
653 "CMccSymDlStream", |
|
654 "GetBalanceL", |
|
655 "FUNCTIONALITY", |
|
656 SetupL, UT_CMccSymDlStream_GetBalanceLL, Teardown) |
|
657 |
|
658 EUNIT_TEST( |
|
659 "GetSSRCL - test ", |
|
660 "CMccSymDlStream", |
|
661 "GetSSRCL", |
|
662 "FUNCTIONALITY", |
|
663 SetupL, UT_CMccSymDlStream_GetSSRCLL, Teardown) |
|
664 |
|
665 EUNIT_TEST( |
|
666 "ResetCountersL - test ", |
|
667 "CMccSymDlStream", |
|
668 "ResetCountersL", |
|
669 "FUNCTIONALITY", |
|
670 SetupL, UT_CMccSymDlStream_ResetCountersLL, Teardown) |
|
671 |
|
672 EUNIT_TEST( |
|
673 "SendMediaSignalL - test ", |
|
674 "CMccSymDlStream", |
|
675 "SendMediaSignalL", |
|
676 "FUNCTIONALITY", |
|
677 SetupL, UT_CMccSymDlStream_SendMediaSignalL, Teardown) |
|
678 |
|
679 |
|
680 EUNIT_TEST( |
|
681 "SendRTCPReceiverReportL - test ", |
|
682 "CMccSymDlStream", |
|
683 "SendRTCPReceiverReportL", |
|
684 "FUNCTIONALITY", |
|
685 SetupL, UT_CMccSymDlStream_SendRTCPReceiverReportLL, Teardown) |
|
686 |
|
687 EUNIT_TEST( |
|
688 "SendRTCPSenderReportL - test ", |
|
689 "CMccSymDlStream", |
|
690 "SendRTCPSenderReportL", |
|
691 "FUNCTIONALITY", |
|
692 SetupL, UT_CMccSymDlStream_SendRTCPSenderReportLL, Teardown) |
|
693 |
|
694 EUNIT_TEST( |
|
695 "StartInactivityTimerL - test ", |
|
696 "CMccSymDlStream", |
|
697 "StartInactivityTimerL", |
|
698 "FUNCTIONALITY", |
|
699 SetupL, UT_CMccSymDlStream_StartInactivityTimerLL, Teardown) |
|
700 |
|
701 EUNIT_TEST( |
|
702 "StopInactivityTimerL - test ", |
|
703 "CMccSymDlStream", |
|
704 "StopInactivityTimerL", |
|
705 "FUNCTIONALITY", |
|
706 SetupL, UT_CMccSymDlStream_StopInactivityTimerLL, Teardown) |
|
707 |
|
708 EUNIT_TEST( |
|
709 "AudioRoutingL - test ", |
|
710 "CMccSymDlStream", |
|
711 "AudioRoutingL", |
|
712 "FUNCTIONALITY", |
|
713 SetupL, UT_CMccSymDlStream_AudioRoutingLL, Teardown) |
|
714 |
|
715 EUNIT_TEST( |
|
716 "IsUplink - test ", |
|
717 "CMccSymDlStream", |
|
718 "IsUplink", |
|
719 "FUNCTIONALITY", |
|
720 SetupL, UT_CMccSymDlStream_IsUplink, Teardown) |
|
721 |
|
722 EUNIT_TEST( |
|
723 "StandByL - test ", |
|
724 "CMccSymDlStream", |
|
725 "StandByL", |
|
726 "FUNCTIONALITY", |
|
727 SetupL, UT_CMccSymDlStream_StandByL, Teardown) |
|
728 |
|
729 EUNIT_TEST( |
|
730 "JitterBufferError - test ", |
|
731 "CMccSymDlStream", |
|
732 "JitterBufferError", |
|
733 "FUNCTIONALITY", |
|
734 SetupL, UT_CMccSymDlStream_JitterBufferError, Teardown) |
|
735 |
|
736 EUNIT_TEST( |
|
737 "BindContextIntoStreamL - test ", |
|
738 "CMccSymDlStream", |
|
739 "BindContextIntoStreamL", |
|
740 "FUNCTIONALITY", |
|
741 SetupL, UT_CMccSymDlStream_BindContextIntoStreamL, Teardown) |
|
742 |
|
743 |
|
744 |
|
745 |
|
746 EUNIT_END_TEST_TABLE |
|
747 |
|
748 // END OF FILE |