/** @SYMTestCaseID GRAPHICS-BITGDI-0104 @SYMTestCaseDesc Test that passing an extended bitmap to CFbsBitmapDevice::NewL() leaves with error KErrAccessDenied. @SYMPREQ PREQ2096 @SYMREQ REQ10847 REQ10856 @SYMTestPriority High @SYMTestStatus Implemented @SYMTestActions Create an extended bitmap using test data and test Uid. Call CFbsBitmapDevice::NewL() with the extended bitmap as the parameter. @SYMTestExpectedResults CFbsBitmapDevice::NewL() leaves with error KErrAccessDenied. */ void CTExtendedBitmapNegative::TestCFbsBitmapDeviceNewLLeavesL() { INFO_PRINTF1(_L("Test that CFbsBitmapDevice leaves with KErrAccessDenied when created with an extended bitmap")); TInt dataSize = sizeof(KColors)+sizeof(TUint8); // estimate the data size TUint8* data = new(ELeave) TUint8[dataSize]; CleanupStack::PushL(data); // Write the colours to be used in the extended bitmap to the data CTExtendedBitmapGc::WriteExtendedBitmapInfoL(data, dataSize, KColors, CTExtendedBitmapGc::EHorizontalStripe); CFbsBitmap* bmp = new(ELeave) CFbsBitmap; CleanupStack::PushL(bmp); TInt err = bmp->CreateExtendedBitmap(TSize(10,10), KBitmapMode, KUidExampleExtendedBitmap, data, dataSize); TEST(err == KErrNone); // CFbsBitmapDevice::NewL() should leave with KErrAccessDenied CFbsBitmapDevice* bmpDevice1 = NULL; TRAPD(error, bmpDevice1 = CFbsBitmapDevice::NewL(bmp)); TEST(error == KErrAccessDenied); delete bmpDevice1; CleanupStack::PopAndDestroy(2, data); }