os/graphics/fbs/fontandbitmapserver/tfbs/textendedbitmapnegative.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @test
    19  @internalComponent - Internal Symbian test code
    20 */
    21 
    22 #include <graphics/bitmapuid.h>
    23 #include "textendedbitmapcommon.h"
    24 #include "textendedbitmapnegative.h"
    25 
    26 // Values for valid test extended bitmap
    27 const TUint8 KTestData[]		= "Extended bitmap test data 123456";
    28 const TInt KTestDataSize		= sizeof(KTestData);
    29 const TSize KSizeInPixels 		= TSize(50,50);
    30 const TDisplayMode KDisplayMode	= EColor64K;
    31 
    32 const TInt KMaxPixelSize = KMaxTInt/4; // Maximum pixel size to avoid some overflow problems
    33 const TUint KMaxByteSize = TUint(KMaxTInt/2); // Maximum byte size to avoid other overflow problems
    34 
    35 CTExtendedBitmapNegative::CTExtendedBitmapNegative(CTestStep* aStep):
    36 	CTFbsBase(aStep, ETrue)
    37 	{
    38 	}
    39 
    40 CTExtendedBitmapNegative::~CTExtendedBitmapNegative()
    41 	{
    42 	((CTExtendedBitmapNegativeStep*)iStep)->CloseTMSGraphicsStep();
    43 	}
    44 
    45 void CTExtendedBitmapNegative::RunFbsTestL(TInt aCurTestCase)
    46     {
    47     ((CTExtendedBitmapNegativeStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
    48 	switch(aCurTestCase)
    49 		{
    50 		// CreateExtendedBitmap() tests
    51 	case 1:
    52 		((CTExtendedBitmapNegativeStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0010"));
    53 		CreateWithoutFbsSessionL();
    54 		break;
    55 	case 2:
    56 		((CTExtendedBitmapNegativeStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0011"));
    57 		CreateBadPixelSizeL();
    58 		break;
    59 	case 3:
    60 		((CTExtendedBitmapNegativeStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0012"));
    61 		CreateBadDisplayModeL();
    62 		break;
    63 	case 4:
    64 		((CTExtendedBitmapNegativeStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0013"));
    65 		CreateRestrictedUidL();
    66 		break;
    67 	case 5:
    68 		((CTExtendedBitmapNegativeStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0014"));
    69 		CreateNullDataL();
    70 		break;
    71 	case 6:
    72 		((CTExtendedBitmapNegativeStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0015"));
    73 		CreateBadDataSizeL();
    74 		break;
    75 
    76 		// ExtendedBitmapType() tests
    77 	case 7:
    78 		((CTExtendedBitmapNegativeStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0016"));
    79 		TypeUninitialisedBitmapL();
    80 		break;
    81 	case 8:
    82 		((CTExtendedBitmapNegativeStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0017"));
    83 		TypeStandardBitmapL();
    84 		break;
    85 	case 9:
    86 		((CTExtendedBitmapNegativeStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0018"));
    87 		TypeHardwareBitmapL();
    88 		break;	
    89 
    90 		// DataSize() tests
    91 	case 10:
    92 		((CTExtendedBitmapNegativeStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-EXTENDEDBITMAP-0019"));
    93 		SizeUninitialisedBitmapL();
    94 
    95 		// Fall through as last test case
    96 	default:
    97 		SetLastTestCase();
    98 		break;
    99 		}
   100 	((CTExtendedBitmapNegativeStep*)iStep)->RecordTestResultL();
   101     }
   102 
   103 
   104 // CreateExtendedBitmap() tests
   105 
   106 /**
   107 	@SYMTestCaseID
   108 	GRAPHICS-FBSERV-EXTENDEDBITMAP-0010
   109 
   110 	@SYMTestCaseDesc
   111 	Create an extended bitmap without an FbsSession
   112 
   113 	@SYMPREQ 
   114 	PREQ2096
   115 	
   116 	@SYMREQ
   117 	REQ10847
   118 	REQ10849
   119 
   120 	@SYMTestPriority  
   121 	High
   122 
   123 	@SYMTestStatus 
   124 	Implemented
   125 
   126 	@SYMTestActions
   127 	Test calls RFbsSession::Disconnect() and then attempts to
   128 	create an extended bitmap using test data and test UID.
   129 
   130 	@SYMTestExpectedResults
   131 	Extended bitmap creation should fail returning KErrCouldNotConnect.
   132 */
   133 void CTExtendedBitmapNegative::CreateWithoutFbsSessionL()
   134 	{
   135 	INFO_PRINTF1(_L("Create an extended bitmap with no FbsSession"));
   136 
   137 	const TUint KMinTestThreadHeapSize = 0x00000100;
   138 	const TUint KMaxTestThreadheapSize = 0x00100000;
   139 
   140 	INFO_PRINTF1(_L("Creating new thread with no FbsSession"));
   141 	RThread noFbsThread;
   142 	CleanupClosePushL(noFbsThread);
   143 	_LIT(KNoFbsThreadName, "CTExtendedBitmapNegative_NoFbsThread");
   144 	User::LeaveIfError(noFbsThread.Create(KNoFbsThreadName, CreateWithoutFbsSessionStart, KDefaultStackSize, KMinTestThreadHeapSize, KMaxTestThreadheapSize, NULL));
   145 
   146 	TRequestStatus threadStatus;
   147 	noFbsThread.Logon(threadStatus);
   148 	noFbsThread.SetPriority(EPriorityLess);
   149 	
   150 	INFO_PRINTF1(_L("Resuming new thread, which will call CreateExtendedBitmap() with valid parameters"));	
   151 	noFbsThread.Resume();
   152 
   153 	User::WaitForRequest(threadStatus);
   154 
   155 	TESTEXPECTEDERRORL(noFbsThread.ExitReason(), KErrCouldNotConnect);
   156 	CleanupStack::PopAndDestroy(&noFbsThread);
   157 	}
   158 
   159 
   160 /**
   161 Function for testing with no RFbsSession connected, used by CreateWithoutFbsSessionL().
   162 @see CreateWithoutFbsSessionL() 
   163 @param aInfo Not used
   164 @return Error code returned by CreateExtendedBitmap, with KErrCouldNotConnect expected.
   165  */
   166 TInt CTExtendedBitmapNegative::CreateWithoutFbsSessionStart(TAny* /*aInfo*/)
   167 	{
   168 	TInt res = KErrNone;
   169 	CFbsBitmap* bmp = new CFbsBitmap;
   170 	if (bmp == NULL)
   171 		{
   172 		res = KErrNoMemory;
   173 		}
   174 	
   175 	if (res == KErrNone)
   176 		{
   177 		// Call CFbsBitmap::Rasterizer() for coverage of the case where it is called without a valid FbsSession
   178 		if (bmp->Rasterizer() != NULL)
   179 			{
   180 			res = KErrGeneral;
   181 			}
   182 		}
   183 	
   184 	if (res == KErrNone)
   185 		{
   186 		res = bmp->CreateExtendedBitmap(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize);		
   187 		}
   188 	
   189 	delete bmp;
   190 	
   191 	return res;
   192 	}
   193 
   194 /**
   195 	@SYMTestCaseID
   196 	GRAPHICS-FBSERV-EXTENDEDBITMAP-0011
   197 
   198 	@SYMTestCaseDesc
   199 	Create an extended bitmap with bad pixel size
   200 
   201 	@SYMPREQ 
   202 	PREQ2096
   203 	
   204 	@SYMREQ
   205 	REQ10847
   206 	REQ10849
   207 	REQ10854
   208 
   209 	@SYMTestPriority  
   210 	High
   211 
   212 	@SYMTestStatus 
   213 	Implemented
   214 
   215 	@SYMTestActions
   216 	Creates an extended bitmap using test data and test UID,
   217 	passing invalid values of width/height in aSizeInPixels:
   218 		- negative values
   219 		- exceeding the stated limit KMaxPixelSize
   220 
   221 	@SYMTestExpectedResults
   222 	Extended bitmap creation should fail, with KErrArgument
   223 	returned for negative values, and KErrTooBig returned for
   224 	values exceeding the stated limit.
   225 */
   226 void CTExtendedBitmapNegative::CreateBadPixelSizeL()
   227 	{
   228 	INFO_PRINTF1(_L("Create an extended bitmap with invalid pixel sizes"));
   229 	
   230 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with negative width"));	
   231 	TESTCREATEEXTENDEDBITMAPL(TSize(-1,50), KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrArgument);
   232 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(TSize(-1,50), KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrArgument);
   233 
   234 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with negative height"));	
   235 	TESTCREATEEXTENDEDBITMAPL(TSize(40,-10), KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrArgument);
   236 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(TSize(40,-10), KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrArgument);
   237 	
   238 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with negative width and height"));	
   239 	TESTCREATEEXTENDEDBITMAPL(TSize(-102,-330), KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrArgument);
   240 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(TSize(-102,-330), KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrArgument);
   241 
   242 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with width exceeding stated limit KMaxPixelSize"));	
   243 	TESTCREATEEXTENDEDBITMAPL(TSize(KMaxPixelSize + 1, 33), KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrTooBig);
   244 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(TSize(KMaxPixelSize + 1, 33), KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrTooBig);
   245 
   246 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with height exceeding stated limit KMaxPixelSize"));	
   247 	TESTCREATEEXTENDEDBITMAPL(TSize(43, KMaxPixelSize + 1), KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrTooBig);
   248 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(TSize(43, KMaxPixelSize + 1), KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrTooBig);
   249 
   250 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with width and height exceeding stated limit KMaxPixelSize"));	
   251 	TESTCREATEEXTENDEDBITMAPL(TSize(KMaxPixelSize + 50, KMaxPixelSize + 1), KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrTooBig);
   252 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(TSize(KMaxPixelSize + 50, KMaxPixelSize + 1), KDisplayMode, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrTooBig);
   253 	}
   254 
   255 
   256 /**
   257 	@SYMTestCaseID
   258 	GRAPHICS-FBSERV-EXTENDEDBITMAP-0012
   259 
   260 	@SYMTestCaseDesc
   261 	Create an extended bitmap with bad display modes
   262 
   263 	@SYMPREQ 
   264 	PREQ2096
   265 	
   266 	@SYMREQ
   267 	REQ10847
   268 	REQ10849
   269 	REQ10855
   270 
   271 	@SYMTestPriority  
   272 	High
   273 
   274 	@SYMTestStatus 
   275 	Implemented
   276 
   277 	@SYMTestActions
   278 	Creates an extended bitmap using test data and test UID,
   279 	passing invalid display modes.
   280 
   281 	@SYMTestExpectedResults
   282 	Extended bitmap creation should fail, with KErrArgument
   283 	returned.
   284 */
   285 void CTExtendedBitmapNegative::CreateBadDisplayModeL()
   286 	{
   287 	INFO_PRINTF1(_L("Create an extended bitmap with invalid display modes"));
   288 
   289 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with TDisplayMode::ENone"));	
   290 	TESTCREATEEXTENDEDBITMAPL(KSizeInPixels, ENone, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrArgument);
   291 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(KSizeInPixels, ENone, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrArgument);
   292 
   293 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with TDisplayMode::ERgb"));	
   294 	TESTCREATEEXTENDEDBITMAPL(KSizeInPixels, ERgb, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrArgument);
   295 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(KSizeInPixels, ERgb, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrArgument);
   296 
   297 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with TDisplayMode::EColorLast"));	
   298 	TESTCREATEEXTENDEDBITMAPL(KSizeInPixels, EColorLast, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrArgument);
   299 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(KSizeInPixels, EColorLast, KUidTestExtendedBitmap, KTestData, KTestDataSize, KErrArgument);
   300 	}
   301 
   302 
   303 /**
   304 	@SYMTestCaseID
   305 	GRAPHICS-FBSERV-EXTENDEDBITMAP-0013
   306 
   307 	@SYMTestCaseDesc
   308 	Create an extended bitmap with a UID reserved for OS-use
   309 
   310 	@SYMPREQ 
   311 	PREQ2096
   312 	
   313 	@SYMREQ
   314 	REQ10847
   315 	REQ10849
   316 	REQ10851
   317 
   318 	@SYMTestPriority  
   319 	High
   320 
   321 	@SYMTestStatus 
   322 	Implemented
   323 
   324 	@SYMTestActions
   325 	Creates an extended bitmap using test data and a UID
   326 	reserved for OS-use.
   327 
   328 	@SYMTestExpectedResults
   329 	Extended bitmap creation should fail, with KErrArgument 
   330 	returned.
   331 */
   332 void CTExtendedBitmapNegative::CreateRestrictedUidL()
   333 	{
   334 	INFO_PRINTF1(_L("Create an extended bitmap with reserved UIDs"));
   335 
   336 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with KCBitwiseBitmapUid"));
   337 	TESTCREATEEXTENDEDBITMAPL(KSizeInPixels, KDisplayMode, KCBitwiseBitmapUid, KTestData, KTestDataSize, KErrArgument);
   338 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(KSizeInPixels, KDisplayMode, KCBitwiseBitmapUid, KTestData, KTestDataSize, KErrArgument);
   339 
   340 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with KCBitwiseBitmapHardwareUid"));
   341 	TESTCREATEEXTENDEDBITMAPL(KSizeInPixels, KDisplayMode, KCBitwiseBitmapHardwareUid, KTestData, KTestDataSize, KErrArgument);
   342 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(KSizeInPixels, KDisplayMode, KCBitwiseBitmapHardwareUid, KTestData, KTestDataSize, KErrArgument);
   343 	}
   344 
   345 
   346 /**
   347 	@SYMTestCaseID
   348 	GRAPHICS-FBSERV-EXTENDEDBITMAP-0014
   349 
   350 	@SYMTestCaseDesc
   351 	Create an extended bitmap with NULL data
   352 
   353 	@SYMPREQ 
   354 	PREQ2096
   355 	
   356 	@SYMREQ
   357 	REQ10847
   358 	REQ10849
   359 	REQ10850
   360 
   361 	@SYMTestPriority  
   362 	High
   363 
   364 	@SYMTestStatus 
   365 	Implemented
   366 
   367 	@SYMTestActions
   368 	Creates an extended bitmap using a test Uid, with NULL
   369 	passed in aData 
   370 
   371 	@SYMTestExpectedResults
   372 	Extended bitmap creation should fail, with KErrArgument
   373 	returned.
   374 */
   375 void CTExtendedBitmapNegative::CreateNullDataL()
   376 	{
   377 	INFO_PRINTF1(_L("Create an extended bitmap with null data"));
   378 
   379 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with NULL data and aDataSize set to 0"));
   380 	TESTCREATEEXTENDEDBITMAPL(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, NULL, 0, KErrArgument);
   381 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, NULL, 0, KErrArgument);
   382 
   383 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with NULL data and aDataSize set to 100"));
   384 	TESTCREATEEXTENDEDBITMAPL(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, NULL, 100, KErrArgument);
   385 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, NULL, 100, KErrUnderflow);
   386 	}
   387 
   388 
   389 /**
   390 	@SYMTestCaseID
   391 	GRAPHICS-FBSERV-EXTENDEDBITMAP-0015
   392 
   393 	@SYMTestCaseDesc
   394 	Create an extended bitmap with bad data size
   395 
   396 	@SYMPREQ 
   397 	PREQ2096
   398 	
   399 	@SYMREQ
   400 	REQ10847
   401 	REQ10849
   402 	REQ10850
   403 
   404 	@SYMTestPriority  
   405 	High
   406 
   407 	@SYMTestStatus 
   408 	Implemented
   409 
   410 	@SYMTestActions
   411 	Creates an extended bitmap using test data and test Uid,
   412 	passing a negative aDataSize value.
   413 
   414 	@SYMTestExpectedResults
   415 	Extended bitmap creation should fail, with KErrArgument
   416 	returned for zero data size and a negative data size. 
   417 	KErrTooBig should be returned for data size KMaxByteSize+1.
   418 */
   419 void CTExtendedBitmapNegative::CreateBadDataSizeL()
   420 	{
   421 	INFO_PRINTF1(_L("Create an extended bitmap with invalid data sizes"));
   422 
   423 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with aDataSize set to 0"));
   424 	TESTCREATEEXTENDEDBITMAPL(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, 0, KErrArgument);
   425 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, 0, KErrArgument);
   426 	
   427 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with aDataSize set to KMaxByteSize+1"));
   428 	TESTCREATEEXTENDEDBITMAPL(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KMaxByteSize+1, KErrTooBig);
   429 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, KMaxByteSize+1, KErrTooBig);
   430 
   431 	INFO_PRINTF1(_L("Calling CreateExtendedBitmap() with negative aDataSize"));
   432 	TESTCREATEEXTENDEDBITMAPL(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, -75, KErrArgument);
   433 	TESTCREATEEXTENDEDBITMAPINITIALIZERL(KSizeInPixels, KDisplayMode, KUidTestExtendedBitmap, KTestData, -75, KErrArgument);
   434 	}
   435 
   436 
   437 // ExtendedBitmapType() tests
   438 
   439 /**
   440 	@SYMTestCaseID
   441 	GRAPHICS-FBSERV-EXTENDEDBITMAP-0016
   442 
   443 	@SYMTestCaseDesc
   444 	Gets Extended Bitmap Type on an uninitialised bitmap
   445 
   446 	@SYMPREQ 
   447 	PREQ2096
   448 	
   449 	@SYMREQ
   450 	REQ10847
   451 	REQ10852
   452 	REQ10853
   453 
   454 	@SYMTestPriority  
   455 	Medium
   456 
   457 	@SYMTestStatus 
   458 	Implemented
   459 
   460 	@SYMTestActions
   461 	Calls ExtendedBitmapType() on an uninitialised CFbsBitmap.
   462 
   463 	@SYMTestExpectedResults
   464 	ExtendedBitmapType() should return KNullUid as an uninitialised CFbsBitmap is not an extended bitmap.
   465 */
   466 void CTExtendedBitmapNegative::TypeUninitialisedBitmapL()
   467 	{
   468 	INFO_PRINTF1(_L("Get extended bitmap type on uninitialised bitmap"));
   469 
   470 	CFbsBitmap* bmp = new(ELeave)CFbsBitmap;
   471 	TUid returnedUid = bmp->ExtendedBitmapType();
   472 	delete bmp;
   473 
   474 	TESTEQUALL(KNullUid, returnedUid);
   475 	}
   476 
   477 
   478 /**
   479 	@SYMTestCaseID
   480 	GRAPHICS-FBSERV-EXTENDEDBITMAP-0017
   481 
   482 	@SYMTestCaseDesc
   483 	Gets the Extended Bitmap Type on a standard bitmap
   484 
   485 	@SYMPREQ 
   486 	PREQ2096
   487 	
   488 	@SYMREQ
   489 	REQ10847
   490 	REQ10852
   491 	REQ10853
   492 
   493 	@SYMTestPriority  
   494 	High
   495 
   496 	@SYMTestStatus 
   497 	Implemented
   498 
   499 	@SYMTestActions
   500 	Calls ExtendedBitmapType() on a standard (regular)
   501 	CFbsBitmap.
   502 
   503 	@SYMTestExpectedResults
   504 	ExtendedBitmapType() should return KNullUid as a standard CFbsBitmap is not an extended bitmap.
   505 */
   506 void CTExtendedBitmapNegative::TypeStandardBitmapL()
   507 	{
   508 	INFO_PRINTF1(_L("Get extended bitmap type on a standard bitmap"));
   509 
   510 	CFbsBitmap* bmp = new(ELeave)CFbsBitmap;
   511 	CleanupStack::PushL(bmp);
   512 	TESTNOERRORL(bmp->Create(KSizeInPixels, KDisplayMode));
   513 
   514 	TUid returnedUid = bmp->ExtendedBitmapType();
   515 	CleanupStack::PopAndDestroy(bmp);
   516 
   517 	TESTEQUALL(KNullUid, returnedUid);
   518 	}
   519 
   520 /**
   521 	@SYMTestCaseID
   522 	GRAPHICS-FBSERV-EXTENDEDBITMAP-0018
   523 
   524 	@SYMTestCaseDesc
   525 	Gets the Extended Bitmap Type on a hardware bitmap
   526 
   527 	@SYMPREQ 
   528 	PREQ2096
   529 	
   530 	@SYMREQ
   531 	REQ10847
   532 	REQ10852
   533 	REQ10853
   534 
   535 	@SYMTestPriority  
   536 	High
   537 
   538 	@SYMTestStatus 
   539 	Implemented
   540 
   541 	@SYMTestActions
   542 	Calls ExtendedBitmapType() on a hardware CFbsBitmap.
   543 
   544 	@SYMTestExpectedResults
   545 	ExtendedBitmapType() should return KNullUid as a hardware CFbsBitmap is not an extended bitmap.
   546 */
   547 void CTExtendedBitmapNegative::TypeHardwareBitmapL()
   548 	{
   549 	INFO_PRINTF1(_L("Get extended bitmap type on a hardware bitmap"));
   550 
   551 	CFbsBitmap* bmp = new(ELeave)CFbsBitmap;
   552 	CleanupStack::PushL(bmp);
   553 	
   554 	TInt err = bmp->CreateHardwareBitmap(KSizeInPixels, KDisplayMode, KNullUid);		
   555 	if (err == KErrNotSupported)
   556 		{
   557 		// Hardware bitmaps not supported with the current test configuration
   558 		WARN_PRINTF1(_L("... Hardware bitmaps not supported"));
   559 		}
   560 	else
   561 		{		
   562 		TESTNOERRORL(err);
   563 		TUid returnedUid = bmp->ExtendedBitmapType();
   564 		TESTEQUALL(KNullUid, returnedUid);
   565 		}		
   566 	
   567 	CleanupStack::PopAndDestroy(bmp);	
   568 	}
   569 
   570 // DataSize() tests
   571 
   572 /**
   573 	@SYMTestCaseID
   574 	GRAPHICS-FBSERV-EXTENDEDBITMAP-0019
   575 
   576 	@SYMTestCaseDesc
   577 	Gets Data Size on an uninitialised bitmap
   578 
   579 	@SYMPREQ 
   580 	PREQ2096
   581 	
   582 	@SYMREQ
   583 	REQ10847
   584 	REQ10852	
   585 
   586 	@SYMTestPriority  
   587 	Medium
   588 
   589 	@SYMTestStatus 
   590 	Implemented
   591 
   592 	@SYMTestActions
   593 	Creates an extended bitmap using test data and test Uid,
   594 	calls RFbsSession::Disconnect() and then attempts to
   595 	call DataSize().
   596 
   597 	@SYMTestExpectedResults
   598 	Call should fail, with zero returned.
   599 */
   600 void CTExtendedBitmapNegative::SizeUninitialisedBitmapL()
   601 	{
   602 	INFO_PRINTF1(_L("Get data size on uninitialised bitmap"));
   603 
   604 	CFbsBitmap* bmp = new(ELeave)CFbsBitmap;
   605 	TInt returnedDataSize = bmp->DataSize();
   606 	delete bmp;
   607 
   608 	TESTEQUALL(0, returnedDataSize);
   609 	}
   610 
   611 
   612 //--------------
   613 __CONSTRUCT_STEP__(ExtendedBitmapNegative)