os/graphics/graphicsresourceservices/graphicsresource/test/tsgimagembx.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicsresourceservices/graphicsresource/test/tsgimagembx.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,110 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @test
    1.22 + @internalComponent - Internal Symbian test code 
    1.23 +*/
    1.24 +
    1.25 +#include "tsgimagembx.h"
    1.26 +
    1.27 +CTSgImageMbx::CTSgImageMbx()
    1.28 +	{
    1.29 +	INFO_PRINTF1(_L("Graphics resource component test - RSgImage MBX Tests.\r\n"));
    1.30 +	}
    1.31 +
    1.32 +CTSgImageMbx::~CTSgImageMbx()
    1.33 +	{
    1.34 +	}
    1.35 +
    1.36 +/** 
    1.37 +Overrides of base class pure virtual
    1.38 +Our implementation only gets called if the base class doTestStepPreambleL() did
    1.39 +not leave. That being the case, the current test result value will be EPass.
    1.40 +@leave Gets system wide error code
    1.41 +@return TVerdict code
    1.42 +*/
    1.43 +TVerdict CTSgImageMbx::doTestStepL()
    1.44 +	{
    1.45 +	SetTestStepID(_L("GRAPHICS-RESOURCE-0040"));
    1.46 +	INFO_PRINTF1(_L("Getting supported pixel formats on the MBX hardware.\r\n"));
    1.47 +	TestGetPixelFormatsMBXL();
    1.48 +	RecordTestResultL();
    1.49 +	
    1.50 +
    1.51 +/**
    1.52 +@SYMTestCaseID			GRAPHICS-RESOURCE-0096
    1.53 +*/
    1.54 +	SetTestStepID(_L("GRAPHICS-RESOURCE-0096"));
    1.55 +	INFO_PRINTF1(_L("Getting the interfaces implemented on the MBX hardware.\r\n"));
    1.56 +	TestGetImageInterfacesMBXL();
    1.57 +	RecordTestResultL();
    1.58 +	
    1.59 +	return TestStepResult();
    1.60 +	}
    1.61 +
    1.62 +
    1.63 +/**
    1.64 +@SYMTestCaseID			GRAPHICS-RESOURCE-0040
    1.65 +@SYMTestCaseDesc		Gets supported pixel formats on the MBX hardware.
    1.66 +@SYMPREQ				PREQ39
    1.67 +@SYMREQ 				REQ8809
    1.68 +@SYMREQ 				REQ9175
    1.69 +@SYMFssID				RSgImage::GetPixelFormats(const TSgImageInfo&, TUidPixelFormat*, TInt&)
    1.70 +@SYMTestPriority		Critical
    1.71 +@SYMTestType			Unit Test
    1.72 +@SYMTestPurpose			To ensure all the available pixel formats are returned 
    1.73 +						in the array and the actual number of pixel formats in
    1.74 +						the input/output aCount parameter on the MBX hardware.
    1.75 +@SYMTestActions			Initialise the graphics resource component. Construct a
    1.76 +						TSgImageInfo object and Initialise the member variables.
    1.77 +						Construct a TInt array of size\n
    1.78 +						\t 1. NULL\n						
    1.79 +						\t 2. greater than the number of supported pixel formats\n
    1.80 +						\t 3. equal to the number of supported pixel formats\n
    1.81 +						\t 4. less than the number of supported pixel formats
    1.82 +@SYMTestExpectedResults	The function must return\n
    1.83 +						\t 1. KErrNone\n
    1.84 +						\t 2. KErrNone\n
    1.85 +						\t 3. KErrNone\n
    1.86 +						\t 4. KErrOverFlow\n
    1.87 +						The supported pixel formats are populated into the array
    1.88 +						and aCount stores the actual number of supported pixel formats.
    1.89 +						The returned pixel formats should cover the pixel formats
    1.90 +						in the image compatibility table that works on all platforms.
    1.91 +						All the returned pixel formats should appear on the image
    1.92 +						compatibility list for the MBX driver.
    1.93 +@SYMTestStatus			Defined 
    1.94 + */
    1.95 +void CTSgImageMbx::TestGetPixelFormatsMBXL()
    1.96 +	{
    1.97 +	TestOpenDriverL();
    1.98 +	//check all the pixel formats returned are in the common compatibility guarantees table
    1.99 +	TestGetPixelFormatCompatibilityGuaranteesL();
   1.100 +	
   1.101 +	//check the pixel formates supported by the MBX hardware only
   1.102 +	CallGetPixelFormatsL(ESgCpuAccessNone, ESgUsageDirectGdiSource|ESgUsageCompositionSource|ESgUsageOpenGlesTexture2D|ESgUsageOpenVgImage|ESgUsageDirectGdiTarget, ETrue, KSgScreenIdMain);
   1.103 +	CheckPixelFormatPresent(EUidPixelFormatRGB_565);
   1.104 +	CheckPixelFormatPresent(EUidPixelFormatXRGB_8888);
   1.105 +	CheckPixelFormatPresent(EUidPixelFormatARGB_8888_PRE);
   1.106 +	
   1.107 +	TestCloseDriver();
   1.108 +	}
   1.109 +
   1.110 +void CTSgImageMbx::TestGetImageInterfacesMBXL()
   1.111 +	{
   1.112 +
   1.113 +	}