sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: #include "tsgimagembx.h" sl@0: sl@0: CTSgImageMbx::CTSgImageMbx() sl@0: { sl@0: INFO_PRINTF1(_L("Graphics resource component test - RSgImage MBX Tests.\r\n")); sl@0: } sl@0: sl@0: CTSgImageMbx::~CTSgImageMbx() sl@0: { sl@0: } sl@0: sl@0: /** sl@0: Overrides of base class pure virtual sl@0: Our implementation only gets called if the base class doTestStepPreambleL() did sl@0: not leave. That being the case, the current test result value will be EPass. sl@0: @leave Gets system wide error code sl@0: @return TVerdict code sl@0: */ sl@0: TVerdict CTSgImageMbx::doTestStepL() sl@0: { sl@0: SetTestStepID(_L("GRAPHICS-RESOURCE-0040")); sl@0: INFO_PRINTF1(_L("Getting supported pixel formats on the MBX hardware.\r\n")); sl@0: TestGetPixelFormatsMBXL(); sl@0: RecordTestResultL(); sl@0: sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-RESOURCE-0096 sl@0: */ sl@0: SetTestStepID(_L("GRAPHICS-RESOURCE-0096")); sl@0: INFO_PRINTF1(_L("Getting the interfaces implemented on the MBX hardware.\r\n")); sl@0: TestGetImageInterfacesMBXL(); sl@0: RecordTestResultL(); sl@0: sl@0: return TestStepResult(); sl@0: } sl@0: sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-RESOURCE-0040 sl@0: @SYMTestCaseDesc Gets supported pixel formats on the MBX hardware. sl@0: @SYMPREQ PREQ39 sl@0: @SYMREQ REQ8809 sl@0: @SYMREQ REQ9175 sl@0: @SYMFssID RSgImage::GetPixelFormats(const TSgImageInfo&, TUidPixelFormat*, TInt&) sl@0: @SYMTestPriority Critical sl@0: @SYMTestType Unit Test sl@0: @SYMTestPurpose To ensure all the available pixel formats are returned sl@0: in the array and the actual number of pixel formats in sl@0: the input/output aCount parameter on the MBX hardware. sl@0: @SYMTestActions Initialise the graphics resource component. Construct a sl@0: TSgImageInfo object and Initialise the member variables. sl@0: Construct a TInt array of size\n sl@0: \t 1. NULL\n sl@0: \t 2. greater than the number of supported pixel formats\n sl@0: \t 3. equal to the number of supported pixel formats\n sl@0: \t 4. less than the number of supported pixel formats sl@0: @SYMTestExpectedResults The function must return\n sl@0: \t 1. KErrNone\n sl@0: \t 2. KErrNone\n sl@0: \t 3. KErrNone\n sl@0: \t 4. KErrOverFlow\n sl@0: The supported pixel formats are populated into the array sl@0: and aCount stores the actual number of supported pixel formats. sl@0: The returned pixel formats should cover the pixel formats sl@0: in the image compatibility table that works on all platforms. sl@0: All the returned pixel formats should appear on the image sl@0: compatibility list for the MBX driver. sl@0: @SYMTestStatus Defined sl@0: */ sl@0: void CTSgImageMbx::TestGetPixelFormatsMBXL() sl@0: { sl@0: TestOpenDriverL(); sl@0: //check all the pixel formats returned are in the common compatibility guarantees table sl@0: TestGetPixelFormatCompatibilityGuaranteesL(); sl@0: sl@0: //check the pixel formates supported by the MBX hardware only sl@0: CallGetPixelFormatsL(ESgCpuAccessNone, ESgUsageDirectGdiSource|ESgUsageCompositionSource|ESgUsageOpenGlesTexture2D|ESgUsageOpenVgImage|ESgUsageDirectGdiTarget, ETrue, KSgScreenIdMain); sl@0: CheckPixelFormatPresent(EUidPixelFormatRGB_565); sl@0: CheckPixelFormatPresent(EUidPixelFormatXRGB_8888); sl@0: CheckPixelFormatPresent(EUidPixelFormatARGB_8888_PRE); sl@0: sl@0: TestCloseDriver(); sl@0: } sl@0: sl@0: void CTSgImageMbx::TestGetImageInterfacesMBXL() sl@0: { sl@0: sl@0: }