diff -r bbf46f59e123 -r 25ffed67c7ef graphicsdeviceinterface/bitgdi/tbit/TDefect2.cpp --- a/graphicsdeviceinterface/bitgdi/tbit/TDefect2.cpp Tue Aug 31 16:31:06 2010 +0300 +++ b/graphicsdeviceinterface/bitgdi/tbit/TDefect2.cpp Wed Sep 01 12:39:21 2010 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -110,6 +111,7 @@ _LIT(KTest4,"SubTest %d: CFbsBitmap::GetPixel() performance"); _LIT(KTest5,"SubTest %d: Rotate/Move text"); _LIT(KTest6,"SubTest %d: SwapWidthAndHeight"); + _LIT(KTest7,"SubTest %d: Create multiple screens"); _LIT(KTest8,"SubTest %d: Clear with non-zero origin"); _LIT(KTest9,"SubTest %d: DEF115395: DrawBitmap & DrawBitmapMasked with a sourceRect out of the Bitmap bounds"); _LIT(KTest10,"SubTest %d: INC119063: General test CopyRect rewrite for low color depth (8,4,2, pixels per byte)"); @@ -153,7 +155,9 @@ SwapWidthAndHeightL(); break; case 7: - // Test case moved to tmultiscreens.cpp + ((CTDefect2Step*)iStep)->SetTestStepID(_L("GRAPHICS-BITGDI-0072")); + INFO_PRINTF2(KTest7,aCurTestCase); + CreateScreenDeviceL(); break; case 8: ((CTDefect2Step*)iStep)->SetTestStepID(_L("GRAPHICS-BITGDI-0073")); @@ -2066,6 +2070,40 @@ }//end of - for(TInt ii=0;iiScreenNo() == aScreenNo); err = iScrDev->CreateContext((CGraphicsContext*&)iGc); - if ( !iGc ) - { - return err; - } TEST(err == KErrNone); iGc->SetUserDisplayMode(aDisplayMode); iScrDev->ChangeScreenDevice(NULL); @@ -2375,7 +2408,6 @@ TInt cWsScreenDeviceResult = 1; TReal32 percentDifference = 0.0; CreateScrDevAndContextL(); - TBool testResult = EFalse; RWsSession wsSession; if (KErrNone == wsSession.Connect()) @@ -2388,54 +2420,28 @@ cFbsScreenDeviceResult = iScrDev->HorizontalPixelsToTwips(KHorizontalTestPixels); cWsScreenDeviceResult = wsScrDev->HorizontalPixelsToTwips(KHorizontalTestPixels); percentDifference = Abs((TReal32)(cFbsScreenDeviceResult - cWsScreenDeviceResult)/cFbsScreenDeviceResult*100.0); - testResult = (percentDifference < KTolerance); - if ( !testResult ) - { - _LIT(KHorizPixelsToTwipsDesc, "%d horizontal pixels converted to twips by screen device: FBS=%d, WS=%d"); - WARN_PRINTF4(KHorizPixelsToTwipsDesc, KHorizontalTestPixels, cFbsScreenDeviceResult, cWsScreenDeviceResult); - } - TEST( testResult ); + TEST(percentDifference < KTolerance); // convert the CWsScreenDevice result back again using each class's HorizontalTwipsToPixels // and pass the test if these results are within tolerance - TInt numTwipsToTest = cWsScreenDeviceResult; - cFbsScreenDeviceResult = iScrDev->HorizontalTwipsToPixels(numTwipsToTest); - cWsScreenDeviceResult = wsScrDev->HorizontalTwipsToPixels(numTwipsToTest); + cFbsScreenDeviceResult = iScrDev->HorizontalTwipsToPixels(cWsScreenDeviceResult); + cWsScreenDeviceResult = wsScrDev->HorizontalTwipsToPixels(cWsScreenDeviceResult); percentDifference = Abs((TReal32)(cFbsScreenDeviceResult - cWsScreenDeviceResult)/cFbsScreenDeviceResult*100.0); - testResult = (percentDifference < KTolerance); - if ( !testResult ) - { - _LIT(KHorizTwipsToPixelsDesc, "%d horizontal twips converted to pixels by screen device: FBS=%d, WS=%d"); - WARN_PRINTF4(KHorizTwipsToPixelsDesc, numTwipsToTest, cFbsScreenDeviceResult, cWsScreenDeviceResult); - } - TEST( testResult ); + TEST(percentDifference < KTolerance); // next compare results of the two class's VerticalPixelsToTwips and pass the test // if they are within tolerance cFbsScreenDeviceResult = iScrDev->VerticalPixelsToTwips(KVerticalTestPixels); cWsScreenDeviceResult= wsScrDev->VerticalPixelsToTwips(KVerticalTestPixels); percentDifference = Abs((TReal32)(cFbsScreenDeviceResult - cWsScreenDeviceResult)/cFbsScreenDeviceResult*100.0); - testResult = (percentDifference < KTolerance); - if ( !testResult ) - { - _LIT(KVertPixelsToTwipsDesc, "%d vertical pixels converted to twips by screen device: FBS=%d, WS=%d"); - WARN_PRINTF4(KVertPixelsToTwipsDesc, KVerticalTestPixels, cFbsScreenDeviceResult, cWsScreenDeviceResult); - } - TEST( testResult ); + TEST(percentDifference < KTolerance); // convert the CWsScreenDevice result back again using each class's VerticalTwipsToPixels // and pass the test if these results are within tolerance - numTwipsToTest = cWsScreenDeviceResult; - cFbsScreenDeviceResult = iScrDev->VerticalTwipsToPixels(numTwipsToTest); - cWsScreenDeviceResult = wsScrDev->VerticalTwipsToPixels(numTwipsToTest); + cFbsScreenDeviceResult = iScrDev->VerticalTwipsToPixels(cWsScreenDeviceResult); + cWsScreenDeviceResult = wsScrDev->VerticalTwipsToPixels(cWsScreenDeviceResult); percentDifference = Abs((TReal32)(cFbsScreenDeviceResult - cWsScreenDeviceResult)/cFbsScreenDeviceResult*100.0); - testResult = (percentDifference < KTolerance); - if ( !testResult ) - { - _LIT(KVertTwipsToPixelsDesc, "%d vertical twips converted to pixels by screen device: FBS=%d, WS=%d"); - WARN_PRINTF4(KVertTwipsToPixelsDesc, numTwipsToTest, cFbsScreenDeviceResult, cWsScreenDeviceResult); - } - TEST( testResult ); + TEST(percentDifference < KTolerance); delete wsScrDev; wsSession.Close();