First public contribution.
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "textendedbitmapcommon.h"
17 #include "textendedbitmaplegacy.h"
22 const TUint8 KTestData[] = "Extended bitmap test data 123456";
23 const TInt KTestDataSize = sizeof(KTestData);
24 const TInt KTestWidth = 50;
25 const TInt KTestHeight = 50;
26 const TSize KSizeInPixels = TSize(KTestWidth,KTestHeight);
27 const TDisplayMode KDisplayMode = EColor64K;
28 const TInt KBpp = 2; // 2 bpp for EColor64K
30 // Test mbm files used by CTExtendedBitmapLegacy::TestApisThatCallResetL().
31 // These are used to check the operation of CFbsBitmap::Load() when used with
33 _LIT(KRomBmpFilename, "z:\\system\\data\\rf1.mbm");
34 _LIT(KRamBitmapFilenameOnZ, "z:\\system\\data\\16RAM2.mbm");
35 _LIT(KRamBitmapFilename, "c:\\textendedbitmaplegacy_16RAM2.mbm");
39 CTExtendedBitmapLegacy::CTExtendedBitmapLegacy(CTestStep* aStep):
40 CTFbsBase(aStep, ETrue)
44 CTExtendedBitmapLegacy::~CTExtendedBitmapLegacy()
46 ((CTExtendedBitmapLegacyStep*)iStep)->CloseTMSGraphicsStep();
49 void CTExtendedBitmapLegacy::RunFbsTestL(TInt aCurTestCase)
51 ((CTExtendedBitmapLegacyStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
55 ((CTExtendedBitmapLegacyStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0030"));
59 ((CTExtendedBitmapLegacyStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0031"));
63 ((CTExtendedBitmapLegacyStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0032"));
67 ((CTExtendedBitmapLegacyStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0033"));
71 ((CTExtendedBitmapLegacyStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0034"));
75 ((CTExtendedBitmapLegacyStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0035"));
79 ((CTExtendedBitmapLegacyStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0036"));
80 TestApisThatCallResetL();
83 ((CTExtendedBitmapLegacyStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0037"));
87 ((CTExtendedBitmapLegacyStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0038"));
88 TestNotSupportedNoReturnL();
91 ((CTExtendedBitmapLegacyStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0039"));
93 // Fall through as last test case
98 ((CTExtendedBitmapLegacyStep*)iStep)->RecordTestResultL();
104 GRAPHICS-FBSERV-EXTENDEDBITMAP-0030
107 Create an extended bitmap then duplicate it by calling CFbsBitmap::Duplicate()
122 Create an extended bitmap using test data and test Uid.
123 Call Duplicate() on the extended bitmap.
124 Retrieves and validates the bitmap size, display mode, Uid, data and data size.
126 @SYMTestExpectedResults
127 Extended bitmap created and duplicated and information should match exactly.
129 void CTExtendedBitmapLegacy::TestDuplicateL()
131 INFO_PRINTF1(_L("Duplicate - create a duplicate of an extended bitmap"));
133 CFbsBitmap* bmp = new(ELeave) CFbsBitmap;
134 CleanupStack::PushL(bmp);
135 TInt err = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);
138 CFbsBitmap* duplicateBmp = new(ELeave) CFbsBitmap;
139 CleanupStack::PushL(duplicateBmp);
140 err = duplicateBmp->Duplicate(bmp->Handle());
143 // check that the size, display mode etc are all correct
144 TESTSIZEEQUALL(duplicateBmp->SizeInPixels(), KSizeInPixels);
145 TESTEQUALL(duplicateBmp->DisplayMode(), KDisplayMode);
146 TESTEQUALL(duplicateBmp->DisplayMode(), KDisplayMode);
147 TESTEQUALL(duplicateBmp->ExtendedBitmapType(), KUidTestExtendedBitmap);
149 duplicateBmp->BeginDataAccess();
151 const TUint8* returnedDataAddress = reinterpret_cast<TUint8*>(duplicateBmp->DataAddress());
152 TESTNOTEQUALL(returnedDataAddress, NULL);
154 // compare the size of the data in the duplicate bitmap with the size of the original data, they should be the same
155 TInt returnedDataSize = duplicateBmp->DataSize();
156 TESTEQUALL(returnedDataSize, KTestDataSize);
158 // compare the data returned from the duplicate bitmap with the original data, they should be the same
159 TInt res = Mem::Compare(returnedDataAddress, returnedDataSize, KTestData, KTestDataSize);
162 duplicateBmp->EndDataAccess(ETrue);
164 CleanupStack::PopAndDestroy(2, bmp);
169 GRAPHICS-FBSERV-EXTENDEDBITMAP-0031
172 Test that all the legacy CFbsBitmap APIs (i.e. APIs that existed before PREQ2096)
173 that should return KErrAccessDenied for an extended bitmap do so correctly.
190 Create an extended bitmap using test data and test Uid.
191 Call all the legacy APIs that should return KErrAccessDenied:
194 - CompressInBackground()
195 - SwapWidthAndHeight()
197 @SYMTestExpectedResults
198 The legacy APIs tested should all return KErrAccessDenied.
200 void CTExtendedBitmapLegacy::TestAccessDeniedL()
202 INFO_PRINTF1(_L("AccessDenied - test legacy CFbsBitmap APIs that should return KErrAccessDenied when used with an extended bitmap"));
204 CFbsBitmap* bmp = new(ELeave) CFbsBitmap;
205 CleanupStack::PushL(bmp);
206 TInt err = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);
209 INFO_PRINTF1(_L("Resize()"));
210 err = bmp->Resize(TSize(100,100));
211 TESTEXPECTEDERRORL(err, KErrAccessDenied);
213 // This covers both versions of Compress() as one calls the other
214 INFO_PRINTF1(_L("Compress()"));
215 err = bmp->Compress();
216 TESTEXPECTEDERRORL(err, KErrAccessDenied);
218 // This covers both synchronous versions of CompressInBackground() as one calls the other
219 INFO_PRINTF1(_L("CompressInBackground()"));
220 err = bmp->CompressInBackground();
221 TESTEXPECTEDERRORL(err, KErrAccessDenied);
223 // This covers both asynchronous versions of CompressInBackground() as one calls the other
224 INFO_PRINTF1(_L("CompressInBackground() (asynchronous)"));
225 TRequestStatus requestStatus;
226 bmp->CompressInBackground(requestStatus);
227 User::WaitForRequest(requestStatus);
228 TESTEXPECTEDERRORL(requestStatus.Int(), KErrAccessDenied);
230 INFO_PRINTF1(_L("SwapWidthAndHeight()"));
231 err = bmp->SwapWidthAndHeight();
232 TESTEXPECTEDERRORL(err, KErrAccessDenied);
234 CleanupStack::PopAndDestroy(bmp);
239 GRAPHICS-FBSERV-EXTENDEDBITMAP-0032
242 Test that all the legacy CFbsBitmap APIs (i.e. APIs that existted before PREQ2096)
243 that should return KErrNotSupported for an extended bitmap do so correctly, or
244 if they have no return value and are not supported that they return cleanly.
261 Create an extended bitmap using test data and test Uid.
262 Call all the legacy APIs that should return KErrNotSupported:
267 @SYMTestExpectedResults
268 The legacy APIs tested should all return KErrNotSupported where they have return
269 values, they should not cause errors where they are not supported but don't return
272 void CTExtendedBitmapLegacy::TestNotSupportedL()
274 INFO_PRINTF1(_L("NotSupported - test legacy CFbsBitmap APIs that are not supported when used with an extended bitmap"));
276 CFbsBitmap* bmp = new(ELeave) CFbsBitmap;
277 CleanupStack::PushL(bmp);
278 TInt err = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);
281 // Methods that should return KErrNotSupported
282 INFO_PRINTF1(_L("Save() - filename"));
283 _LIT(KFilename, "C:\\temp.mbm");
284 TESTEXPECTEDERRORL(bmp->Save(KFilename), KErrNotSupported);
286 INFO_PRINTF1(_L("Save() - RFile"));
288 err = file.Open(TheFs, KFilename, EFileWrite);
290 CleanupClosePushL(file);
291 TESTEXPECTEDERRORL(bmp->Save(file), KErrNotSupported);
292 CleanupStack::PopAndDestroy(&file);
294 INFO_PRINTF1(_L("GetPalette()"));
296 TESTEXPECTEDERRORL(bmp->GetPalette(palette), KErrNotSupported);
298 INFO_PRINTF1(_L("SetDisplayMode()"));
299 err = bmp->SetDisplayMode(EColor16MU);
300 TESTEXPECTEDERRORL(err, KErrNotSupported);
303 CleanupStack::PopAndDestroy(bmp);
308 GRAPHICS-FBSERV-EXTENDEDBITMAP-0033
311 Test that all CFbsBitmap methods that mention Twips work correctly with extended bitmaps.
328 Create an extended bitmap using test data and test Uid.
329 Call all the legacy APIs that mention Twips:
332 - HorizontalPixelsToTwips()
333 - HorizontalTwipsToPixels()
334 - VerticalPixelsToTwips()
335 - VerticalTwipsToPixels()
337 @SYMTestExpectedResults
338 All methods should work correctly with extended bitmaps.
340 void CTExtendedBitmapLegacy::TestTwipsL()
342 INFO_PRINTF1(_L("Twips - test legacy CFbsBitmap Twips APIs work correctly when used with an extended bitmap"));
343 const TSize KSizeInTwips(20,30);
345 CFbsBitmap* bmp = new(ELeave) CFbsBitmap;
346 CleanupStack::PushL(bmp);
347 TInt err = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);
350 INFO_PRINTF1(_L("SetSizeInTwips()"));
351 bmp->SetSizeInTwips(KSizeInTwips);
353 INFO_PRINTF1(_L("SizeInTwips()"));
354 TESTSIZEEQUALL(bmp->SizeInTwips(), KSizeInTwips);
356 INFO_PRINTF1(_L("HorizontalPixelsToTwips()"));
357 TESTEQUALL(bmp->HorizontalPixelsToTwips(KSizeInPixels.iWidth), KSizeInTwips.iWidth);
359 INFO_PRINTF1(_L("HorizontalTwipsToPixels()"));
360 TESTEQUALL(bmp->HorizontalTwipsToPixels(KSizeInTwips.iWidth), KSizeInPixels.iWidth);
362 INFO_PRINTF1(_L("VerticalPixelsToTwips()"));
363 TESTEQUALL(bmp->VerticalPixelsToTwips(KSizeInPixels.iHeight), KSizeInTwips.iHeight);
365 INFO_PRINTF1(_L("VerticalTwipsToPixels()"));
366 TESTEQUALL(bmp->VerticalTwipsToPixels(KSizeInTwips.iHeight), KSizeInPixels.iHeight);
368 const TDisplayMode displayMode[] = {EColor256, EColor4K, EColor16M, EColor16MU, EColor64K,
369 EGray256, EGray16, EGray4, EGray2, EColor16, EColor16MA, EColor16MAP};
371 err = KErrNotSupported;
372 CFbsScreenDevice* scd = NULL;
373 for(;(ii<TInt(sizeof(displayMode)/sizeof(displayMode[0]))) && (err == KErrNotSupported);++ii)
375 TRAP(err, scd = CFbsScreenDevice::NewL(_L("scdv"),displayMode[ii]));
379 _LIT(KLog,"Failed to create screen device %S return value %d");
380 INFO_PRINTF3(KLog,&ColorModeName(displayMode[ii]),err);
384 _LIT(KLog,"Created Screen Device with mode %S");
385 INFO_PRINTF2(KLog,&ColorModeName(displayMode[ii]));
388 // The size of screen that this is tested on will be different depending on where it is
389 // tested, so just check that this does not cause an error, don't check the result
390 INFO_PRINTF1(_L("SetSizeInTwips() (screen device)"));
391 bmp->SetSizeInTwips(scd);
394 CleanupStack::PopAndDestroy(1, bmp);
399 GRAPHICS-FBSERV-EXTENDEDBITMAP-0034
402 Test the simple getter CFbsBitmap APIs such as Handle().
419 Create an extended bitmap using test data and test Uid.
420 Call the following simple getter APIs:
421 - InitialDisplayMode()
427 - HardwareBitmapHandle()
429 - IsCompressedInRAM()
430 - GetAllBitmapHandles()
432 @SYMTestExpectedResults
433 No errors should occur.
435 void CTExtendedBitmapLegacy::TestGettersL()
437 INFO_PRINTF1(_L("Test simple getter APIs"));
439 CFbsBitmap* bmp = new(ELeave) CFbsBitmap;
440 CleanupStack::PushL(bmp);
441 TInt err = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);
444 INFO_PRINTF1(_L("InitialDisplayMode()"));
445 TESTEQUALL(bmp->InitialDisplayMode(), KDisplayMode);
447 INFO_PRINTF1(_L("IsRomBitmap()"));
448 TESTTRUEL(bmp->IsRomBitmap());
450 INFO_PRINTF1(_L("Handle()"));
451 TESTNOTEQUALL(bmp->Handle(), 0);
453 INFO_PRINTF1(_L("Header()"));
454 SEpocBitmapHeader header = bmp->Header();
455 TESTSIZEEQUALL(header.iSizeInPixels, KSizeInPixels);
456 TESTSIZEEQUALL(header.iSizeInTwips, TSize(0,0));
457 TESTEQUALL(header.iBitsPerPixel, 16);
458 TESTEQUALL(header.iColor, 1);
459 TESTEQUALL(header.iPaletteEntries, 0);
460 TESTEQUALL(header.iCompression, EProprietaryCompression);
462 INFO_PRINTF1(_L("IsLargeBitmap()"));
463 TESTTRUEL(bmp->IsLargeBitmap());
465 INFO_PRINTF1(_L("DataStride()"));
466 TESTEQUALL(bmp->DataStride(), KSizeInPixels.iWidth*KBpp);
468 INFO_PRINTF1(_L("HardwareBitmapHandle()"));
469 TESTEQUALL(bmp->HardwareBitmapHandle(), 0);
471 INFO_PRINTF1(_L("SerialNumber()"));
472 TESTNOTEQUALL(bmp->SerialNumber(), 0);
474 INFO_PRINTF1(_L("IsCompressedInRAM()"));
475 TESTEQUALL(bmp->IsCompressedInRAM(), EFalse);
477 // The touch count changes for a bitmap (not a ROM bitmap) when it is resized etc, it should not change
478 // when Resize() is called on an extended bitmap
479 INFO_PRINTF1(_L("TouchCount()"));
480 TESTEQUALL(bmp->TouchCount(), 0);
481 bmp->Resize(TSize(100,100));
482 TESTEQUALL(bmp->TouchCount(), 0);
484 // Bitmaps (not ROM bitmaps) become volatile if DataAddress() is called outside BeginDataAccess() and EndDataAccess(),
485 // should never be set for extended bitmaps
486 INFO_PRINTF1(_L("IsVolatile()"));
487 TESTEQUALL(bmp->IsVolatile(), EFalse);
489 TESTEQUALL(bmp->IsVolatile(), EFalse);
491 RArray<TInt> handles;
492 CleanupClosePushL(handles);
493 INFO_PRINTF1(_L("GetAllBitmapHandles()"));
494 TESTNOERRORL(bmp->GetAllBitmapHandles(handles));
495 TESTTRUEL(handles.Count() > 0);
497 CleanupStack::PopAndDestroy(2, bmp);
502 GRAPHICS-FBSERV-EXTENDEDBITMAP-0035
505 Test GetScanLine with extended bitmaps where no rasterizer is present.
522 Create an extended bitmap using test data and test Uid that is not supported by a rasterizer.
525 @SYMTestExpectedResults
526 GetScanLine() should return a white scanline of the length requested, no errors should occur.
528 void CTExtendedBitmapLegacy::TestGetScanLineL()
530 INFO_PRINTF1(_L("Test CFbsBitmap::GetScanLine() where there is no supported rasterizer for the passed extended bitmap Uid"));
532 CFbsBitmap* bmp = new(ELeave) CFbsBitmap;
533 CleanupStack::PushL(bmp);
534 TInt err = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);
537 const TInt KScanlineLength = KTestWidth*KBpp;
538 TBuf8<KScanlineLength> buf;
539 bmp->GetScanLine(buf, TPoint(0,0), KTestWidth, KDisplayMode);
540 TESTEQUALL(buf.Size(), KScanlineLength);
542 // Check that the scanline has been set to white
543 for (TInt i = 0; i < KScanlineLength; i++)
545 TESTEQUALL(buf[i], 255);
548 CleanupStack::PopAndDestroy(bmp);
553 GRAPHICS-FBSERV-EXTENDEDBITMAP-0036
556 Test an extended bitmap with all of the CFbsBitmap APIs that call Reset().
572 - Create an extended bitmap using test data and test Uid that is not supported by a rasterizer.
574 The following APIs are tested:
580 @SYMTestExpectedResults
581 All APIs tested should complete with no errors, the resultant CFbsBitmap
582 should not be an extended bitmap as it will have been reset.
584 void CTExtendedBitmapLegacy::TestApisThatCallResetL()
586 INFO_PRINTF1(_L("Test CFbsBitmap APIs that Call Reset()"));
588 CFbsBitmap* bmp = new(ELeave) CFbsBitmap;
589 CleanupStack::PushL(bmp);
590 TInt err = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);
592 TESTEQUALL(bmp->ExtendedBitmapType(), KUidTestExtendedBitmap);
594 INFO_PRINTF1(_L("Load()"));
595 err = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);
597 TESTEQUALL(bmp->ExtendedBitmapType(), KUidTestExtendedBitmap); // should be an extended bitmap again
598 TESTNOERRORL(bmp->Load(KRamBitmapFilename));
599 TESTNOTEQUALL(bmp->ExtendedBitmapType(), KUidTestExtendedBitmap); // should no longer be an extended bitmap
601 INFO_PRINTF1(_L("LoadAndCompress()"));
602 err = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);
604 TESTEQUALL(bmp->ExtendedBitmapType(), KUidTestExtendedBitmap); // should be an extended bitmap again
605 TESTNOERRORL(bmp->LoadAndCompress(KRamBitmapFilename));
606 TESTNOTEQUALL(bmp->ExtendedBitmapType(), KUidTestExtendedBitmap); // should no longer be an extended bitmap
608 INFO_PRINTF1(_L("InternalizeL()"));
609 CBufFlat* buf = CBufFlat::NewL(512);
610 CleanupStack::PushL(buf);
611 RBufWriteStream writeStream(*buf,0);
612 bmp->ExternalizeL(writeStream); // externalize a normal bitmap
614 err = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);
616 TESTEQUALL(bmp->ExtendedBitmapType(), KUidTestExtendedBitmap); // should be an extended bitmap again
617 RBufReadStream readStream(*buf,0);
618 bmp->InternalizeL(readStream);
620 TESTNOTEQUALL(bmp->ExtendedBitmapType(), KUidTestExtendedBitmap); // should no longer be an extended bitmap
622 TUint32* romAddress = NULL;
623 if(!CFbsBitmap::IsFileInRom(KRomBmpFilename, romAddress)) //check any rom bitmap
625 INFO_PRINTF2(_L("Skipping tests of ROM bitmaps since file \"%S\" is reported to not be a ROM bitmap."), &KRomBmpFilename);
626 INFO_PRINTF1(_L("This should only occur on non-XIP ROMs, e.g. NAND ROMs, where ROM bitmaps aren't supported."));
630 INFO_PRINTF1(_L("SetRomBitmapL()"));
631 CFbsBitmapEx* romBitmap = new(ELeave) CFbsBitmapEx;
632 CleanupStack::PushL(romBitmap);
633 INFO_PRINTF2(_L("... attempting to load %S"), &KRomBmpFilename);
634 err = romBitmap->Load(KRomBmpFilename);
637 INFO_PRINTF1(_L("... calling SetRomBitmapL()"));
638 bmp->SetRomBitmapL(romBitmap->BitmapAddress(), size);
639 TESTNOTEQUALL(bmp->ExtendedBitmapType(), KUidTestExtendedBitmap); // should no longer be an extended bitmap
640 TEST(bmp->SerialNumber() == -TInt64(static_cast<TUint32>(bmp->Handle()))); // A ROM bitmap's handle is its address pointer, its serial number is -ve the address pointer
642 CleanupStack::PopAndDestroy(1, romBitmap);
645 CleanupStack::PopAndDestroy(2, bmp);
650 GRAPHICS-FBSERV-EXTENDEDBITMAP-0037
653 Test the CFbsBitmap APIs that should leave when called by an extended bitmap.
671 - Create an extended bitmap using test data and test Uid that is not supported by a rasterizer.
673 The following APIs are tested:
675 - ExternalizeRectangleL()
677 @SYMTestExpectedResults
678 All APIs tested should leave with the error KErrNotSupported.
680 void CTExtendedBitmapLegacy::TestApisThatLeaveL()
682 INFO_PRINTF1(_L("ApisThatLeave - test legacy CFbsBitmap APIs that leave when used with an extended bitmap"));
684 CFbsBitmap* bmp = new(ELeave) CFbsBitmap;
685 CleanupStack::PushL(bmp);
686 TInt err = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);
689 INFO_PRINTF1(_L("ExternalizeL()"));
690 CBufFlat* buf = CBufFlat::NewL(512);
691 CleanupStack::PushL(buf);
692 RBufWriteStream writeStream(*buf,0);
693 CleanupClosePushL(writeStream);
694 TRAP(err, bmp->ExternalizeL(writeStream));
695 TESTEXPECTEDERRORL(err, KErrNotSupported);
697 INFO_PRINTF1(_L("ExternalizeRectangleL()"));
698 RBufWriteStream writeStream2(*buf,0);
699 CleanupClosePushL(writeStream2);
700 TRAP(err, bmp->ExternalizeRectangleL(writeStream2, TRect(10,10,100,100)));
701 TESTEXPECTEDERRORL(err, KErrNotSupported);
703 CleanupStack::PopAndDestroy(4, bmp);
708 GRAPHICS-FBSERV-EXTENDEDBITMAP-0038
711 Test that APIs that do not return an error value or leave, yet are not supported
712 for extended bitmaps, do not cause an error.
730 - Create an extended bitmap using test data and test Uid that is not supported by a rasterizer.
732 The following APIs are tested:
733 - PaletteAttributes()
736 @SYMTestExpectedResults
737 All APIs tested should complete with no errors.
739 void CTExtendedBitmapLegacy::TestNotSupportedNoReturnL()
741 INFO_PRINTF1(_L("NotSupportedNoReturn - test legacy CFbsBitmap APIs that are not supported when used with an extended bitmap but do not return errors"));
743 CFbsBitmap* bmp = new(ELeave) CFbsBitmap;
744 CleanupStack::PushL(bmp);
745 TInt err = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);
748 // Methods that are not supported and do not return errors values
749 INFO_PRINTF1(_L("PaletteAttributes()"));
752 bmp->PaletteAttributes(modifiable, numEntries);
754 INFO_PRINTF1(_L("SetPalette()"));
755 bmp->SetPalette(NULL);
757 CleanupStack::PopAndDestroy(bmp);
762 GRAPHICS-FBSERV-EXTENDEDBITMAP-0039
765 Test GetPixel with extended bitmaps where no rasterizer is present
766 that supports the extended bitmap type.
781 Create an extended bitmap using test data and test Uid that is not supported by a rasterizer.
784 @SYMTestExpectedResults
785 GetPixel() should return white pixels at the points requested, no errors should occur.
787 void CTExtendedBitmapLegacy::TestGetPixelL()
789 INFO_PRINTF1(_L("Test CFbsBitmap::GetPixel() where there is no supported rasterizer for the passed extended bitmap Uid"));
791 CFbsBitmap* bmp = new(ELeave) CFbsBitmap;
792 CleanupStack::PushL(bmp);
793 TInt err = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);
796 // Check that the absence of a rasteriser causes legacy off-screen rendering to
797 // treat the extended bitmap as if all pixels were white.
799 for (TInt y = 0; y < KTestHeight; ++y)
801 for (TInt x = 0; x < KTestWidth; ++x)
803 bmp->GetPixel(color, TPoint(x,y));
804 TESTTRUEL(color == KRgbWhite);
808 CleanupStack::PopAndDestroy(bmp);
811 __CONSTRUCT_STEP__(ExtendedBitmapLegacy)
813 void CTExtendedBitmapLegacyStep::TestSetupL()
815 // Copy files needed by the tests to c:
817 TInt err = BaflUtils::CopyFile(TheFs, KRamBitmapFilenameOnZ, KRamBitmapFilename);
820 ERR_PRINTF2(_L("Error copying test mbm file from rom to ram: %d"), err);
825 void CTExtendedBitmapLegacyStep::TestClose()
827 // Delete files used by the tests from c:
828 BaflUtils::DeleteFile(TheFs, KRamBitmapFilename);