graphicsresourceservices/graphicsresourceimplementation/test/src/tgraphicsresourceteststepbase.cpp
equal
deleted
inserted
replaced
337 } |
337 } |
338 |
338 |
339 /** |
339 /** |
340 Helper function to test the equivalence of two TSgImageInfo structures. |
340 Helper function to test the equivalence of two TSgImageInfo structures. |
341 |
341 |
342 @see CTDirectGdiContextTarget::CompareInfos |
|
343 @param aInfo1 A TSgImageInfo structure to compare. |
342 @param aInfo1 A TSgImageInfo structure to compare. |
344 @param aInfo2 A TSgImageInfo structure to compare. |
343 @param aInfo2 A TSgImageInfo structure to compare (may have extra usage bits). |
345 |
344 |
346 @return ETrue if the two are identical, EFalse otherwise. |
345 @return ETrue if the two are equivalent, EFalse otherwise. |
347 */ |
346 */ |
348 TBool CTSgTestStepBase::CompareInfos(TSgImageInfo& aInfo1, TSgImageInfo& aInfo2) |
347 TBool CTSgTestStepBase::CompareInfos(TSgImageInfo& aInfo1, TSgImageInfo& aInfo2) |
349 { |
348 { |
350 return (aInfo1.iPixelFormat == aInfo2.iPixelFormat |
349 return (aInfo1.iPixelFormat == aInfo2.iPixelFormat |
351 && aInfo1.iSizeInPixels == aInfo2.iSizeInPixels |
350 && aInfo1.iSizeInPixels == aInfo2.iSizeInPixels |
352 && aInfo1.iUsage == aInfo2.iUsage); |
351 // check that all requested usage bits are set in the returned usage bits |
|
352 && !(aInfo1.iUsage & ~aInfo2.iUsage)); |
353 } |
353 } |
354 |
354 |
355 /** |
355 /** |
356 Wrapper function to open the graphics resource driver. |
356 Wrapper function to open the graphics resource driver. |
357 Only opens the driver if the test step has been constructed for use |
357 Only opens the driver if the test step has been constructed for use |
619 } |
619 } |
620 if(KErrNone == err) |
620 if(KErrNone == err) |
621 { |
621 { |
622 result |= EFirstTestPassed; |
622 result |= EFirstTestPassed; |
623 } |
623 } |
624 TSgImageInfo info3; |
624 TSgImageInfo info; |
625 if(KErrNone == image.GetInfo(info3)) |
625 if(KErrNone == image.GetInfo(info)) |
626 { |
626 { |
627 result |= ESecondTestPassed; |
627 result |= ESecondTestPassed; |
628 } |
628 } |
629 TSgImageInfo info4 = aInfo->iImageInfo; |
629 if(CTSgTestStepBase::CompareInfos(aInfo->iImageInfo, info)) |
630 if(CTSgTestStepBase::CompareInfos(info4, info3)) |
|
631 { |
630 { |
632 result |= EThirdTestPassed; |
631 result |= EThirdTestPassed; |
633 } |
632 } |
634 TSgDrawableId id = image.Id(); |
633 TSgDrawableId id = image.Id(); |
635 if(id != KSgNullDrawableId) |
634 if(id != KSgNullDrawableId) |