|
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_CMccFileSourceImpl.h" |
|
23 #include "mmcccodecinformation.h" |
|
24 #include "mccresourcepool.h" |
|
25 #include "mmccinterfacedef.h" |
|
26 #include "mccunittestmacros.h" |
|
27 |
|
28 |
|
29 // EXTERNAL INCLUDES |
|
30 #include <digia/eunit/eunitmacros.h> |
|
31 |
|
32 |
|
33 // INTERNAL INCLUDES |
|
34 #include "mccfilesourceimpl.h" |
|
35 |
|
36 #include "mcculdatapath.h" |
|
37 #include "mccfilevideo.h" |
|
38 #include "mccfileaudio.h" |
|
39 |
|
40 // CONSTRUCTION |
|
41 UT_CMccFileSourceImpl* UT_CMccFileSourceImpl::NewL() |
|
42 { |
|
43 UT_CMccFileSourceImpl* self = UT_CMccFileSourceImpl::NewLC(); |
|
44 CleanupStack::Pop(); |
|
45 |
|
46 return self; |
|
47 } |
|
48 |
|
49 UT_CMccFileSourceImpl* UT_CMccFileSourceImpl::NewLC() |
|
50 { |
|
51 UT_CMccFileSourceImpl* self = new( ELeave ) UT_CMccFileSourceImpl(); |
|
52 CleanupStack::PushL( self ); |
|
53 |
|
54 self->ConstructL(); |
|
55 |
|
56 return self; |
|
57 } |
|
58 |
|
59 // Destructor (virtual by CBase) |
|
60 UT_CMccFileSourceImpl::~UT_CMccFileSourceImpl() |
|
61 { |
|
62 } |
|
63 |
|
64 // Default constructor |
|
65 UT_CMccFileSourceImpl::UT_CMccFileSourceImpl() |
|
66 { |
|
67 } |
|
68 |
|
69 // Second phase construct |
|
70 void UT_CMccFileSourceImpl::ConstructL() |
|
71 { |
|
72 // The ConstructL from the base class CEUnitTestSuiteClass must be called. |
|
73 // It generates the test case table. |
|
74 CEUnitTestSuiteClass::ConstructL(); |
|
75 } |
|
76 |
|
77 // METHODS |
|
78 |
|
79 |
|
80 void UT_CMccFileSourceImpl::SetupL( ) |
|
81 { |
|
82 // No local play |
|
83 // |
|
84 iBuffer = CMMFDescriptorBuffer::NewL( 1000 ); |
|
85 iBuffer->Data().Copy(_L("aaaaaaaaaa")); |
|
86 |
|
87 TMediaId media = KUidMediaTypeAudio; |
|
88 MAsyncEventHandler* eventHandler = NULL; |
|
89 CMccResourcePool* iMccResource = NULL; |
|
90 |
|
91 iAudioULDPStub = CMccUlDataPath::NewL( eventHandler, iMccResource, media ); |
|
92 media = KUidMediaTypeVideo; |
|
93 iVideoULDPStub = CMccUlDataPath::NewL( eventHandler, iMccResource, media ); |
|
94 |
|
95 |
|
96 TMccFileSourceSettingBuf settingBuf; |
|
97 TFileName fileName; |
|
98 fileName.Copy(_L("c:\\CrazyFrog.3gp")); |
|
99 settingBuf().iFileName = fileName; |
|
100 |
|
101 iSourceImp = CMccFileSourceImpl::NewL( 0 ); |
|
102 iSourceImp->OpenFileL( settingBuf().iFileName ); |
|
103 |
|
104 iSourceImp->SourcePrimeL(); |
|
105 } |
|
106 |
|
107 |
|
108 void UT_CMccFileSourceImpl::Setup2L( ) |
|
109 { |
|
110 iBuffer = CMMFDescriptorBuffer::NewL( 1000 ); |
|
111 iBuffer->Data().Copy(_L("aaaaaaaaaa")); |
|
112 |
|
113 TMediaId media = KUidMediaTypeAudio; |
|
114 MAsyncEventHandler* eventHandler = NULL; |
|
115 CMccResourcePool* iMccResource = NULL; |
|
116 |
|
117 iAudioULDPStub = CMccUlDataPath::NewL( eventHandler, iMccResource, media ); |
|
118 media = KUidMediaTypeVideo; |
|
119 iVideoULDPStub = CMccUlDataPath::NewL( eventHandler, iMccResource, media ); |
|
120 |
|
121 |
|
122 TMccFileSourceSettingBuf settingBuf; |
|
123 TFileName fileName; |
|
124 fileName.Copy(_L("c:\\test_avc.3gp")); |
|
125 settingBuf().iFileName = fileName; |
|
126 |
|
127 iSourceImp = CMccFileSourceImpl::NewL( 0 ); |
|
128 iSourceImp->OpenFileL( settingBuf().iFileName ); |
|
129 |
|
130 iSourceImp->SourcePrimeL(); |
|
131 } |
|
132 |
|
133 void UT_CMccFileSourceImpl::Teardown( ) |
|
134 { |
|
135 iSourceImp->CloseFileL(); |
|
136 |
|
137 delete iSourceImp; |
|
138 delete iAudioULDPStub; |
|
139 delete iVideoULDPStub; |
|
140 delete iBuffer; |
|
141 } |
|
142 |
|
143 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_NewLL( ) |
|
144 { |
|
145 // CMccFileSourceImpl* sourceImpl = CMccFileSourceImpl::NewL(0); |
|
146 // delete sourceImpl; |
|
147 } |
|
148 |
|
149 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_CMccFileSourceImplL( ) |
|
150 { |
|
151 EUNIT_ASSERT( ETrue ); |
|
152 } |
|
153 |
|
154 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_AddDataSinkL( ) |
|
155 { |
|
156 MCMRMediaSink* sink = NULL; |
|
157 iSourceImp->AddDataSink(sink); |
|
158 } |
|
159 |
|
160 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_OpenFileLL( ) |
|
161 { |
|
162 iSourceImp->CloseFileL(); // close file CrazyFrog.3gp |
|
163 |
|
164 // Might leave with KErrGeneral if running out of memory |
|
165 TRAPD( err, iSourceImp->OpenFileL( _L("c:\\test.3gp") ) ); |
|
166 if ( err == KErrGeneral || err == KErrNoMemory ) |
|
167 { |
|
168 User::Leave( KErrNoMemory ); |
|
169 } |
|
170 |
|
171 iSourceImp->CloseFileL(); // close file test.3gp |
|
172 |
|
173 EUNIT_ASSERT_LEAVE(iSourceImp->OpenFileL( _L("c:\test.3gp") )); |
|
174 |
|
175 // neither audio nor video |
|
176 EUNIT_ASSERT_LEAVE(iSourceImp->OpenFileL( _L("c:\\dummytest.txt") )); |
|
177 |
|
178 } |
|
179 |
|
180 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_CloseFileLL( ) |
|
181 { |
|
182 iSourceImp->CloseFileL(); // close file CrazyFrog.3gp |
|
183 |
|
184 // Might leave with KErrGeneral if running out of memory |
|
185 TRAPD( err, iSourceImp->OpenFileL( _L("c:\\test.mp4") ) ); |
|
186 if ( err == KErrGeneral || err == KErrNoMemory ) |
|
187 { |
|
188 User::Leave( KErrNoMemory ); |
|
189 } |
|
190 } |
|
191 |
|
192 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_SetPositionLL( ) |
|
193 { |
|
194 iSourceImp->SetPositionL( TTimeIntervalMicroSeconds ( 0 ) ); |
|
195 iSourceImp->SetPositionL( TTimeIntervalMicroSeconds ( 10 ) ); |
|
196 TMediaId mediaId; |
|
197 mediaId.iMediaType = KUidMediaTypeVideo; |
|
198 EUNIT_ASSERT_EQUALS(TFourCC( KMccFourCCIdH263 ), iSourceImp->SourceDataTypeCode(mediaId) ); |
|
199 iSourceImp->SetPositionL( TTimeIntervalMicroSeconds ( 100 ) ); |
|
200 |
|
201 iSourceImp->iIsVideo = EFalse; |
|
202 |
|
203 mediaId.iMediaType = KUidMediaTypeAudio; |
|
204 EUNIT_ASSERT_EQUALS(TFourCC( KMccFourCCIdAMRNB ), iSourceImp->SourceDataTypeCode(mediaId) ); |
|
205 iSourceImp->SetPositionL( TTimeIntervalMicroSeconds ( 1000 ) ); |
|
206 iSourceImp->iCurrentState = CMccFileSourceImpl::EStopped; |
|
207 iSourceImp->SetPositionL( TTimeIntervalMicroSeconds ( 10000 ) ); |
|
208 } |
|
209 |
|
210 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_VideoTypeLL( ) |
|
211 { |
|
212 EUNIT_ASSERT(iSourceImp->VideoTypeL() == CCMRMediaBuffer::EVideoH263); |
|
213 } |
|
214 |
|
215 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_AudioTypeLL( ) |
|
216 { |
|
217 EUNIT_ASSERT(iSourceImp->AudioTypeL() == CCMRMediaBuffer::EAudioAMRNB); |
|
218 } |
|
219 |
|
220 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_VideoFrameRateLL( ) |
|
221 { |
|
222 |
|
223 TReal32 videoFrameRate = iSourceImp->VideoFrameRateL(); |
|
224 } |
|
225 |
|
226 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_AudioBitRateLL( ) |
|
227 { |
|
228 TUint32 audioBitRate = iSourceImp->AudioBitRateL(); |
|
229 } |
|
230 |
|
231 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_DurationLL( ) |
|
232 { |
|
233 TMediaId mediaId; |
|
234 mediaId.iMediaType = KUidMediaTypeVideo; |
|
235 EUNIT_ASSERT_EQUALS(TFourCC( KMccFourCCIdH263 ), iSourceImp->SourceDataTypeCode(mediaId) ); |
|
236 |
|
237 TTimeIntervalMicroSeconds duration = iSourceImp->DurationL(); |
|
238 |
|
239 iSourceImp->iIsVideo = EFalse; |
|
240 |
|
241 mediaId.iMediaType = KUidMediaTypeAudio; |
|
242 EUNIT_ASSERT_EQUALS(TFourCC( KMccFourCCIdAMRNB ), iSourceImp->SourceDataTypeCode(mediaId) ); |
|
243 |
|
244 duration = iSourceImp->DurationL(); |
|
245 } |
|
246 |
|
247 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_VideoFrameSizeLL( ) |
|
248 { |
|
249 TSize size = iSourceImp->VideoFrameSizeL(); |
|
250 } |
|
251 |
|
252 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_VideoBitRateLL( ) |
|
253 { |
|
254 TUint32 videoBitRate = iSourceImp->VideoBitRateL(); |
|
255 } |
|
256 |
|
257 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_PositionLL( ) |
|
258 { |
|
259 TMediaId mediaId; |
|
260 mediaId.iMediaType = KUidMediaTypeVideo; |
|
261 EUNIT_ASSERT_EQUALS(TFourCC( KMccFourCCIdH263 ), iSourceImp->SourceDataTypeCode(mediaId) ); |
|
262 iSourceImp->iIsAudio = ETrue; |
|
263 iSourceImp->iIsVideo = ETrue; |
|
264 |
|
265 // If both media types are used, smaller position is returned |
|
266 iSourceImp->iFileAudio->iPosition = 1000; |
|
267 iSourceImp->iFileVideo->iPosition = 2000; |
|
268 TTimeIntervalMicroSeconds pos = iSourceImp->PositionL(); |
|
269 EUNIT_ASSERT_EQUALS( pos.Int64(), 1000000 ); |
|
270 |
|
271 // If other media type is already at end (pos zero) other media types position is used |
|
272 iSourceImp->iFileAudio->iPosition = 0; |
|
273 iSourceImp->iFileVideo->iPosition = 2000; |
|
274 pos = iSourceImp->PositionL(); |
|
275 EUNIT_ASSERT_EQUALS( pos.Int64(), 2000000 ); |
|
276 |
|
277 iSourceImp->iIsVideo = EFalse; |
|
278 |
|
279 mediaId.iMediaType = KUidMediaTypeAudio; |
|
280 iSourceImp->iFileAudio->iPosition = 3000; |
|
281 EUNIT_ASSERT_EQUALS(TFourCC( KMccFourCCIdAMRNB ), iSourceImp->SourceDataTypeCode(mediaId) ); |
|
282 |
|
283 pos = iSourceImp->PositionL(); |
|
284 EUNIT_ASSERT_EQUALS( pos.Int64(), 3000000 ); |
|
285 } |
|
286 |
|
287 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_SourceDataTypeCodeL( ) |
|
288 { |
|
289 TMediaId mediaId; |
|
290 EUNIT_ASSERT_EQUALS(TFourCC( NULL ), iSourceImp->SourceDataTypeCode(mediaId) ); |
|
291 |
|
292 mediaId.iMediaType = KUidMediaTypeVideo; |
|
293 EUNIT_ASSERT_EQUALS(TFourCC( KMccFourCCIdH263 ), iSourceImp->SourceDataTypeCode(mediaId) ); |
|
294 |
|
295 mediaId.iMediaType = KUidMediaTypeAudio; |
|
296 EUNIT_ASSERT_EQUALS(TFourCC( KMccFourCCIdAMRNB ), iSourceImp->SourceDataTypeCode(mediaId) ); |
|
297 } |
|
298 |
|
299 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_SetSourceDataTypeCodeL( ) |
|
300 { |
|
301 TMediaId mediaId; |
|
302 EUNIT_ASSERT_EQUALS( KErrNotSupported, iSourceImp->SetSourceDataTypeCode( TFourCC( ' ','A','N','Y' ), mediaId ) ); |
|
303 |
|
304 mediaId.iMediaType = KUidMediaTypeVideo; |
|
305 EUNIT_ASSERT_EQUALS(TFourCC( KMccFourCCIdH263 ), iSourceImp->SourceDataTypeCode(mediaId) ); |
|
306 EUNIT_ASSERT_EQUALS( KErrNone, iSourceImp->SetSourceDataTypeCode( TFourCC(KMccFourCCIdH263), mediaId ) ); |
|
307 |
|
308 mediaId.iMediaType = KUidMediaTypeAudio; |
|
309 EUNIT_ASSERT_EQUALS(TFourCC( KMccFourCCIdAMRNB ), iSourceImp->SourceDataTypeCode(mediaId) ); |
|
310 |
|
311 EUNIT_ASSERT_EQUALS( KErrNone, iSourceImp->SetSourceDataTypeCode( TFourCC(KMccFourCCIdAMRNB), mediaId ) ); |
|
312 } |
|
313 |
|
314 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_SourcePrimeLL( ) |
|
315 { |
|
316 iSourceImp->SourcePrimeL(); |
|
317 } |
|
318 |
|
319 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_SourcePlayLL( ) |
|
320 { |
|
321 iSourceImp->SourcePrimeL(); |
|
322 iSourceImp->SourcePlayL(); |
|
323 iSourceImp->SourcePlayL(); // return if is in playing state |
|
324 iSourceImp->CloseFileL(); |
|
325 |
|
326 // Might leave with KErrGeneral if running out of memory |
|
327 TRAPD( err, iSourceImp->OpenFileL( _L("c:\\CrazyFrog.3gp") ) ); |
|
328 if ( err == KErrGeneral || err == KErrNoMemory ) |
|
329 { |
|
330 User::Leave( KErrNoMemory ); |
|
331 } |
|
332 } |
|
333 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_SourcePlayL2L() |
|
334 { |
|
335 iSourceImp->SourcePrimeL(); |
|
336 iSourceImp->iIsVideo = ETrue; |
|
337 iSourceImp->iIsAudio = ETrue; |
|
338 iSourceImp->SourcePlayL( EFalse, EFalse ); |
|
339 iSourceImp->SourcePauseL( ); |
|
340 iSourceImp->SourcePlayL( EFalse, EFalse ); |
|
341 |
|
342 } |
|
343 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_SourcePauseLL( ) |
|
344 { |
|
345 iSourceImp->SourcePauseL(); // return if not in playing state |
|
346 |
|
347 iSourceImp->SourcePrimeL(); |
|
348 iSourceImp->SourcePlayL(); |
|
349 iSourceImp->iIsVideo = ETrue; |
|
350 iSourceImp->iIsAudio = ETrue; |
|
351 iSourceImp->SourcePauseL(); |
|
352 |
|
353 } |
|
354 |
|
355 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_SourceStopLL( ) |
|
356 { |
|
357 iSourceImp->SourceStopL(); // return if state is in EConstructed |
|
358 |
|
359 iSourceImp->SourcePrimeL(); |
|
360 iSourceImp->SourcePlayL(); |
|
361 iSourceImp->SourcePauseL(); |
|
362 iSourceImp->iIsVideo = ETrue; |
|
363 iSourceImp->SourceStopL(EFalse, EFalse); |
|
364 |
|
365 iSourceImp->SourcePrimeL(); |
|
366 iSourceImp->SourceStopL(); |
|
367 |
|
368 iSourceImp->SourcePrimeL(); |
|
369 iSourceImp->SourcePlayL(); |
|
370 iSourceImp->iIsAudio = ETrue; |
|
371 |
|
372 iSourceImp->SourceStopL(EFalse, EFalse); |
|
373 } |
|
374 |
|
375 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_FillBufferLL( ) |
|
376 { |
|
377 TMediaId media(KUidMediaTypeAudio); |
|
378 EUNIT_ASSERT_EQUALS(TFourCC( KMccFourCCIdAMRNB ), iSourceImp->SourceDataTypeCode(media) ); |
|
379 iSourceImp->FillBufferL(iBuffer, iAudioULDPStub, media); |
|
380 |
|
381 media = KUidMediaTypeVideo; |
|
382 EUNIT_ASSERT_EQUALS(TFourCC( KMccFourCCIdH263 ), iSourceImp->SourceDataTypeCode(media) ); |
|
383 iSourceImp->FillBufferL(iBuffer, iVideoULDPStub, media); |
|
384 |
|
385 media = KUidMediaTypeMidi; // neither video nor audio |
|
386 EUNIT_ASSERT_SPECIFIC_LEAVE( |
|
387 iSourceImp->FillBufferL(iBuffer, iVideoULDPStub, media), KErrNotSupported ); |
|
388 } |
|
389 |
|
390 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_PauseAudioL() |
|
391 { |
|
392 iSourceImp->PauseAudioL(); // return, iCurrentState != EPlaying |
|
393 iSourceImp->iIsVideo = ETrue; |
|
394 iSourceImp->iCurrentState = CMccFileSourceImpl::EPlaying; |
|
395 iSourceImp->PauseAudioL( KErrGeneral ); |
|
396 iSourceImp->iIsVideo = EFalse; |
|
397 iSourceImp->PauseAudioL( ); |
|
398 } |
|
399 |
|
400 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_PauseVideoL() |
|
401 { |
|
402 iSourceImp->PauseVideoL(); // return, iCurrentState != EPlaying |
|
403 iSourceImp->iIsAudio = ETrue; |
|
404 iSourceImp->iCurrentState = CMccFileSourceImpl::EPlaying; |
|
405 iSourceImp->PauseVideoL( KErrGeneral ); |
|
406 iSourceImp->iIsVideo = EFalse; |
|
407 iSourceImp->PauseVideoL( ); |
|
408 } |
|
409 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_SourceThreadLogonL() |
|
410 { |
|
411 MAsyncEventHandler* eventHandler = NULL; |
|
412 iSourceImp->SourceThreadLogon( *eventHandler ); |
|
413 } |
|
414 |
|
415 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_SourceThreadLogOffL() |
|
416 { |
|
417 MAsyncEventHandler* eventHandler = NULL; |
|
418 iSourceImp->SourceThreadLogon( *eventHandler ); |
|
419 |
|
420 iSourceImp->SourceThreadLogoff(); |
|
421 } |
|
422 |
|
423 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_MilliToMicroSecondsL() |
|
424 { |
|
425 TTimeIntervalMicroSeconds microSec = iSourceImp->MilliToMicroSeconds( 1000 ); |
|
426 EUNIT_ASSERT_EQUALS( microSec.Int64(), 1000000 ); |
|
427 |
|
428 TUint32 milliSec = iSourceImp->MicroToMilliSeconds( microSec ); |
|
429 EUNIT_ASSERT_EQUALS( milliSec, 1000); |
|
430 |
|
431 } |
|
432 |
|
433 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_SetDelayAfterStopL() |
|
434 { |
|
435 iSourceImp->SetDelayAfterStop( 1000 ); |
|
436 EUNIT_ASSERT( iSourceImp->DelayAfterStop() == 1000 ); |
|
437 iSourceImp->SetDelayAfterStop( 2000 ); |
|
438 EUNIT_ASSERT( iSourceImp->DelayAfterStop() == 2000 ); |
|
439 } |
|
440 |
|
441 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_EofTimerExpiredLL() |
|
442 { |
|
443 iSourceImp->iCurrentState = CMccFileSourceImpl::EConstructed; |
|
444 iSourceImp->EofTimerExpiredL(); |
|
445 EUNIT_ASSERT( iSourceImp->iCurrentState == CMccFileSourceImpl::EWaitingPause ); |
|
446 } |
|
447 |
|
448 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_GetConfigKeyLL() |
|
449 { |
|
450 // Not initialized fully |
|
451 // |
|
452 TBuf8<KMaxConfigKeyLen> confKey; |
|
453 MCC_EUNIT_ASSERT_SPECIFIC_LEAVE( iSourceImp->GetConfigKeyL( confKey ), KErrNotReady ); |
|
454 |
|
455 // Not avc clip |
|
456 // |
|
457 TMediaId mediaId; |
|
458 mediaId.iMediaType = KUidMediaTypeVideo; |
|
459 iSourceImp->SourceDataTypeCode( mediaId ); |
|
460 MCC_EUNIT_ASSERT_SPECIFIC_LEAVE( iSourceImp->GetConfigKeyL( confKey ), KErrNotSupported ); |
|
461 } |
|
462 |
|
463 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_GetConfigKeyL2L() |
|
464 { |
|
465 // Avc clip |
|
466 // |
|
467 TMediaId mediaId; |
|
468 mediaId.iMediaType = KUidMediaTypeVideo; |
|
469 TBuf8<KMaxConfigKeyLen> confKey; |
|
470 iSourceImp->SourceDataTypeCode( mediaId ); |
|
471 iSourceImp->GetConfigKeyL( confKey ); |
|
472 EUNIT_ASSERT( confKey != KNullDesC8 ); |
|
473 |
|
474 // Avc clip, input param too short |
|
475 TBuf8<1> confKey2; |
|
476 MCC_EUNIT_ASSERT_SPECIFIC_LEAVE( iSourceImp->GetConfigKeyL( confKey2 ), KErrOverflow ); |
|
477 } |
|
478 |
|
479 // TEST TABLE |
|
480 |
|
481 EUNIT_BEGIN_TEST_TABLE( |
|
482 UT_CMccFileSourceImpl, |
|
483 "Add test suite description here.", |
|
484 "UNIT" ) |
|
485 |
|
486 EUNIT_TEST( |
|
487 "NewL - test ", |
|
488 "CMccFileSourceImpl", |
|
489 "NewL", |
|
490 "FUNCTIONALITY", |
|
491 SetupL, UT_CMccFileSourceImpl_NewLL, Teardown) |
|
492 |
|
493 EUNIT_TEST( |
|
494 "CMccFileSourceImpl - test ", |
|
495 "CMccFileSourceImpl", |
|
496 "CMccFileSourceImpl", |
|
497 "FUNCTIONALITY", |
|
498 SetupL, UT_CMccFileSourceImpl_CMccFileSourceImplL, Teardown) |
|
499 |
|
500 EUNIT_TEST( |
|
501 "AddDataSink - test ", |
|
502 "CMccFileSourceImpl", |
|
503 "AddDataSink", |
|
504 "FUNCTIONALITY", |
|
505 SetupL, UT_CMccFileSourceImpl_AddDataSinkL, Teardown) |
|
506 |
|
507 EUNIT_TEST( |
|
508 "OpenFileL - test ", |
|
509 "CMccFileSourceImpl", |
|
510 "OpenFileL", |
|
511 "FUNCTIONALITY", |
|
512 SetupL, UT_CMccFileSourceImpl_OpenFileLL, Teardown) |
|
513 |
|
514 EUNIT_TEST( |
|
515 "CloseFileL - test ", |
|
516 "CMccFileSourceImpl", |
|
517 "CloseFileL", |
|
518 "FUNCTIONALITY", |
|
519 SetupL, UT_CMccFileSourceImpl_CloseFileLL, Teardown) |
|
520 |
|
521 EUNIT_TEST( |
|
522 "SetPositionL - test ", |
|
523 "CMccFileSourceImpl", |
|
524 "SetPositionL", |
|
525 "FUNCTIONALITY", |
|
526 SetupL, UT_CMccFileSourceImpl_SetPositionLL, Teardown) |
|
527 |
|
528 EUNIT_TEST( |
|
529 "VideoTypeL - test ", |
|
530 "CMccFileSourceImpl", |
|
531 "VideoTypeL", |
|
532 "FUNCTIONALITY", |
|
533 SetupL, UT_CMccFileSourceImpl_VideoTypeLL, Teardown) |
|
534 |
|
535 EUNIT_TEST( |
|
536 "AudioTypeL - test ", |
|
537 "CMccFileSourceImpl", |
|
538 "AudioTypeL", |
|
539 "FUNCTIONALITY", |
|
540 SetupL, UT_CMccFileSourceImpl_AudioTypeLL, Teardown) |
|
541 |
|
542 EUNIT_TEST( |
|
543 "VideoFrameRateL - test ", |
|
544 "CMccFileSourceImpl", |
|
545 "VideoFrameRateL", |
|
546 "FUNCTIONALITY", |
|
547 SetupL, UT_CMccFileSourceImpl_VideoFrameRateLL, Teardown) |
|
548 |
|
549 EUNIT_TEST( |
|
550 "AudioBitRateL - test ", |
|
551 "CMccFileSourceImpl", |
|
552 "AudioBitRateL", |
|
553 "FUNCTIONALITY", |
|
554 SetupL, UT_CMccFileSourceImpl_AudioBitRateLL, Teardown) |
|
555 |
|
556 EUNIT_TEST( |
|
557 "DurationL - test ", |
|
558 "CMccFileSourceImpl", |
|
559 "DurationL", |
|
560 "FUNCTIONALITY", |
|
561 SetupL, UT_CMccFileSourceImpl_DurationLL, Teardown) |
|
562 |
|
563 EUNIT_TEST( |
|
564 "VideoFrameSizeL - test ", |
|
565 "CMccFileSourceImpl", |
|
566 "VideoFrameSizeL", |
|
567 "FUNCTIONALITY", |
|
568 SetupL, UT_CMccFileSourceImpl_VideoFrameSizeLL, Teardown) |
|
569 |
|
570 EUNIT_TEST( |
|
571 "VideoBitRateL - test ", |
|
572 "CMccFileSourceImpl", |
|
573 "VideoBitRateL", |
|
574 "FUNCTIONALITY", |
|
575 SetupL, UT_CMccFileSourceImpl_VideoBitRateLL, Teardown) |
|
576 |
|
577 EUNIT_TEST( |
|
578 "PositionL - test ", |
|
579 "CMccFileSourceImpl", |
|
580 "PositionL", |
|
581 "FUNCTIONALITY", |
|
582 SetupL, UT_CMccFileSourceImpl_PositionLL, Teardown) |
|
583 |
|
584 EUNIT_TEST( |
|
585 "SourceDataTypeCode - test ", |
|
586 "CMccFileSourceImpl", |
|
587 "SourceDataTypeCode", |
|
588 "FUNCTIONALITY", |
|
589 SetupL, UT_CMccFileSourceImpl_SourceDataTypeCodeL, Teardown) |
|
590 |
|
591 EUNIT_TEST( |
|
592 "SetSourceDataTypeCode - test ", |
|
593 "CMccFileSourceImpl", |
|
594 "SetSourceDataTypeCode", |
|
595 "FUNCTIONALITY", |
|
596 SetupL, UT_CMccFileSourceImpl_SetSourceDataTypeCodeL, Teardown) |
|
597 |
|
598 EUNIT_TEST( |
|
599 "SourcePrimeL - test ", |
|
600 "CMccFileSourceImpl", |
|
601 "SourcePrimeL", |
|
602 "FUNCTIONALITY", |
|
603 SetupL, UT_CMccFileSourceImpl_SourcePrimeLL, Teardown) |
|
604 |
|
605 EUNIT_TEST( |
|
606 "SourcePlayL - test ", |
|
607 "CMccFileSourceImpl", |
|
608 "SourcePlayL", |
|
609 "FUNCTIONALITY", |
|
610 SetupL, UT_CMccFileSourceImpl_SourcePlayLL, Teardown) |
|
611 EUNIT_TEST( |
|
612 "SourcePlay2L - test ", |
|
613 "CMccFileSourceImpl", |
|
614 "SourcePlay2L", |
|
615 "FUNCTIONALITY", |
|
616 SetupL, UT_CMccFileSourceImpl_SourcePlayL2L, Teardown) |
|
617 |
|
618 EUNIT_TEST( |
|
619 "SourcePauseL - test ", |
|
620 "CMccFileSourceImpl", |
|
621 "SourcePauseL", |
|
622 "FUNCTIONALITY", |
|
623 SetupL, UT_CMccFileSourceImpl_SourcePauseLL, Teardown) |
|
624 |
|
625 EUNIT_TEST( |
|
626 "SourceStopL - test ", |
|
627 "CMccFileSourceImpl", |
|
628 "SourceStopL", |
|
629 "FUNCTIONALITY", |
|
630 SetupL, UT_CMccFileSourceImpl_SourceStopLL, Teardown) |
|
631 |
|
632 EUNIT_TEST( |
|
633 "FillBufferL - test ", |
|
634 "CMccFileSourceImpl", |
|
635 "FillBufferL", |
|
636 "FUNCTIONALITY", |
|
637 SetupL, UT_CMccFileSourceImpl_FillBufferLL, Teardown) |
|
638 EUNIT_TEST( |
|
639 "PauseAudioL - test ", |
|
640 "CMccFileSourceImpl", |
|
641 "PauseAudioL", |
|
642 "FUNCTIONALITY", |
|
643 SetupL, UT_CMccFileSourceImpl_PauseAudioL, Teardown) |
|
644 |
|
645 EUNIT_TEST( |
|
646 "PauseVideoL - test ", |
|
647 "CMccFileSourceImpl", |
|
648 "PauseVideoL", |
|
649 "FUNCTIONALITY", |
|
650 SetupL, UT_CMccFileSourceImpl_PauseVideoL, Teardown) |
|
651 |
|
652 EUNIT_TEST( |
|
653 "SourceThreadLogonL - test ", |
|
654 "CMccFileSourceImpl", |
|
655 "SourceThreadLogonL", |
|
656 "FUNCTIONALITY", |
|
657 SetupL, UT_CMccFileSourceImpl_SourceThreadLogonL, Teardown) |
|
658 |
|
659 EUNIT_TEST( |
|
660 "SourceThreadLogOffL - test ", |
|
661 "CMccFileSourceImpl", |
|
662 "SourceThreadLogOffL", |
|
663 "FUNCTIONALITY", |
|
664 SetupL, UT_CMccFileSourceImpl_SourceThreadLogOffL, Teardown) |
|
665 |
|
666 EUNIT_TEST( |
|
667 "MilliToMicroSecondsL - test ", |
|
668 "CMccFileSourceImpl", |
|
669 "MilliToMicroSecondsL", |
|
670 "FUNCTIONALITY", |
|
671 SetupL, UT_CMccFileSourceImpl_MilliToMicroSecondsL, Teardown) |
|
672 |
|
673 EUNIT_TEST( |
|
674 "SetDelayAfterStop - test ", |
|
675 "CMccFileSourceImpl", |
|
676 "SetDelayAfterStop", |
|
677 "FUNCTIONALITY", |
|
678 SetupL, UT_CMccFileSourceImpl_SetDelayAfterStopL, Teardown) |
|
679 |
|
680 EUNIT_TEST( |
|
681 "EofTimerExpiredL - test ", |
|
682 "CMccFileSourceImpl", |
|
683 "EofTimerExpiredL", |
|
684 "FUNCTIONALITY", |
|
685 SetupL, UT_CMccFileSourceImpl_EofTimerExpiredLL, Teardown) |
|
686 |
|
687 EUNIT_TEST( |
|
688 "GetConfigKeyL - test ", |
|
689 "CMccFileSourceImpl", |
|
690 "GetConfigKeyL", |
|
691 "FUNCTIONALITY", |
|
692 SetupL, UT_CMccFileSourceImpl_GetConfigKeyLL, Teardown) |
|
693 |
|
694 EUNIT_TEST( |
|
695 "GetConfigKeyL 2 - test ", |
|
696 "CMccFileSourceImpl", |
|
697 "GetConfigKeyL", |
|
698 "FUNCTIONALITY", |
|
699 Setup2L, UT_CMccFileSourceImpl_GetConfigKeyL2L, Teardown) |
|
700 |
|
701 EUNIT_END_TEST_TABLE |
|
702 |
|
703 // END OF FILE |