|
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_CRtpStream.h" |
|
23 |
|
24 // EXTERNAL INCLUDES |
|
25 #include <digia/eunit/eunitmacros.h> |
|
26 |
|
27 |
|
28 // INTERNAL INCLUDES |
|
29 #include "rtpstream.h" |
|
30 |
|
31 const TUint8 KRtpPayloadClockConversions[KRtpMaxPayloadTypes] = |
|
32 { |
|
33 125, 125, 125, 125, 125, 125, 63, 125, 125, 63, // 0-9 |
|
34 23, 23, 125, 125, 11, 125, 91, 45, 125, 0, // 10-19 |
|
35 0, 0, 0, 0, 0, 11, 11, 0, 11, 0, // 20-29 |
|
36 0, 11, 11, 11, 11, 0, 0, 0, 0, 0, // 30-39 |
|
37 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40-49 |
|
38 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 50-59 |
|
39 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60-69 |
|
40 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 70-79 |
|
41 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 80-89 |
|
42 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 90-99 |
|
43 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 100-109 |
|
44 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 110-119 |
|
45 0, 0, 0, 0, 0, 0, 0, 0 // 120-127 |
|
46 }; |
|
47 |
|
48 const TInt KExtType( 2 ); |
|
49 const TInt KExtLength( 4 ); |
|
50 _LIT8( KExtData, "extD\0" ); |
|
51 _LIT8(KRTPPacket, "8180CDE000000004DEADBEEFFFFFFF7F3958B1FB3F0E"); |
|
52 |
|
53 // CONSTRUCTION |
|
54 UT_CRtpStream* UT_CRtpStream::NewL() |
|
55 { |
|
56 UT_CRtpStream* self = UT_CRtpStream::NewLC(); |
|
57 CleanupStack::Pop(); |
|
58 |
|
59 return self; |
|
60 } |
|
61 |
|
62 UT_CRtpStream* UT_CRtpStream::NewLC() |
|
63 { |
|
64 UT_CRtpStream* self = new( ELeave ) UT_CRtpStream(); |
|
65 CleanupStack::PushL( self ); |
|
66 |
|
67 self->ConstructL(); |
|
68 |
|
69 return self; |
|
70 } |
|
71 |
|
72 // Destructor (virtual by CBase) |
|
73 UT_CRtpStream::~UT_CRtpStream() |
|
74 { |
|
75 } |
|
76 |
|
77 // Default constructor |
|
78 UT_CRtpStream::UT_CRtpStream() |
|
79 { |
|
80 } |
|
81 |
|
82 // Second phase construct |
|
83 void UT_CRtpStream::ConstructL() |
|
84 { |
|
85 // The ConstructL from the base class CEUnitTestSuiteClass must be called. |
|
86 // It generates the test case table. |
|
87 CEUnitTestSuiteClass::ConstructL(); |
|
88 } |
|
89 |
|
90 // METHODS |
|
91 |
|
92 |
|
93 |
|
94 void UT_CRtpStream::SetupL( ) |
|
95 { |
|
96 TRtpPayloadType payloadType( 0 ); |
|
97 |
|
98 for ( TUint k = 0; k < KRtpMaxPayloadTypes; k++ ) |
|
99 { |
|
100 iProfileRTPTimeRates[k] = ( TUint32 ) KRtpPayloadClockConversions[k]; |
|
101 } |
|
102 |
|
103 iObs = this; |
|
104 |
|
105 iRecvStream = CRtpRecvStream::NewL( payloadType, |
|
106 1, // sessionId |
|
107 2, // rcvstreamid |
|
108 &iObs, |
|
109 this, |
|
110 iProfileRTPTimeRates, |
|
111 this ); |
|
112 |
|
113 iTranStream = CRtpTranStream::NewL( payloadType, |
|
114 1, // sessionId |
|
115 3, // transtreamid |
|
116 1000, // SSRC |
|
117 this, |
|
118 iProfileRTPTimeRates ); |
|
119 iExpectingExtensionPacket = EFalse; |
|
120 } |
|
121 |
|
122 void UT_CRtpStream::Teardown( ) |
|
123 { |
|
124 delete iRecvStream; |
|
125 delete iTranStream; |
|
126 } |
|
127 |
|
128 void UT_CRtpStream::UT_CRtpStream_ResetStreamStatL( ) |
|
129 { |
|
130 // RECEIVE STREAM |
|
131 |
|
132 // "Test description: Test the reset of statistics" ) ); |
|
133 // "CRtpRecvStream::ResetStreamStat()" ) ); |
|
134 |
|
135 // Create some arbitrary data |
|
136 iRecvStream->iNumReceivedPackets = 45; |
|
137 iRecvStream->iNumWrapAround = 3; |
|
138 iRecvStream->iSyncJitter.iLastPacketR = 45; |
|
139 iRecvStream->iSyncJitter.iLastPacketS = 45; |
|
140 iRecvStream->iSyncJitter.iJitterTime = 45; |
|
141 iRecvStream->iSyncJitter.iWaitTime = 45; |
|
142 iRecvStream->iRtcpStats.iRtcpReceiverStats.iFractionLost = 45; |
|
143 iRecvStream->iRtcpStats.iRtcpReceiverStats.iCumNumPacketsLost = 45; |
|
144 iRecvStream->iRtcpStats.iRtcpReceiverStats.iSeqNumReceived = 45; |
|
145 iRecvStream->iRtcpStats.iRtcpReceiverStats.iArrivalJitter = 45; |
|
146 iRecvStream->iRtcpStats.iRtcpReceiverStats.iRoundTripDelay = 45; |
|
147 iRecvStream->iRtcpStats.iRtcpReceiverStats.iBandwidth = 45; |
|
148 iRecvStream->iRtcpStats.iRtcpReceiverStats.iTxBandwidth = 45; |
|
149 iRecvStream->iRtcpStats.iRtcpReceiverStats.iChannelBufferSize = 45; |
|
150 |
|
151 // Do the reset |
|
152 iRecvStream->ResetStreamStat(); |
|
153 |
|
154 // Check the results |
|
155 if ( iRecvStream->iNumReceivedPackets != 0 || |
|
156 iRecvStream->iNumWrapAround != 0 || |
|
157 iRecvStream->iSyncJitter.iLastPacketR != 0 || |
|
158 iRecvStream->iSyncJitter.iLastPacketS != 0 || |
|
159 iRecvStream->iSyncJitter.iJitterTime != 0 || |
|
160 iRecvStream->iSyncJitter.iWaitTime != 0 || |
|
161 iRecvStream->iRtcpStats.iRtcpReceiverStats.iFractionLost != 0 || |
|
162 iRecvStream->iRtcpStats.iRtcpReceiverStats.iCumNumPacketsLost != 0 || |
|
163 iRecvStream->iRtcpStats.iRtcpReceiverStats.iSeqNumReceived != 0 || |
|
164 iRecvStream->iRtcpStats.iRtcpReceiverStats.iArrivalJitter != 0 || |
|
165 iRecvStream->iRtcpStats.iRtcpReceiverStats.iRoundTripDelay != 0 || |
|
166 iRecvStream->iRtcpStats.iRtcpReceiverStats.iChannelBufferSize != 0 || |
|
167 // maintain the bandwidth information |
|
168 iRecvStream->iRtcpStats.iRtcpReceiverStats.iBandwidth != 45 || |
|
169 iRecvStream->iRtcpStats.iRtcpReceiverStats.iTxBandwidth != 45 ) |
|
170 { |
|
171 // "Values incorrectly reset" ) ); |
|
172 // "CRtpRecvStream:ResetStreamStat() - FAILED" ) ); |
|
173 EUNIT_ASSERT(EFalse); |
|
174 } |
|
175 else |
|
176 { |
|
177 EUNIT_ASSERT(ETrue); |
|
178 } |
|
179 |
|
180 // TRANSMIT STREAM |
|
181 |
|
182 // "Test description: Test the reset of statistics" ) ); |
|
183 // "CRtpTranStream::ResetStreamStat()" ) ); |
|
184 |
|
185 // Create some arbitrary data |
|
186 iTranStream->iRtcpStats.iRtcpSenderStats.iNumPacketsSent = 1; |
|
187 iTranStream->iRtcpStats.iRtcpSenderStats.iCumNumOctetsSent = 2; |
|
188 iTranStream->iRtcpStats.iRtcpSenderStats.iNTPTimeStampSec = 3; |
|
189 iTranStream->iRtcpStats.iRtcpSenderStats.iNTPTimeStampFrac = 4; |
|
190 iTranStream->iRtcpStats.iRtcpSenderStats.iTimeStamp = 5; |
|
191 iTranStream->iFlagSentRTPPackets = 6; |
|
192 iTranStream->iFSentRtcpReport = 7; |
|
193 iTranStream->iCumNumOctetsSent = 8; |
|
194 iTranStream->iCumNumOctetsSent_last = 9; |
|
195 iTranStream->iPreviousTime = 10; |
|
196 iTranStream->iPreviousRemoteSN = 11; |
|
197 iTranStream->iRemoteBandwidth = 13; |
|
198 iTranStream->iSeqNumCycles = 14; |
|
199 iTranStream->iSN_size[0] = 15; |
|
200 iTranStream->iSN_size[1] = 16; |
|
201 |
|
202 // Do the reset |
|
203 iTranStream->ResetStreamStat(); |
|
204 |
|
205 // Check the results |
|
206 if ( iTranStream->iFlagSentRTPPackets != 0 || |
|
207 iTranStream->iFSentRtcpReport != 0 || |
|
208 iTranStream->iCumNumOctetsSent != 0 || |
|
209 iTranStream->iCumNumOctetsSent_last != 0 || |
|
210 iTranStream->iPreviousTime != 0 || |
|
211 iTranStream->iPreviousRemoteSN != 0 || |
|
212 iTranStream->iSeqNumCycles != 0 || |
|
213 iTranStream->iSN_size[0] != 0 || |
|
214 iTranStream->iSN_size[1] != 0 || |
|
215 iTranStream->iRtcpStats.iRtcpSenderStats.iNumPacketsSent != 0 || |
|
216 iTranStream->iRtcpStats.iRtcpSenderStats.iCumNumOctetsSent != 0 || |
|
217 iTranStream->iRtcpStats.iRtcpSenderStats.iNTPTimeStampSec != 0 || |
|
218 iTranStream->iRtcpStats.iRtcpSenderStats.iNTPTimeStampFrac != 0 || |
|
219 iTranStream->iRtcpStats.iRtcpSenderStats.iTimeStamp != 0 || |
|
220 // Preserve bandwidth information |
|
221 iTranStream->iRemoteBandwidth != 13 ) |
|
222 { |
|
223 // "Values incorrectly reset" ) ); |
|
224 // "CRtpTranStream:ResetStreamStat() - FAILED" ) ); |
|
225 EUNIT_ASSERT(EFalse); |
|
226 } |
|
227 else |
|
228 { |
|
229 EUNIT_ASSERT(ETrue); |
|
230 } |
|
231 } |
|
232 |
|
233 void UT_CRtpStream::UT_CRtpStream_FirstPkgL( ) |
|
234 { |
|
235 // THESE ARE THE GETTERS AND SETTERS OF CRtpStream, THE BASE CLASS |
|
236 |
|
237 // "Test description: Testing getters and setters" ) ); |
|
238 // "CRtpStream::SetFirstPkg( TBool )" ) ); |
|
239 |
|
240 // Store the previous value |
|
241 TBool tempBool( iRecvStream->iFlagFirstPkg ); |
|
242 |
|
243 // Initialise it |
|
244 iRecvStream->iFlagFirstPkg = EFalse; |
|
245 |
|
246 // Use the function |
|
247 iRecvStream->SetFirstPkg( ETrue ); |
|
248 |
|
249 // Run the test |
|
250 if ( iRecvStream->iFlagFirstPkg == EFalse ) |
|
251 { |
|
252 // "Setter did not update member value" ) ); |
|
253 // "CRtpStream::SetFirstPkg() - FAILED" ) ); |
|
254 EUNIT_ASSERT(EFalse); |
|
255 } |
|
256 else |
|
257 { |
|
258 EUNIT_ASSERT(ETrue); |
|
259 } |
|
260 |
|
261 // "CRtpStream::FirstPkg()" ) ); |
|
262 |
|
263 // Set it |
|
264 iRecvStream->iFlagFirstPkg = ETrue; |
|
265 |
|
266 // Run the test |
|
267 if ( !iRecvStream->FirstPkg() ) |
|
268 { |
|
269 // "Invalid return value" ) ); |
|
270 // "CRtpStream::FirstPkg() - FAILED" ) ); |
|
271 EUNIT_ASSERT(EFalse); |
|
272 } |
|
273 else |
|
274 { |
|
275 EUNIT_ASSERT(ETrue); |
|
276 } |
|
277 |
|
278 // Restore the previous value |
|
279 iRecvStream->iFlagFirstPkg = tempBool; |
|
280 |
|
281 /////////////////////////////////////////////////////////// |
|
282 |
|
283 // "CRtpStream::SetLocalSSRC( TRtpSSRC )" ) ); |
|
284 |
|
285 // Store the previous value |
|
286 TRtpSSRC tempSSRC( iRecvStream->iLocalSSRC ); |
|
287 |
|
288 // Initialise it |
|
289 iRecvStream->iLocalSSRC = 12; |
|
290 |
|
291 // Use the function |
|
292 iRecvStream->SetLocalSSRC( 13 ); |
|
293 |
|
294 // Run the test |
|
295 if ( iRecvStream->iLocalSSRC != 13 ) |
|
296 { |
|
297 // "Setter did not update member value" ) ); |
|
298 // "CRtpStream::SetLocalSSRC() - FAILED" ) ); |
|
299 EUNIT_ASSERT(EFalse); |
|
300 } |
|
301 else |
|
302 { |
|
303 EUNIT_ASSERT(ETrue); |
|
304 } |
|
305 |
|
306 // "CRtpStream::GetLocalSSRC()" ) ); |
|
307 |
|
308 // Initialise it |
|
309 iRecvStream->iLocalSSRC = 14; |
|
310 |
|
311 // Run the test |
|
312 if ( iRecvStream->GetLocalSSRC() != 14 ) |
|
313 { |
|
314 // "Invalid return value" ) ); |
|
315 // "CRtpStream::GetLocalSSRC() - FAILED" ) ); |
|
316 EUNIT_ASSERT(EFalse); |
|
317 } |
|
318 else |
|
319 { |
|
320 EUNIT_ASSERT(ETrue); |
|
321 } |
|
322 |
|
323 // Restore the previous value |
|
324 iRecvStream->iLocalSSRC = tempSSRC; |
|
325 |
|
326 /////////////////////////////////////////////////////////// |
|
327 |
|
328 // "CRtpStream::GetStreamID()" ) ); |
|
329 |
|
330 // Store the previous value |
|
331 TRtpId tempId( iRecvStream->iStreamId ); |
|
332 |
|
333 // Initialise it |
|
334 iRecvStream->iStreamId = 20; |
|
335 |
|
336 // Run the test |
|
337 if ( iRecvStream->GetStreamID() != 20 ) |
|
338 { |
|
339 // "Invalid return value" ) ); |
|
340 // "CRtpStream::GetStreamID() - FAILED" ) ); |
|
341 EUNIT_ASSERT(EFalse); |
|
342 } |
|
343 else |
|
344 { |
|
345 EUNIT_ASSERT(ETrue); |
|
346 } |
|
347 |
|
348 // Restore the previous value |
|
349 iRecvStream->iStreamId = tempId; |
|
350 |
|
351 /////////////////////////////////////////////////////////// |
|
352 |
|
353 // "CRtpStream::RtcpStats( TRtcpStats )" ) ); |
|
354 |
|
355 // Store the previous value |
|
356 TRtcpStats tempStats( iRecvStream->iRtcpStats ); |
|
357 |
|
358 TRtcpStats stats; |
|
359 TRtcpReceiverStats recvStats; |
|
360 TRtcpSenderStats sendStats; |
|
361 |
|
362 recvStats.iArrivalJitter = 1; |
|
363 recvStats.iBandwidth = 2; |
|
364 recvStats.iChannelBufferSize = 3; |
|
365 recvStats.iCumNumPacketsLost = 4; |
|
366 recvStats.iFractionLost = 5; |
|
367 recvStats.iRoundTripDelay = 6; |
|
368 recvStats.iSeqNumReceived = 7; |
|
369 recvStats.iSSRC = 8; |
|
370 recvStats.iTxBandwidth = 9; |
|
371 sendStats.iCumNumOctetsSent = 10; |
|
372 sendStats.iNTPTimeStampFrac = 11; |
|
373 sendStats.iNTPTimeStampSec = 12; |
|
374 sendStats.iNumPacketsSent = 13; |
|
375 sendStats.iSSRC = 14; |
|
376 sendStats.iTimeStamp = 15; |
|
377 stats.iRtcpReceiverStats = recvStats; |
|
378 stats.iRtcpSenderStats = sendStats; |
|
379 |
|
380 // Set the stats |
|
381 iRecvStream->iRtcpStats = stats; |
|
382 |
|
383 // Get the stats (function under test) |
|
384 TRtcpStats compareStats; |
|
385 iRecvStream->RtcpStats( compareStats ); |
|
386 |
|
387 // Compare |
|
388 if ( compareStats.iRtcpReceiverStats.iArrivalJitter != stats.iRtcpReceiverStats.iArrivalJitter || |
|
389 compareStats.iRtcpReceiverStats.iBandwidth != stats.iRtcpReceiverStats.iBandwidth || |
|
390 compareStats.iRtcpReceiverStats.iChannelBufferSize != stats.iRtcpReceiverStats.iChannelBufferSize || |
|
391 compareStats.iRtcpReceiverStats.iCumNumPacketsLost != stats.iRtcpReceiverStats.iCumNumPacketsLost || |
|
392 compareStats.iRtcpReceiverStats.iFractionLost != stats.iRtcpReceiverStats.iFractionLost || |
|
393 compareStats.iRtcpReceiverStats.iRoundTripDelay != stats.iRtcpReceiverStats.iRoundTripDelay || |
|
394 compareStats.iRtcpReceiverStats.iSeqNumReceived != stats.iRtcpReceiverStats.iSeqNumReceived || |
|
395 compareStats.iRtcpReceiverStats.iSSRC != stats.iRtcpReceiverStats.iSSRC || |
|
396 compareStats.iRtcpReceiverStats.iTxBandwidth != stats.iRtcpReceiverStats.iTxBandwidth || |
|
397 compareStats.iRtcpSenderStats.iCumNumOctetsSent != stats.iRtcpSenderStats.iCumNumOctetsSent || |
|
398 compareStats.iRtcpSenderStats.iNTPTimeStampFrac != stats.iRtcpSenderStats.iNTPTimeStampFrac || |
|
399 compareStats.iRtcpSenderStats.iNTPTimeStampSec != stats.iRtcpSenderStats.iNTPTimeStampSec || |
|
400 compareStats.iRtcpSenderStats.iNumPacketsSent != stats.iRtcpSenderStats.iNumPacketsSent || |
|
401 compareStats.iRtcpSenderStats.iSSRC != stats.iRtcpSenderStats.iSSRC || |
|
402 compareStats.iRtcpSenderStats.iTimeStamp != stats.iRtcpSenderStats.iTimeStamp ) |
|
403 { |
|
404 // "Invalid return value" ) ); |
|
405 // "CRtpStream::RtcpStats() - FAILED" ) ); |
|
406 EUNIT_ASSERT(EFalse); |
|
407 } |
|
408 else |
|
409 { |
|
410 EUNIT_ASSERT(ETrue); |
|
411 } |
|
412 |
|
413 /////////////////////////////////////////////////////////// |
|
414 // THESE ARE THE GETTERS AND SETTERS OF CRtpRecvStream |
|
415 |
|
416 // "CRtpRecvStream::SetReceivedRTPPackets( TRtpSSRC )" ) ); |
|
417 |
|
418 // Store the previous value |
|
419 TBool tempFlag( iRecvStream->iFlagReceivedRTPPackets ); |
|
420 |
|
421 // Initialise it |
|
422 iRecvStream->iFlagReceivedRTPPackets = EFalse; |
|
423 |
|
424 // Use the function |
|
425 iRecvStream->SetReceivedRTPPackets( ETrue ); |
|
426 |
|
427 // Run the test |
|
428 if ( !iRecvStream->iFlagReceivedRTPPackets ) |
|
429 { |
|
430 // "Setter did not update member value" ) ); |
|
431 // "CRtpRecvStream::SetReceivedRTPPackets() - FAILED" ) ); |
|
432 EUNIT_ASSERT(EFalse); |
|
433 } |
|
434 else |
|
435 { |
|
436 EUNIT_ASSERT(ETrue); |
|
437 } |
|
438 |
|
439 // "CRtpRecvStream::ReceivedRTPPackets()" ) ); |
|
440 |
|
441 // Initialise it |
|
442 iRecvStream->iFlagReceivedRTPPackets = ETrue; |
|
443 |
|
444 // Run the test |
|
445 if ( !iRecvStream->ReceivedRTPPackets() ) |
|
446 { |
|
447 // "Invalid return value" ) ); |
|
448 // "CRtpRecvStream::ReceivedRTPPackets() - FAILED" ) ); |
|
449 EUNIT_ASSERT(EFalse); |
|
450 } |
|
451 else |
|
452 { |
|
453 // "CRtpRecvStream::ReceivedRTPPackets() - passed" ) ); |
|
454 } |
|
455 |
|
456 // Restore the previous value |
|
457 iRecvStream->iFlagReceivedRTPPackets = tempFlag; |
|
458 |
|
459 /////////////////////////////////////////////////////////// |
|
460 // THESE ARE THE GETTERS AND SETTERS OF CRtpTranStream |
|
461 |
|
462 // "CRtpTranStream::SetSentRTPPackets( TBool )" ) ); |
|
463 |
|
464 // Store the previous value |
|
465 tempFlag = iTranStream->iFlagSentRTPPackets; |
|
466 |
|
467 // Initialise it |
|
468 iTranStream->iFlagSentRTPPackets = EFalse; |
|
469 |
|
470 // Use the function |
|
471 iTranStream->SetSentRTPPackets( ETrue ); |
|
472 |
|
473 // Run the test |
|
474 if ( !iTranStream->iFlagSentRTPPackets ) |
|
475 { |
|
476 // "Setter did not update member value" ) ); |
|
477 // "CRtpTranStream::SetSentRTPPackets() - FAILED" ) ); |
|
478 EUNIT_ASSERT(EFalse); |
|
479 } |
|
480 else |
|
481 { |
|
482 EUNIT_ASSERT(ETrue); |
|
483 } |
|
484 |
|
485 // "CRtpTranStream::SentRTPPackets()" ) ); |
|
486 |
|
487 // Initialise it |
|
488 iTranStream->iFlagSentRTPPackets = ETrue; |
|
489 |
|
490 // Run the test |
|
491 if ( !iTranStream->SentRTPPackets() ) |
|
492 { |
|
493 // "Invalid return value" ) ); |
|
494 // "CRtpTranStream::SentRTPPackets() - FAILED" ) ); |
|
495 EUNIT_ASSERT(EFalse); |
|
496 } |
|
497 else |
|
498 { |
|
499 EUNIT_ASSERT(ETrue); |
|
500 } |
|
501 |
|
502 // Restore the previous value |
|
503 iTranStream->iFlagSentRTPPackets = tempFlag; |
|
504 |
|
505 // "CRtpTranStream::SetRtcpReportFlag( TBool )" ) ); |
|
506 |
|
507 // Store the previous value |
|
508 tempFlag = iTranStream->iFSentRtcpReport; |
|
509 |
|
510 // Initialise it |
|
511 iTranStream->iFSentRtcpReport = EFalse; |
|
512 |
|
513 // Use the function |
|
514 iTranStream->SetRtcpReportFlag(); |
|
515 |
|
516 // Run the test |
|
517 if ( !iTranStream->iFSentRtcpReport ) |
|
518 { |
|
519 // "Setter did not update member value" ) ); |
|
520 // "CRtpTranStream::SetRtcpReportFlag() - FAILED" ) ); |
|
521 EUNIT_ASSERT(EFalse); |
|
522 } |
|
523 else |
|
524 { |
|
525 // "CRtpTranStream::SetRtcpReportFlag() - passed" ) ); |
|
526 } |
|
527 |
|
528 // "CRtpTranStream::ResetRtcpReportFlag()" ) ); |
|
529 |
|
530 // Initialise it |
|
531 iTranStream->iFSentRtcpReport = ETrue; |
|
532 |
|
533 // Use the function |
|
534 iTranStream->ResetRtcpReportFlag(); |
|
535 |
|
536 // Run the test |
|
537 if ( iTranStream->iFSentRtcpReport ) |
|
538 { |
|
539 // "Reset did not update member value" ) ); |
|
540 // "CRtpTranStream::ResetRtcpReportFlag() - FAILED" ) ); |
|
541 EUNIT_ASSERT(EFalse); |
|
542 } |
|
543 else |
|
544 { |
|
545 EUNIT_ASSERT(ETrue); |
|
546 } |
|
547 |
|
548 // "CRtpTranStream::SentRtcpReport()" ) ); |
|
549 |
|
550 // Initialise it |
|
551 iTranStream->iFSentRtcpReport = ETrue; |
|
552 |
|
553 // Run the test |
|
554 if ( !iTranStream->SentRtcpReport() ) |
|
555 { |
|
556 // "Invalid return value" ) ); |
|
557 // "CRtpTranStream::SentRtcpReport() - FAILED" ) ); |
|
558 EUNIT_ASSERT(EFalse); |
|
559 } |
|
560 else |
|
561 { |
|
562 EUNIT_ASSERT(ETrue); |
|
563 } |
|
564 |
|
565 // Restore the previous value |
|
566 iTranStream->iFSentRtcpReport = tempFlag; |
|
567 |
|
568 } |
|
569 |
|
570 void UT_CRtpStream::UT_CRtpStream_SetFirstPkgL( ) |
|
571 { |
|
572 EUNIT_ASSERT( ETrue ); |
|
573 } |
|
574 |
|
575 void UT_CRtpStream::UT_CRtpStream_GetLocalSSRCL( ) |
|
576 { |
|
577 EUNIT_ASSERT( ETrue); |
|
578 } |
|
579 |
|
580 void UT_CRtpStream::UT_CRtpStream_SetLocalSSRCL( ) |
|
581 { |
|
582 EUNIT_ASSERT( ETrue ); |
|
583 } |
|
584 |
|
585 void UT_CRtpStream::UT_CRtpStream_RegisterRtcpObserverL( ) |
|
586 { |
|
587 //EUNIT_ASSERT( EFalse ); |
|
588 } |
|
589 |
|
590 void UT_CRtpStream::UT_CRtpStream_UnRegisterRtcpObserverL( ) |
|
591 { |
|
592 //EUNIT_ASSERT( EFalse ); |
|
593 } |
|
594 |
|
595 void UT_CRtpStream::UT_CRtpStream_GetStreamIDL( ) |
|
596 { |
|
597 EUNIT_ASSERT( ETrue ); |
|
598 } |
|
599 |
|
600 void UT_CRtpStream::UT_CRtpStream_RtcpStatsL( ) |
|
601 { |
|
602 EUNIT_ASSERT( ETrue ); |
|
603 } |
|
604 |
|
605 void UT_CRtpStream::UT_CRtpStream_GetStreamStatL( ) |
|
606 { |
|
607 TBuf8<3> cName; |
|
608 TBuf8<3> userName; |
|
609 TBuf8<3> email; |
|
610 TBuf8<3> phoneNumber; |
|
611 TBuf8<3> location; |
|
612 TBuf8<3> swToolName; |
|
613 TBuf8<3> noticeStatus; |
|
614 TBuf8<3> privateStr; |
|
615 |
|
616 //"") ); |
|
617 // "Test description: Testing getting remote SDES info" ) ); |
|
618 // "CRtpRecvStream::GetRemoteStreamInfo( const TRtpSdesParams& )" ) ); |
|
619 |
|
620 // Create SDES |
|
621 cName.Format( _L8( "ab" ) ); |
|
622 cName.ZeroTerminate(); |
|
623 userName.Format( _L8( "bc" ) ); |
|
624 userName.ZeroTerminate(); |
|
625 email.Format( _L8( "cd" ) ); |
|
626 email.ZeroTerminate(); |
|
627 phoneNumber.Format( _L8( "de" ) ); |
|
628 phoneNumber.ZeroTerminate(); |
|
629 location.Format( _L8( "ef" ) ); |
|
630 location.ZeroTerminate(); |
|
631 swToolName.Format( _L8( "fg" ) ); |
|
632 swToolName.ZeroTerminate(); |
|
633 noticeStatus.Format( _L8( "gh" ) ); |
|
634 noticeStatus.ZeroTerminate(); |
|
635 privateStr.Format( _L8( "hi" ) ); |
|
636 privateStr.ZeroTerminate(); |
|
637 |
|
638 TRtpSdesParams params; |
|
639 params.iCName.Set( cName.Ptr() ); |
|
640 params.iUserName.Set( userName.Ptr() ); |
|
641 params.iEmail.Set( email.Ptr() ); |
|
642 params.iPhoneNumber.Set( phoneNumber.Ptr() ); |
|
643 params.iLocation.Set( location.Ptr() ); |
|
644 params.iSwToolName.Set( swToolName.Ptr() ); |
|
645 params.iNoticeStatus.Set( noticeStatus.Ptr() ); |
|
646 params.iPrivate.Set( privateStr.Ptr() ); |
|
647 |
|
648 // Set it |
|
649 iRecvStream->iRemoteSDES->SetSDES( params ); |
|
650 |
|
651 // Run the function |
|
652 TRtpSdesParams params2; |
|
653 iRecvStream->GetRemoteStreamInfo( params2 ); |
|
654 |
|
655 // Compare the results |
|
656 if ( params.iCName != cName |
|
657 || params.iUserName != userName |
|
658 || params.iEmail != email |
|
659 || params.iPhoneNumber != phoneNumber |
|
660 || params.iLocation != location |
|
661 || params.iSwToolName != swToolName |
|
662 || params.iNoticeStatus != noticeStatus |
|
663 || params.iPrivate != privateStr ) |
|
664 { |
|
665 // "Parameters incorrectly updated" ) ); |
|
666 // "CRtpRecvStream::GetRemoteStreamInfo() - FAILED" ) ); |
|
667 EUNIT_ASSERT( EFalse ); |
|
668 } |
|
669 |
|
670 // "CRtpRecvStream::GetRemoteStreamInfo() - passed" ) ); |
|
671 |
|
672 //"") ); |
|
673 // "Test description: Testing getting stream statistics" ) ); |
|
674 // "CRtpRecvStream::GetStreamStat( TRtpPeerStat& )" ) ); |
|
675 |
|
676 TRtpPeerStat stats; |
|
677 |
|
678 // Set some parameters |
|
679 iRecvStream->iRtcpStats.iRtcpSenderStats.iCumNumOctetsSent = 101; |
|
680 iRecvStream->iRtcpStats.iRtcpSenderStats.iNumPacketsSent = 102; |
|
681 iRecvStream->iRtcpStats.iRtcpReceiverStats.iTxBandwidth = 103; |
|
682 iRecvStream->iRtcpStats.iRtcpReceiverStats.iArrivalJitter = 104; |
|
683 iRecvStream->iRtcpStats.iRtcpReceiverStats.iCumNumPacketsLost = 105; |
|
684 iRecvStream->iRtcpStats.iRtcpReceiverStats.iFractionLost = 106; |
|
685 iRecvStream->iRtcpStats.iRtcpReceiverStats.iRoundTripDelay = 107; |
|
686 iRecvStream->iRtcpStats.iRtcpReceiverStats.iBandwidth = 108; |
|
687 iRecvStream->iRtcpStats.iRtcpReceiverStats.iChannelBufferSize = 109; |
|
688 |
|
689 // Get the info |
|
690 iRecvStream->GetStreamStat( stats ); |
|
691 |
|
692 // Compare it with our original data |
|
693 if ( stats.iCumNumOctetsSent != 101 || |
|
694 stats.iNumPacketsSent != 102 || |
|
695 stats.iTxBandwidth != 103 || |
|
696 stats.iArrivalJitter != 104 || |
|
697 stats.iCumNumPacketsLost != 105 || |
|
698 stats.iFractionLost != 106 || |
|
699 stats.iRoundTripDelay != 107 || |
|
700 stats.iRxBandwidth != 108 || |
|
701 stats.iChannelBufferSize != 109 ) |
|
702 { |
|
703 // "Parameters incorrectly updated" ) ); |
|
704 // "CRtpRecvStream::GetStreamStat() - FAILED" ) ); |
|
705 EUNIT_ASSERT( EFalse ); |
|
706 } |
|
707 } |
|
708 |
|
709 void UT_CRtpStream::UT_CRtpStream_RtpStreamProcessRtcpReportSectionL( ) |
|
710 { |
|
711 //"") ); |
|
712 // "Test description: Test creating and parsing an SR packet" ) ); |
|
713 // "CRtpTranStream::RtpStreamCreateRtcpReportSection( CRtpPacket* )" ) ); |
|
714 // "CRtpRecvStream::RtpStreamProcessRtcpReportSection( CRtpPacket* )" ) ); |
|
715 |
|
716 // Create a packet to work with |
|
717 TUint packetSize = 2048; |
|
718 CRtpPacket* packet = CRtpPacket::NewL( packetSize, iProfileRTPTimeRates ); |
|
719 CleanupStack::PushL( packet ); |
|
720 |
|
721 // Set some parameters |
|
722 iTranStream->iLocalSSRC = 1; |
|
723 iTranStream->iBaseSeqNum = 0; |
|
724 iTranStream->iSeqNumCycles = 0; |
|
725 iTranStream->iSeqNum = 2; |
|
726 iTranStream->iCumNumOctetsSent = 3; |
|
727 iTranStream->iTimeStamp = 4; |
|
728 |
|
729 // Create the RTCP report |
|
730 iTranStream->RtpStreamCreateRtcpReportSection( packet ); |
|
731 |
|
732 // Make sure the packet can be processed |
|
733 packet->RtpPacketResetPtr(); |
|
734 packet->iSize = 24; // size of SR section |
|
735 packet->SetType( ERTCP_SR ); |
|
736 |
|
737 // Process the report |
|
738 TRtpRtcpEnum error = iRecvStream->RtpStreamProcessRtcpReportSectionL( packet ); |
|
739 |
|
740 // Check the results |
|
741 if ( error != KErrNone ) |
|
742 { |
|
743 // "Error parsing SR packet" ) ); |
|
744 // "CRtpTranStream::RtpStreamCreateRtcpReportSection() - FAILED" ) ); |
|
745 // "CRtpRecvStream::RtpStreamProcessRtcpReportSection() - FAILED" ) ); |
|
746 CleanupStack::PopAndDestroy( packet ); |
|
747 EUNIT_ASSERT( EFalse ); |
|
748 } |
|
749 |
|
750 // Try again with an invalid packet type (RR) |
|
751 TRtpPacketStreamParam streamParam; |
|
752 TRtpPacketIOParam initParam; |
|
753 |
|
754 streamParam.TRTCP_RR.SSRC = 1; |
|
755 streamParam.TRTCP_RR.fractionLost = 2; |
|
756 streamParam.TRTCP_RR.cumNumPacketsLost = 3; |
|
757 streamParam.TRTCP_RR.seqNumReceived = 4; |
|
758 streamParam.TRTCP_RR.arrivalJitter = 0; |
|
759 initParam.TRTCP_RR.lastSRTimeStamp = 0; |
|
760 initParam.TRTCP_RR.delaySinceLSR = 0; |
|
761 |
|
762 //iTranStream->iSeqNum = 3; |
|
763 //iTranStream->iCumNumOctetsSent = 4; |
|
764 //iTranStream->iTimeStamp = 5; |
|
765 packet->RtpPacketReset(); |
|
766 //iTranStream->RtpStreamCreateRtcpReportSection( packet ); |
|
767 |
|
768 packet->RtpPacketBuildApp( &streamParam, &initParam ); |
|
769 |
|
770 packet->RtpPacketResetPtr(); |
|
771 packet->iSize = 24; // size of APP section |
|
772 packet->SetType( ERTCP_RR ); |
|
773 error = iRecvStream->RtpStreamProcessRtcpReportSectionL( packet ); |
|
774 |
|
775 // Check the results |
|
776 if ( error == KErrNone ) |
|
777 { |
|
778 // "Should have received error parsing SR packet" ) ); |
|
779 // "CRtpTranStream::RtpStreamCreateRtcpReportSection() - FAILED" ) ); |
|
780 // "CRtpRecvStream::RtpStreamProcessRtcpReportSection() - FAILED" ) ); |
|
781 CleanupStack::PopAndDestroy( packet ); |
|
782 EUNIT_ASSERT( EFalse ); |
|
783 } |
|
784 |
|
785 // "CRtpTranStream::RtpStreamCreateRtcpReportSection() - passed" ) ); |
|
786 // "CRtpRecvStream::RtpStreamProcessRtcpReportSection() - passed" ) ); |
|
787 |
|
788 CleanupStack::PopAndDestroy( packet ); |
|
789 } |
|
790 |
|
791 void UT_CRtpStream::UT_CRtpStream_RtpStreamCreateRtcpReportSectionL( ) |
|
792 { |
|
793 //"") ); |
|
794 // "Test description: Test creating and parsing an RR packet" ) ); |
|
795 // "CRtpRecvStream::RtpStreamCreateRtcpReportSection( CRtpPacket* )" ) ); |
|
796 // "CRtpTranStream::RtpStreamProcessRtcpReportSection( CRtpPacket* )" ) ); |
|
797 // Create a packet to work with |
|
798 TUint packetSize = 2048; |
|
799 CRtpPacket* packet = CRtpPacket::NewL( packetSize, iProfileRTPTimeRates ); |
|
800 CleanupStack::PushL( packet ); |
|
801 |
|
802 // Set some parameters |
|
803 iRecvStream->iSeqNum = 0; |
|
804 iRecvStream->iBaseSeqNum = 0; |
|
805 iRecvStream->iSeqNumCycles = 0; |
|
806 iRecvStream->iNumWrapAround = 0; |
|
807 iRecvStream->iLastRR_numExpectedPackets = 1; |
|
808 iRecvStream->iSyncJitter.iTimeStampResolution = 0; |
|
809 iRecvStream->iNumReceivedPackets = 5; |
|
810 |
|
811 // Create the RTCP report |
|
812 iRecvStream->RtpStreamCreateRtcpReportSection( packet ); |
|
813 |
|
814 // Make sure the packet can be processed |
|
815 packet->RtpPacketResetPtr(); |
|
816 packet->iSize = 24; // size of SR section |
|
817 packet->SetType( ERTCP_RR ); |
|
818 |
|
819 // Process the report |
|
820 TRtpRtcpEnum error = iTranStream->RtpStreamProcessRtcpReportSectionL( packet ); |
|
821 |
|
822 // Check the results |
|
823 if ( error != KErrNone ) |
|
824 { |
|
825 // "Error parsing RR packet" ) ); |
|
826 // "CRtpRecvStream::RtpStreamCreateRtcpReportSection() - FAILED" ) ); |
|
827 // "CRtpTranStream::RtpStreamProcessRtcpReportSection() - FAILED" ) ); |
|
828 CleanupStack::PopAndDestroy( packet ); |
|
829 EUNIT_ASSERT( EFalse ); |
|
830 } |
|
831 |
|
832 // Set some parameters differently to reach more branches |
|
833 iRecvStream->iNumReceivedPackets = 0; |
|
834 iRecvStream->iLastRR_numExpectedPackets = 0; |
|
835 iRecvStream->iSyncJitter.iTimeStampResolution = 10; |
|
836 |
|
837 // Create the RTCP report |
|
838 iRecvStream->RtpStreamCreateRtcpReportSection( packet ); |
|
839 |
|
840 // Make sure the packet can be processed |
|
841 packet->RtpPacketResetPtr(); |
|
842 packet->iSize = 24; // size of SR section |
|
843 packet->SetType( ERTCP_RR ); |
|
844 |
|
845 // Process the report |
|
846 error = iTranStream->RtpStreamProcessRtcpReportSectionL( packet ); |
|
847 |
|
848 // Check the results |
|
849 if ( error != KErrNone ) |
|
850 { |
|
851 // "Error parsing RR packet" ) ); |
|
852 // "CRtpRecvStream::RtpStreamCreateRtcpReportSection() - FAILED" ) ); |
|
853 // "CRtpTranStream::RtpStreamProcessRtcpReportSection() - FAILED" ) ); |
|
854 CleanupStack::PopAndDestroy( packet ); |
|
855 EUNIT_ASSERT( EFalse ); |
|
856 } |
|
857 |
|
858 // Set some parameters differently to reach more branches |
|
859 iRecvStream->iLastRR_numExpectedPackets = 0xFFFF0000; |
|
860 |
|
861 // Create the RTCP report |
|
862 iRecvStream->RtpStreamCreateRtcpReportSection( packet ); |
|
863 |
|
864 // Make sure the packet can be processed |
|
865 packet->RtpPacketResetPtr(); |
|
866 packet->iSize = 24; // size of SR section |
|
867 packet->SetType( ERTCP_RR ); |
|
868 |
|
869 // Process the report |
|
870 error = iTranStream->RtpStreamProcessRtcpReportSectionL( packet ); |
|
871 |
|
872 // Check the results |
|
873 if ( error != KErrNone ) |
|
874 { |
|
875 // "Error parsing RR packet" ) ); |
|
876 // "CRtpRecvStream::RtpStreamCreateRtcpReportSection() - FAILED" ) ); |
|
877 // "CRtpTranStream::RtpStreamProcessRtcpReportSection() - FAILED" ) ); |
|
878 CleanupStack::PopAndDestroy( packet ); |
|
879 EUNIT_ASSERT( EFalse ); |
|
880 } |
|
881 |
|
882 // "CRtpRecvStream::RtpStreamCreateRtcpReportSection() - passed" ) ); |
|
883 // "CRtpTranStream::RtpStreamProcessRtcpReportSection() - passed" ) ); |
|
884 |
|
885 CleanupStack::PopAndDestroy( packet ); |
|
886 } |
|
887 |
|
888 void UT_CRtpStream::UT_CRtpStream_UpdateParam() |
|
889 { |
|
890 |
|
891 // "Test description: Test update of statistics" ) ); |
|
892 // "CRtpStream::RtpStreamUpdateParam( TRtpPacketType, TRtpPacketStreamParam* )" ) ); |
|
893 |
|
894 // Set some values |
|
895 TRtpPacketType type( ERTCP_HEADER ); // invalid |
|
896 TRtpPacketStreamParam param; |
|
897 |
|
898 // Run the function. This should fail |
|
899 TInt result( iRecvStream->RtpStreamUpdateParamL( type, ¶m ) ); |
|
900 |
|
901 if ( result == KErrNone ) |
|
902 { |
|
903 // "Function should only process ERTP type packets" ) ); |
|
904 // "CRtpStream::RtpStreamUpdateParam() - FAILED" ) ); |
|
905 EUNIT_ASSERT(EFalse); |
|
906 } |
|
907 |
|
908 // Set some values |
|
909 type = ERTP; // valid |
|
910 iRecvStream->iFlagFirstPkg = EFalse; |
|
911 param.TRTP.SSRC = 10; // different from iRecvStream->iSSRC |
|
912 |
|
913 // Run the function. This should fail |
|
914 result = iRecvStream->RtpStreamUpdateParamL( type, ¶m ); |
|
915 |
|
916 if ( result == KErrNone ) |
|
917 { |
|
918 // "Function should only proceed if SSRC matches" ) ); |
|
919 // "CRtpStream::RtpStreamUpdateParam() - FAILED" ) ); |
|
920 EUNIT_ASSERT(EFalse); |
|
921 } |
|
922 |
|
923 // Set some values |
|
924 iRecvStream->iFlagFirstPkg = ETrue; |
|
925 iRecvStream->iRemoteSSRC = param.TRTP.SSRC = 10; |
|
926 param.TRTP.payload = 100; // This should make iRecvStream->iSyncJitter.iTimeStampResolution 0 |
|
927 param.TRTP.seqNum = 30; |
|
928 param.TRTP.timeStamp = 40; |
|
929 TInt prevRecvPackets( iRecvStream->iNumReceivedPackets ); |
|
930 |
|
931 // Run the function |
|
932 result = iRecvStream->RtpStreamUpdateParamL( type, ¶m ); |
|
933 |
|
934 if ( result != KErrNone || |
|
935 iRecvStream->iRemoteSSRC != param.TRTP.SSRC || |
|
936 iRecvStream->iPayload != param.TRTP.payload || |
|
937 iRecvStream->iBaseSeqNum != param.TRTP.seqNum || |
|
938 //iRecvStream->iBaseTimeStamp != param.TRTP.timeStamp || |
|
939 iRecvStream->iSyncJitter.iTimeStampResolution != 0 || |
|
940 iRecvStream->iSeqNumCycles != 0 || |
|
941 iRecvStream->iSeqNum != param.TRTP.seqNum || |
|
942 iRecvStream->iTimeStamp != param.TRTP.timeStamp || |
|
943 iRecvStream->iFlagFirstPkg != EFalse || |
|
944 iRecvStream->iNumReceivedPackets != prevRecvPackets + 1 ) |
|
945 { |
|
946 // "Parameters not properly updated (1)" ) ); |
|
947 // "CRtpStream::RtpStreamUpdateParam() - FAILED" ) ); |
|
948 EUNIT_ASSERT(EFalse); |
|
949 } |
|
950 |
|
951 iRecvStream->iFlagFirstPkg = ETrue; |
|
952 param.TRTP.payload = 5; // This should make iRecvStream->iSyncJitter.iTimeStampResolution != 0 |
|
953 |
|
954 // Run the function |
|
955 result = iRecvStream->RtpStreamUpdateParamL( type, ¶m ); |
|
956 if ( result != KErrNone || |
|
957 iRecvStream->iSyncJitter.iTimeStampResolution == 0 ) |
|
958 { |
|
959 // "Parameters not properly updated (2)" ) ); |
|
960 // "CRtpStream::RtpStreamUpdateParam() - FAILED" ) ); |
|
961 EUNIT_ASSERT(EFalse); |
|
962 } |
|
963 |
|
964 EUNIT_ASSERT(ETrue); |
|
965 } |
|
966 |
|
967 void UT_CRtpStream::UT_CRtpStream_RtpByeAppMethods() |
|
968 { |
|
969 //"") ); |
|
970 // "Test description: Test creating a BYE packet" ) ); |
|
971 // "CRtpTranStream::BuildRtcpBYEPacket( const TDesC8&, CRtpPacket* )" ) ); |
|
972 |
|
973 // Create a packet to work with |
|
974 TUint packetSize = 2048; |
|
975 CRtpPacket* packet = CRtpPacket::NewL( packetSize, iProfileRTPTimeRates ); |
|
976 CleanupStack::PushL( packet ); |
|
977 |
|
978 // Create the BYE packet |
|
979 TBuf8<15> reason; |
|
980 reason.Format( _L8( "Hello" ) ); |
|
981 TInt error( KErrNone ); |
|
982 error = iTranStream->BuildRtcpBYEPacket( reason, packet ); |
|
983 |
|
984 // Check the results (can't really verify anything here) |
|
985 if ( error != KErrNone ) |
|
986 { |
|
987 // "BYE packet creation failed" ) ); |
|
988 // "CRtpTranStream::BuildRtcpBYEPacket() - FAILED" ) ); |
|
989 CleanupStack::PopAndDestroy( packet ); |
|
990 EUNIT_ASSERT(EFalse); |
|
991 } |
|
992 |
|
993 // "CRtpTranStream::BuildRtcpBYEPacket() - passed" ) ); |
|
994 |
|
995 //"") ); |
|
996 // "Test description: Test creating an APP packet" ) ); |
|
997 // "CRtpTranStream::BuildRtcpAPPPacket( const TRtcpApp&, CRtpPacket* )" ) ); |
|
998 |
|
999 // Create the APP packet |
|
1000 TRtcpApp app; |
|
1001 app.iName[0] = 'a'; |
|
1002 app.iName[1] = 'b'; |
|
1003 app.iName[2] = 'c'; |
|
1004 app.iName[3] = 'd'; |
|
1005 app.iAppData[0] = 'e'; |
|
1006 app.iAppData[1] = 'f'; |
|
1007 app.iAppDataLen = 2; |
|
1008 |
|
1009 error = iTranStream->BuildRtcpAPPPacket( app, packet ); |
|
1010 |
|
1011 // Check the results (can't really verify anything here) |
|
1012 if ( error != KErrNone ) |
|
1013 { |
|
1014 // "APP packet creation failed" ) ); |
|
1015 // "CRtpTranStream::BuildRtcpAppPacket() - FAILED" ) ); |
|
1016 CleanupStack::PopAndDestroy( packet ); |
|
1017 EUNIT_ASSERT(EFalse); |
|
1018 } |
|
1019 |
|
1020 // "CRtpTranStream::BuildRtcpAPPPacket() - passed" ) ); |
|
1021 |
|
1022 CleanupStack::PopAndDestroy( packet ); |
|
1023 EUNIT_ASSERT(ETrue); |
|
1024 } |
|
1025 |
|
1026 void UT_CRtpStream::UT_CRtpStream_TestRtpSRMethods() |
|
1027 { |
|
1028 //"") ); |
|
1029 // "Test description: Test creating and parsing an SR packet" ) ); |
|
1030 // "CRtpTranStream::RtpStreamCreateRtcpReportSection( CRtpPacket* )" ) ); |
|
1031 // "CRtpRecvStream::RtpStreamProcessRtcpReportSection( CRtpPacket* )" ) ); |
|
1032 |
|
1033 // Create a packet to work with |
|
1034 TUint packetSize = 2048; |
|
1035 CRtpPacket* packet = CRtpPacket::NewL( packetSize, iProfileRTPTimeRates ); |
|
1036 CleanupStack::PushL( packet ); |
|
1037 |
|
1038 // Set some parameters |
|
1039 iTranStream->iLocalSSRC = 1; |
|
1040 iTranStream->iBaseSeqNum = 0; |
|
1041 iTranStream->iSeqNumCycles = 0; |
|
1042 iTranStream->iSeqNum = 2; |
|
1043 iTranStream->iCumNumOctetsSent = 3; |
|
1044 iTranStream->iTimeStamp = 4; |
|
1045 |
|
1046 // Create the RTCP report |
|
1047 iTranStream->RtpStreamCreateRtcpReportSection( packet ); |
|
1048 |
|
1049 // Make sure the packet can be processed |
|
1050 packet->RtpPacketResetPtr(); |
|
1051 packet->iSize = 24; // size of SR section |
|
1052 packet->SetType( ERTCP_SR ); |
|
1053 |
|
1054 // Process the report |
|
1055 TRtpRtcpEnum error = iRecvStream->RtpStreamProcessRtcpReportSectionL( packet ); |
|
1056 |
|
1057 // Check the results |
|
1058 if ( error != KErrNone ) |
|
1059 { |
|
1060 // "Error parsing SR packet" ) ); |
|
1061 // "CRtpTranStream::RtpStreamCreateRtcpReportSection() - FAILED" ) ); |
|
1062 // "CRtpRecvStream::RtpStreamProcessRtcpReportSection() - FAILED" ) ); |
|
1063 CleanupStack::PopAndDestroy( packet ); |
|
1064 EUNIT_ASSERT(EFalse); |
|
1065 } |
|
1066 |
|
1067 // Try again with an invalid packet type (RR) |
|
1068 TRtpPacketStreamParam streamParam; |
|
1069 TRtpPacketIOParam initParam; |
|
1070 |
|
1071 streamParam.TRTCP_RR.SSRC = 1; |
|
1072 streamParam.TRTCP_RR.fractionLost = 2; |
|
1073 streamParam.TRTCP_RR.cumNumPacketsLost = 3; |
|
1074 streamParam.TRTCP_RR.seqNumReceived = 4; |
|
1075 streamParam.TRTCP_RR.arrivalJitter = 0; |
|
1076 initParam.TRTCP_RR.lastSRTimeStamp = 0; |
|
1077 initParam.TRTCP_RR.delaySinceLSR = 0; |
|
1078 |
|
1079 //iTranStream->iSeqNum = 3; |
|
1080 //iTranStream->iCumNumOctetsSent = 4; |
|
1081 //iTranStream->iTimeStamp = 5; |
|
1082 packet->RtpPacketReset(); |
|
1083 //iTranStream->RtpStreamCreateRtcpReportSection( packet ); |
|
1084 |
|
1085 packet->RtpPacketBuildApp( &streamParam, &initParam ); |
|
1086 |
|
1087 packet->RtpPacketResetPtr(); |
|
1088 packet->iSize = 24; // size of APP section |
|
1089 packet->SetType( ERTCP_RR ); |
|
1090 error = iRecvStream->RtpStreamProcessRtcpReportSectionL( packet ); |
|
1091 |
|
1092 // Check the results |
|
1093 if ( error == KErrNone ) |
|
1094 { |
|
1095 // "Should have received error parsing SR packet" ) ); |
|
1096 // "CRtpTranStream::RtpStreamCreateRtcpReportSection() - FAILED" ) ); |
|
1097 // "CRtpRecvStream::RtpStreamProcessRtcpReportSection() - FAILED" ) ); |
|
1098 CleanupStack::PopAndDestroy( packet ); |
|
1099 EUNIT_ASSERT(EFalse); |
|
1100 } |
|
1101 |
|
1102 // "CRtpTranStream::RtpStreamCreateRtcpReportSection() - passed" ) ); |
|
1103 // "CRtpRecvStream::RtpStreamProcessRtcpReportSection() - passed" ) ); |
|
1104 |
|
1105 CleanupStack::PopAndDestroy( packet ); |
|
1106 EUNIT_ASSERT(ETrue); |
|
1107 } |
|
1108 |
|
1109 void UT_CRtpStream::UT_CRtpStream_TestRtpRRMethods() |
|
1110 { |
|
1111 //"") ); |
|
1112 // "Test description: Test creating and parsing an RR packet" ) ); |
|
1113 // "CRtpRecvStream::RtpStreamCreateRtcpReportSection( CRtpPacket* )" ) ); |
|
1114 // "CRtpTranStream::RtpStreamProcessRtcpReportSection( CRtpPacket* )" ) ); |
|
1115 // Create a packet to work with |
|
1116 TUint packetSize = 2048; |
|
1117 CRtpPacket* packet = CRtpPacket::NewL( packetSize, iProfileRTPTimeRates ); |
|
1118 CleanupStack::PushL( packet ); |
|
1119 |
|
1120 // Set some parameters |
|
1121 iRecvStream->iSeqNum = 0; |
|
1122 iRecvStream->iBaseSeqNum = 0; |
|
1123 iRecvStream->iSeqNumCycles = 0; |
|
1124 iRecvStream->iNumWrapAround = 0; |
|
1125 iRecvStream->iLastRR_numExpectedPackets = 1; |
|
1126 iRecvStream->iSyncJitter.iTimeStampResolution = 0; |
|
1127 iRecvStream->iNumReceivedPackets = 5; |
|
1128 |
|
1129 // Create the RTCP report |
|
1130 iRecvStream->RtpStreamCreateRtcpReportSection( packet ); |
|
1131 |
|
1132 // Make sure the packet can be processed |
|
1133 packet->RtpPacketResetPtr(); |
|
1134 packet->iSize = 24; // size of SR section |
|
1135 packet->SetType( ERTCP_RR ); |
|
1136 |
|
1137 // Process the report |
|
1138 TRtpRtcpEnum error = iTranStream->RtpStreamProcessRtcpReportSectionL( packet ); |
|
1139 |
|
1140 // Check the results |
|
1141 if ( error != KErrNone ) |
|
1142 { |
|
1143 // "Error parsing RR packet" ) ); |
|
1144 // "CRtpRecvStream::RtpStreamCreateRtcpReportSection() - FAILED" ) ); |
|
1145 // "CRtpTranStream::RtpStreamProcessRtcpReportSection() - FAILED" ) ); |
|
1146 CleanupStack::PopAndDestroy( packet ); |
|
1147 EUNIT_ASSERT(EFalse); |
|
1148 } |
|
1149 |
|
1150 // Set some parameters differently to reach more branches |
|
1151 iRecvStream->iNumReceivedPackets = 0; |
|
1152 iRecvStream->iLastRR_numExpectedPackets = 0; |
|
1153 iRecvStream->iSyncJitter.iTimeStampResolution = 10; |
|
1154 |
|
1155 // Create the RTCP report |
|
1156 iRecvStream->RtpStreamCreateRtcpReportSection( packet ); |
|
1157 |
|
1158 // Make sure the packet can be processed |
|
1159 packet->RtpPacketResetPtr(); |
|
1160 packet->iSize = 24; // size of SR section |
|
1161 packet->SetType( ERTCP_RR ); |
|
1162 |
|
1163 // Process the report |
|
1164 error = iTranStream->RtpStreamProcessRtcpReportSectionL( packet ); |
|
1165 |
|
1166 // Check the results |
|
1167 if ( error != KErrNone ) |
|
1168 { |
|
1169 // "Error parsing RR packet" ) ); |
|
1170 // "CRtpRecvStream::RtpStreamCreateRtcpReportSection() - FAILED" ) ); |
|
1171 // "CRtpTranStream::RtpStreamProcessRtcpReportSection() - FAILED" ) ); |
|
1172 CleanupStack::PopAndDestroy( packet ); |
|
1173 EUNIT_ASSERT(EFalse); |
|
1174 } |
|
1175 |
|
1176 // Set some parameters differently to reach more branches |
|
1177 iRecvStream->iLastRR_numExpectedPackets = 0xFFFF0000; |
|
1178 |
|
1179 // Create the RTCP report |
|
1180 iRecvStream->RtpStreamCreateRtcpReportSection( packet ); |
|
1181 |
|
1182 // Make sure the packet can be processed |
|
1183 packet->RtpPacketResetPtr(); |
|
1184 packet->iSize = 24; // size of SR section |
|
1185 packet->SetType( ERTCP_RR ); |
|
1186 |
|
1187 // Process the report |
|
1188 error = iTranStream->RtpStreamProcessRtcpReportSectionL( packet ); |
|
1189 |
|
1190 // Check the results |
|
1191 if ( error != KErrNone ) |
|
1192 { |
|
1193 // "Error parsing RR packet" ) ); |
|
1194 // "CRtpRecvStream::RtpStreamCreateRtcpReportSection() - FAILED" ) ); |
|
1195 // "CRtpTranStream::RtpStreamProcessRtcpReportSection() - FAILED" ) ); |
|
1196 CleanupStack::PopAndDestroy( packet ); |
|
1197 EUNIT_ASSERT(EFalse); |
|
1198 } |
|
1199 |
|
1200 // "CRtpRecvStream::RtpStreamCreateRtcpReportSection() - passed" ) ); |
|
1201 // "CRtpTranStream::RtpStreamProcessRtcpReportSection() - passed" ) ); |
|
1202 |
|
1203 CleanupStack::PopAndDestroy( packet ); |
|
1204 EUNIT_ASSERT(ETrue); |
|
1205 } |
|
1206 |
|
1207 // ----------------------------------------------------------------------------- |
|
1208 // Test BYE and APP related methods of CRtpTranStream |
|
1209 // ----------------------------------------------------------------------------- |
|
1210 // |
|
1211 void UT_CRtpStream::UT_CRtpStream_TestStreamStatAndSdesMethods() |
|
1212 { |
|
1213 TBuf8<3> cName; |
|
1214 TBuf8<3> userName; |
|
1215 TBuf8<3> email; |
|
1216 TBuf8<3> phoneNumber; |
|
1217 TBuf8<3> location; |
|
1218 TBuf8<3> swToolName; |
|
1219 TBuf8<3> noticeStatus; |
|
1220 TBuf8<3> privateStr; |
|
1221 |
|
1222 //"") ); |
|
1223 // "Test description: Testing getting remote SDES info" ) ); |
|
1224 // "CRtpRecvStream::GetRemoteStreamInfo( const TRtpSdesParams& )" ) ); |
|
1225 |
|
1226 // Create SDES |
|
1227 cName.Format( _L8( "ab" ) ); |
|
1228 cName.ZeroTerminate(); |
|
1229 userName.Format( _L8( "bc" ) ); |
|
1230 userName.ZeroTerminate(); |
|
1231 email.Format( _L8( "cd" ) ); |
|
1232 email.ZeroTerminate(); |
|
1233 phoneNumber.Format( _L8( "de" ) ); |
|
1234 phoneNumber.ZeroTerminate(); |
|
1235 location.Format( _L8( "ef" ) ); |
|
1236 location.ZeroTerminate(); |
|
1237 swToolName.Format( _L8( "fg" ) ); |
|
1238 swToolName.ZeroTerminate(); |
|
1239 noticeStatus.Format( _L8( "gh" ) ); |
|
1240 noticeStatus.ZeroTerminate(); |
|
1241 privateStr.Format( _L8( "hi" ) ); |
|
1242 privateStr.ZeroTerminate(); |
|
1243 |
|
1244 TRtpSdesParams params; |
|
1245 params.iCName.Set( cName.Ptr() ); |
|
1246 params.iUserName.Set( userName.Ptr() ); |
|
1247 params.iEmail.Set( email.Ptr() ); |
|
1248 params.iPhoneNumber.Set( phoneNumber.Ptr() ); |
|
1249 params.iLocation.Set( location.Ptr() ); |
|
1250 params.iSwToolName.Set( swToolName.Ptr() ); |
|
1251 params.iNoticeStatus.Set( noticeStatus.Ptr() ); |
|
1252 params.iPrivate.Set( privateStr.Ptr() ); |
|
1253 |
|
1254 // Set it |
|
1255 iRecvStream->iRemoteSDES->SetSDES( params ); |
|
1256 |
|
1257 // Run the function |
|
1258 TRtpSdesParams params2; |
|
1259 iRecvStream->GetRemoteStreamInfo( params2 ); |
|
1260 |
|
1261 // Compare the results |
|
1262 if ( params.iCName != cName |
|
1263 || params.iUserName != userName |
|
1264 || params.iEmail != email |
|
1265 || params.iPhoneNumber != phoneNumber |
|
1266 || params.iLocation != location |
|
1267 || params.iSwToolName != swToolName |
|
1268 || params.iNoticeStatus != noticeStatus |
|
1269 || params.iPrivate != privateStr ) |
|
1270 { |
|
1271 // "Parameters incorrectly updated" ) ); |
|
1272 // "CRtpRecvStream::GetRemoteStreamInfo() - FAILED" ) ); |
|
1273 EUNIT_ASSERT(EFalse); |
|
1274 } |
|
1275 |
|
1276 // "CRtpRecvStream::GetRemoteStreamInfo() - passed" ) ); |
|
1277 |
|
1278 //"") ); |
|
1279 // "Test description: Testing getting stream statistics" ) ); |
|
1280 // "CRtpRecvStream::GetStreamStat( TRtpPeerStat& )" ) ); |
|
1281 |
|
1282 TRtpPeerStat stats; |
|
1283 |
|
1284 // Set some parameters |
|
1285 iRecvStream->iRtcpStats.iRtcpSenderStats.iCumNumOctetsSent = 101; |
|
1286 iRecvStream->iRtcpStats.iRtcpSenderStats.iNumPacketsSent = 102; |
|
1287 iRecvStream->iRtcpStats.iRtcpReceiverStats.iTxBandwidth = 103; |
|
1288 iRecvStream->iRtcpStats.iRtcpReceiverStats.iArrivalJitter = 104; |
|
1289 iRecvStream->iRtcpStats.iRtcpReceiverStats.iCumNumPacketsLost = 105; |
|
1290 iRecvStream->iRtcpStats.iRtcpReceiverStats.iFractionLost = 106; |
|
1291 iRecvStream->iRtcpStats.iRtcpReceiverStats.iRoundTripDelay = 107; |
|
1292 iRecvStream->iRtcpStats.iRtcpReceiverStats.iBandwidth = 108; |
|
1293 iRecvStream->iRtcpStats.iRtcpReceiverStats.iChannelBufferSize = 109; |
|
1294 |
|
1295 // Get the info |
|
1296 iRecvStream->GetStreamStat( stats ); |
|
1297 |
|
1298 // Compare it with our original data |
|
1299 if ( stats.iCumNumOctetsSent != 101 || |
|
1300 stats.iNumPacketsSent != 102 || |
|
1301 stats.iTxBandwidth != 103 || |
|
1302 stats.iArrivalJitter != 104 || |
|
1303 stats.iCumNumPacketsLost != 105 || |
|
1304 stats.iFractionLost != 106 || |
|
1305 stats.iRoundTripDelay != 107 || |
|
1306 stats.iRxBandwidth != 108 || |
|
1307 stats.iChannelBufferSize != 109 ) |
|
1308 { |
|
1309 // "Parameters incorrectly updated" ) ); |
|
1310 // "CRtpRecvStream::GetStreamStat() - FAILED" ) ); |
|
1311 EUNIT_ASSERT(EFalse); |
|
1312 } |
|
1313 |
|
1314 EUNIT_ASSERT(ETrue); |
|
1315 } |
|
1316 |
|
1317 void UT_CRtpStream::UT_CRtpStream_RtpStreamProcessRtpPacket() |
|
1318 { |
|
1319 TInt result(KErrNone); |
|
1320 TInt error(KErrNone); |
|
1321 |
|
1322 CRtpPacket* pktSnd = CRtpPacket::NewL( KMaxRtpPacketSize, iProfileRTPTimeRates ); |
|
1323 CleanupStack::PushL( pktSnd ); |
|
1324 // "Test description: build a RTP packet" ) ); |
|
1325 // "CRtpPacket::RtpPacketBuildRtp( &streamParam, &initParam )" )); |
|
1326 |
|
1327 ///////////////////////TEST CASE 1/////////////////////////////////// |
|
1328 TRtpPacketStreamParam iStreamParam; |
|
1329 TRtpPacketIOParam iIoParam; |
|
1330 |
|
1331 |
|
1332 pktSnd->RtpPacketReset(); |
|
1333 pktSnd->RtpPacketResetPtr(); |
|
1334 pktSnd->SetType( ERTP ); |
|
1335 |
|
1336 TBuf8<15> data; |
|
1337 data.Format( _L8( "12345678" ) ); |
|
1338 data.Append( _L8( "9" ) ); |
|
1339 |
|
1340 iIoParam.TRTP.extension.data = const_cast<TUint8*>(data.Ptr()); |
|
1341 iIoParam.TRTP.extension.length = data.Length(); |
|
1342 result = pktSnd->RtpPacketBuild( &iStreamParam, &iIoParam ); |
|
1343 result = iRecvStream->RtpStreamProcessRtpPacketL(pktSnd, EFalse); |
|
1344 EUNIT_ASSERT( result == KErrNone ); |
|
1345 CleanupStack::PopAndDestroy( pktSnd ); |
|
1346 } |
|
1347 |
|
1348 //From Observer |
|
1349 void UT_CRtpStream::RtpPacketReceived( TRtpId /*aStreamId*/, |
|
1350 const TRtpRecvHeader& aHeaderInfo, |
|
1351 const TDesC8& /*aPayloadData*/ ) |
|
1352 { |
|
1353 |
|
1354 if ( iExpectingExtensionPacket ) |
|
1355 { |
|
1356 if ( aHeaderInfo.iExtension == 0 ) |
|
1357 { |
|
1358 // "Extension indicator was 0" )); |
|
1359 // "CRtpStream::RtpStreamProcessRtpPacket() - FAILED" ) ); |
|
1360 User::Panic( _L("CRtpUtStream"), KErrGeneral ); |
|
1361 } |
|
1362 if ( aHeaderInfo.iHeaderExtension == NULL ) |
|
1363 { |
|
1364 // "Header extension was null" )); |
|
1365 // "CRtpStream::RtpStreamProcessRtpPacket() - FAILED" ) ); |
|
1366 User::Panic( _L("CRtpUtStream"), KErrGeneral ); |
|
1367 } |
|
1368 if ( aHeaderInfo.iHeaderExtension->iType != KExtType || |
|
1369 aHeaderInfo.iHeaderExtension->iLength != KExtLength / 4 ) |
|
1370 { |
|
1371 // "Invalid header extension values" )); |
|
1372 // "CRtpStream::RtpStreamProcessRtpPacket() - FAILED" ) ); |
|
1373 User::Panic( _L("CRtpUtStream"), KErrGeneral ); |
|
1374 } |
|
1375 TBuf8<KExtLength+1> tempBuf1; |
|
1376 TBuf8<KExtLength+1> tempBuf2; |
|
1377 TBuf8<1> zero; |
|
1378 zero.Format( _L8( "%d"), 0 ); |
|
1379 tempBuf1.Format( _L8( "%s" ), aHeaderInfo.iHeaderExtension->iData ); |
|
1380 tempBuf2.Format( KExtData ); |
|
1381 tempBuf1.Replace( KExtLength, 1, zero); |
|
1382 tempBuf2.Replace( KExtLength, 1, zero); |
|
1383 if ( tempBuf1 != tempBuf2 ) |
|
1384 { |
|
1385 // "Invalid header extension data" )); |
|
1386 // "CRtpStream::RtpStreamProcessRtpPacket() - FAILED" ) ); |
|
1387 User::Panic( _L( "CRtpUtStream" ), KErrGeneral ); |
|
1388 } |
|
1389 iExpectingExtensionPacket = EFalse; |
|
1390 } |
|
1391 |
|
1392 } |
|
1393 |
|
1394 void UT_CRtpStream::SdesReceived( TRtpSSRC /*aSSRC*/, const TRtpSdesParams& /*aParams*/ ) |
|
1395 { |
|
1396 |
|
1397 } |
|
1398 void UT_CRtpStream::ByeReceived( TRtpId /*aStreamId*/, TRtpSSRC /*aSSRC*/, |
|
1399 const TDesC8& /*aReason*/ ) |
|
1400 { |
|
1401 |
|
1402 } |
|
1403 void UT_CRtpStream::AppReceived( TRtpId /*aStreamId*/, TRtpSSRC /*aSSRC*/, |
|
1404 const TRtcpApp& /*aApp*/ ) |
|
1405 { |
|
1406 |
|
1407 } |
|
1408 void UT_CRtpStream::SrReceived( TRtpId /*aStreamId*/, |
|
1409 TRtpSSRC /*aSSRC*/, const TTimeStamps& /*aTimeStamps*/ ) |
|
1410 { |
|
1411 |
|
1412 } |
|
1413 void UT_CRtpStream::RrReceived( TRtpId /*aStreamId*/, TRtpSSRC /*aSSRC*/ ) |
|
1414 { |
|
1415 |
|
1416 } // from MSsrcCheckCallback |
|
1417 TInt UT_CRtpStream::CheckRemoteSsrcL( TRtpSSRC& /*aSSRC*/ ) |
|
1418 { |
|
1419 return iWantedResult; |
|
1420 } |
|
1421 |
|
1422 TBool UT_CRtpStream::CheckRemoteAddr( ) |
|
1423 { |
|
1424 return ETrue; |
|
1425 } |
|
1426 |
|
1427 void UT_CRtpStream::Hex(HBufC8& aString) |
|
1428 { |
|
1429 TPtr8 ptr=aString.Des(); |
|
1430 TInt length = aString.Length(); |
|
1431 if (aString.Length()%2) |
|
1432 { |
|
1433 ptr.SetLength(0); |
|
1434 return; |
|
1435 } |
|
1436 TInt i; |
|
1437 for (i=0;i<aString.Length();i+=2) |
|
1438 { |
|
1439 TUint8 tmp; |
|
1440 tmp=(TUint8)(aString[i]-(aString[i]>'9'?('A'-10):'0')); |
|
1441 tmp*=16; |
|
1442 tmp|=(TUint8)(aString[i+1]-(aString[i+1]>'9'?('A'-10):'0')); |
|
1443 ptr[i/2]=tmp; |
|
1444 } |
|
1445 ptr.SetLength(aString.Length()/2); |
|
1446 |
|
1447 } |
|
1448 |
|
1449 // TEST TABLE |
|
1450 |
|
1451 EUNIT_BEGIN_TEST_TABLE( |
|
1452 UT_CRtpStream, |
|
1453 "CRtpStream", |
|
1454 "UNIT" ) |
|
1455 |
|
1456 EUNIT_TEST( |
|
1457 "ResetStreamStat - test ", |
|
1458 "CRtpStream", |
|
1459 "ResetStreamStat", |
|
1460 "FUNCTIONALITY", |
|
1461 SetupL, UT_CRtpStream_ResetStreamStatL, Teardown) |
|
1462 |
|
1463 EUNIT_TEST( |
|
1464 "FirstPkg - test ", |
|
1465 "CRtpStream", |
|
1466 "FirstPkg", |
|
1467 "FUNCTIONALITY", |
|
1468 SetupL, UT_CRtpStream_FirstPkgL, Teardown) |
|
1469 |
|
1470 EUNIT_TEST( |
|
1471 "SetFirstPkg - test ", |
|
1472 "CRtpStream", |
|
1473 "SetFirstPkg", |
|
1474 "FUNCTIONALITY", |
|
1475 SetupL, UT_CRtpStream_SetFirstPkgL, Teardown) |
|
1476 |
|
1477 EUNIT_TEST( |
|
1478 "GetLocalSSRC - test ", |
|
1479 "CRtpStream", |
|
1480 "GetLocalSSRC", |
|
1481 "FUNCTIONALITY", |
|
1482 SetupL, UT_CRtpStream_GetLocalSSRCL, Teardown) |
|
1483 |
|
1484 EUNIT_TEST( |
|
1485 "SetLocalSSRC - test ", |
|
1486 "CRtpStream", |
|
1487 "SetLocalSSRC", |
|
1488 "FUNCTIONALITY", |
|
1489 SetupL, UT_CRtpStream_SetLocalSSRCL, Teardown) |
|
1490 |
|
1491 EUNIT_TEST( |
|
1492 "RegisterRtcpObserver - test ", |
|
1493 "CRtpStream", |
|
1494 "RegisterRtcpObserver", |
|
1495 "FUNCTIONALITY", |
|
1496 SetupL, UT_CRtpStream_RegisterRtcpObserverL, Teardown) |
|
1497 |
|
1498 EUNIT_TEST( |
|
1499 "UnRegisterRtcpObserver - test ", |
|
1500 "CRtpStream", |
|
1501 "UnRegisterRtcpObserver", |
|
1502 "FUNCTIONALITY", |
|
1503 SetupL, UT_CRtpStream_UnRegisterRtcpObserverL, Teardown) |
|
1504 |
|
1505 EUNIT_TEST( |
|
1506 "GetStreamID - test ", |
|
1507 "CRtpStream", |
|
1508 "GetStreamID", |
|
1509 "FUNCTIONALITY", |
|
1510 SetupL, UT_CRtpStream_GetStreamIDL, Teardown) |
|
1511 |
|
1512 EUNIT_TEST( |
|
1513 "RtcpStats - test ", |
|
1514 "CRtpStream", |
|
1515 "RtcpStats", |
|
1516 "FUNCTIONALITY", |
|
1517 SetupL, UT_CRtpStream_RtcpStatsL, Teardown) |
|
1518 |
|
1519 EUNIT_TEST( |
|
1520 "GetStreamStat - test ", |
|
1521 "CRtpStream", |
|
1522 "GetStreamStat", |
|
1523 "FUNCTIONALITY", |
|
1524 SetupL, UT_CRtpStream_GetStreamStatL, Teardown) |
|
1525 |
|
1526 EUNIT_TEST( |
|
1527 "RtpStreamProcessRtcpReportSection - test ", |
|
1528 "CRtpStream", |
|
1529 "RtpStreamProcessRtcpReportSection", |
|
1530 "FUNCTIONALITY", |
|
1531 SetupL, UT_CRtpStream_RtpStreamProcessRtcpReportSectionL, Teardown) |
|
1532 |
|
1533 EUNIT_TEST( |
|
1534 "RtpStreamCreateRtcpReportSection - test ", |
|
1535 "CRtpStream", |
|
1536 "RtpStreamCreateRtcpReportSection", |
|
1537 "FUNCTIONALITY", |
|
1538 SetupL, UT_CRtpStream_RtpStreamCreateRtcpReportSectionL, Teardown) |
|
1539 |
|
1540 EUNIT_TEST( |
|
1541 "UpdateParam ", |
|
1542 "CRtpStream", |
|
1543 "UT_CRtpStream_UpdateParam", |
|
1544 "FUNCTIONALITY", |
|
1545 SetupL, UT_CRtpStream_UpdateParam, Teardown) |
|
1546 EUNIT_TEST( |
|
1547 "RtpByeAppMethods", |
|
1548 "CRtpStream", |
|
1549 "RtpByeAppMethods", |
|
1550 "FUNCTIONALITY", |
|
1551 SetupL, UT_CRtpStream_RtpByeAppMethods, Teardown) |
|
1552 |
|
1553 EUNIT_TEST( |
|
1554 "TestRtpSRMethods", |
|
1555 "CRtpStream", |
|
1556 "TestRtpSRMethods", |
|
1557 "FUNCTIONALITY", |
|
1558 SetupL, UT_CRtpStream_TestRtpSRMethods, Teardown) |
|
1559 |
|
1560 EUNIT_TEST( |
|
1561 "TestRtpRRMethods", |
|
1562 "CRtpStream", |
|
1563 "TestRtpRRMethods", |
|
1564 "FUNCTIONALITY", |
|
1565 SetupL, UT_CRtpStream_TestRtpRRMethods, Teardown) |
|
1566 |
|
1567 EUNIT_TEST( |
|
1568 "TestRtpRRMethods", |
|
1569 "CRtpStream", |
|
1570 "TestRtpRRMethods", |
|
1571 "FUNCTIONALITY", |
|
1572 SetupL, UT_CRtpStream_TestStreamStatAndSdesMethods, Teardown) |
|
1573 EUNIT_TEST( |
|
1574 "StreamProcessRtpPacket", |
|
1575 "CRtpStream", |
|
1576 "RtpStreamProcessRtpPacket", |
|
1577 "FUNCTIONALITY", |
|
1578 SetupL, UT_CRtpStream_RtpStreamProcessRtpPacket, Teardown) |
|
1579 |
|
1580 |
|
1581 |
|
1582 EUNIT_END_TEST_TABLE |
|
1583 |
|
1584 // END OF FILE |