583 initialVisualListCalls, iVisualListCalls.Count(), "Visual list was called" ); |
583 initialVisualListCalls, iVisualListCalls.Count(), "Visual list was called" ); |
584 } |
584 } |
585 |
585 |
586 void T_CShwEffectControl::TestThumbnailLoadingL() |
586 void T_CShwEffectControl::TestThumbnailLoadingL() |
587 { |
587 { |
588 // create shw thumbnail context for index 1 and size 100,100 |
588 // create shw thumbnail context for index 1 and size 100,100 |
589 const TInt thumbIndex = 1; |
589 const TInt thumbIndex = 1; |
590 CShwThumbnailContext* context = CShwThumbnailContext::NewLC( thumbIndex, TSize( 100, 100 ) ); |
590 CShwThumbnailContext* context = CShwThumbnailContext::NewLC(thumbIndex, |
|
591 TSize(100, 100), iStubMediaList); |
591 |
592 |
592 // test that the index is returned |
593 // test that the index is returned |
593 // set iterator to first |
594 // set iterator to first |
594 context->SetToFirst( iStubMediaList ); |
595 context->SetToFirst(iStubMediaList); |
595 // then iterate once |
596 // then iterate once |
596 TInt index = (*context)++; |
597 TInt index = (*context)++; |
597 EUNIT_ASSERT_EQUALS_DESC( thumbIndex, index, "check first iterated index" ); |
598 EUNIT_ASSERT_EQUALS_DESC(thumbIndex, index, "check first iterated index"); |
598 |
599 |
599 index = (*context)++; |
600 index = (*context)++; |
600 EUNIT_ASSERT_EQUALS_DESC( KErrNotFound, index, "next index is KErrNotFound" ); |
601 EUNIT_ASSERT_EQUALS_DESC( KErrNotFound, index, "next index is KErrNotFound" ); |
601 |
602 |
602 // check range |
603 // check range |
603 EUNIT_ASSERT_DESC( !context->InRange( thumbIndex-1 ), "thumbIndex-1 is not in range" ); |
604 EUNIT_ASSERT_DESC( !context->InRange( thumbIndex-1 ), "thumbIndex-1 is not in range" ); |
604 EUNIT_ASSERT_DESC( !context->InRange( thumbIndex+1 ), "thumbIndex+1 is not in range" ); |
605 EUNIT_ASSERT_DESC( !context->InRange( thumbIndex+1 ), "thumbIndex+1 is not in range" ); |
605 EUNIT_ASSERT_DESC( context->InRange( thumbIndex ), "thumbIndex is in range" ); |
606 EUNIT_ASSERT_DESC( context->InRange( thumbIndex ), "thumbIndex is in range" ); |
606 |
607 |
607 CleanupStack::PopAndDestroy( context ); |
608 CleanupStack::PopAndDestroy(context); |
608 } |
609 } |
609 |
610 |
610 void T_CShwEffectControl::TestErrorsInThumbnailLoadingL() |
611 void T_CShwEffectControl::TestErrorsInThumbnailLoadingL() |
611 { |
612 { |
612 // set the size and focus of the list |
613 // set the size and focus of the list |
613 iStubVisualList->iSize = 10; |
614 iStubVisualList->iSize = 10; |