graphicsresourceservices/graphicsresource/test/tsgimagembx.cpp
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2007-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 "tsgimagembx.h"
       
    23 
       
    24 CTSgImageMbx::CTSgImageMbx()
       
    25 	{
       
    26 	INFO_PRINTF1(_L("Graphics resource component test - RSgImage MBX Tests.\r\n"));
       
    27 	}
       
    28 
       
    29 CTSgImageMbx::~CTSgImageMbx()
       
    30 	{
       
    31 	}
       
    32 
       
    33 /** 
       
    34 Overrides of base class pure virtual
       
    35 Our implementation only gets called if the base class doTestStepPreambleL() did
       
    36 not leave. That being the case, the current test result value will be EPass.
       
    37 @leave Gets system wide error code
       
    38 @return TVerdict code
       
    39 */
       
    40 TVerdict CTSgImageMbx::doTestStepL()
       
    41 	{
       
    42 	SetTestStepID(_L("GRAPHICS-RESOURCE-0040"));
       
    43 	INFO_PRINTF1(_L("Getting supported pixel formats on the MBX hardware.\r\n"));
       
    44 	TestGetPixelFormatsMBXL();
       
    45 	RecordTestResultL();
       
    46 	
       
    47 
       
    48 /**
       
    49 @SYMTestCaseID			GRAPHICS-RESOURCE-0096
       
    50 */
       
    51 	SetTestStepID(_L("GRAPHICS-RESOURCE-0096"));
       
    52 	INFO_PRINTF1(_L("Getting the interfaces implemented on the MBX hardware.\r\n"));
       
    53 	TestGetImageInterfacesMBXL();
       
    54 	RecordTestResultL();
       
    55 	
       
    56 	return TestStepResult();
       
    57 	}
       
    58 
       
    59 
       
    60 /**
       
    61 @SYMTestCaseID			GRAPHICS-RESOURCE-0040
       
    62 @SYMTestCaseDesc		Gets supported pixel formats on the MBX hardware.
       
    63 @SYMPREQ				PREQ39
       
    64 @SYMREQ 				REQ8809
       
    65 @SYMREQ 				REQ9175
       
    66 @SYMFssID				RSgImage::GetPixelFormats(const TSgImageInfo&, TUidPixelFormat*, TInt&)
       
    67 @SYMTestPriority		Critical
       
    68 @SYMTestType			Unit Test
       
    69 @SYMTestPurpose			To ensure all the available pixel formats are returned 
       
    70 						in the array and the actual number of pixel formats in
       
    71 						the input/output aCount parameter on the MBX hardware.
       
    72 @SYMTestActions			Initialise the graphics resource component. Construct a
       
    73 						TSgImageInfo object and Initialise the member variables.
       
    74 						Construct a TInt array of size\n
       
    75 						\t 1. NULL\n						
       
    76 						\t 2. greater than the number of supported pixel formats\n
       
    77 						\t 3. equal to the number of supported pixel formats\n
       
    78 						\t 4. less than the number of supported pixel formats
       
    79 @SYMTestExpectedResults	The function must return\n
       
    80 						\t 1. KErrNone\n
       
    81 						\t 2. KErrNone\n
       
    82 						\t 3. KErrNone\n
       
    83 						\t 4. KErrOverFlow\n
       
    84 						The supported pixel formats are populated into the array
       
    85 						and aCount stores the actual number of supported pixel formats.
       
    86 						The returned pixel formats should cover the pixel formats
       
    87 						in the image compatibility table that works on all platforms.
       
    88 						All the returned pixel formats should appear on the image
       
    89 						compatibility list for the MBX driver.
       
    90 @SYMTestStatus			Defined 
       
    91  */
       
    92 void CTSgImageMbx::TestGetPixelFormatsMBXL()
       
    93 	{
       
    94 	TestOpenDriverL();
       
    95 	//check all the pixel formats returned are in the common compatibility guarantees table
       
    96 	TestGetPixelFormatCompatibilityGuaranteesL();
       
    97 	
       
    98 	//check the pixel formates supported by the MBX hardware only
       
    99 	CallGetPixelFormatsL(ESgCpuAccessNone, ESgUsageDirectGdiSource|ESgUsageCompositionSource|ESgUsageOpenGlesTexture2D|ESgUsageOpenVgImage|ESgUsageDirectGdiTarget, ETrue, KSgScreenIdMain);
       
   100 	CheckPixelFormatPresent(EUidPixelFormatRGB_565);
       
   101 	CheckPixelFormatPresent(EUidPixelFormatXRGB_8888);
       
   102 	CheckPixelFormatPresent(EUidPixelFormatARGB_8888_PRE);
       
   103 	
       
   104 	TestCloseDriver();
       
   105 	}
       
   106 
       
   107 void CTSgImageMbx::TestGetImageInterfacesMBXL()
       
   108 	{
       
   109 
       
   110 	}