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 "tsgimagesw.h" sl@0: #include sl@0: sl@0: CTSgImageSw::CTSgImageSw() sl@0: { sl@0: INFO_PRINTF1(_L("Graphics resource component test - RSgImage Sw Implementation Tests.\r\n")); sl@0: } sl@0: sl@0: CTSgImageSw::~CTSgImageSw() 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 CTSgImageSw::doTestStepL() sl@0: { sl@0: SetTestStepID(_L("GRAPHICS-RESOURCE-0041")); sl@0: INFO_PRINTF1(_L("Getting supported pixel formats on software implementation.\r\n")); sl@0: TestGetPixelFormatsSWL(); sl@0: RecordTestResultL(); sl@0: sl@0: SetTestStepID(_L("GRAPHICS-RESOURCE-0042")); sl@0: INFO_PRINTF1(_L("Getting the interfaces implemented by CSgImageImpl class.\r\n")); sl@0: TestGetImageInterfacesSWL(); sl@0: RecordTestResultL(); sl@0: sl@0: SetTestStepID(_L("GRAPHICS-RESOURCE-0043")); sl@0: INFO_PRINTF1(_L("Getting the address information from the MSgImage_Sw interface.\r\n")); sl@0: TestGetImageInterfaceAddressInfo(); sl@0: RecordTestResultL(); sl@0: sl@0: return TestStepResult(); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-RESOURCE-0041 sl@0: @SYMTestCaseDesc Gets supported pixel formats on software reference implementation. 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 for the software sl@0: reference implementation. 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 software reference implementation. sl@0: @SYMTestStatus Defined sl@0: */ sl@0: void CTSgImageSw::TestGetPixelFormatsSWL() 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 reference implementation 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: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-RESOURCE-0042 sl@0: @SYMTestCaseDesc Gets the interfaces implemented by CSgImageImpl class. sl@0: @SYMPREQ PREQ39 sl@0: @SYMREQ REQ8809 sl@0: @SYMREQ REQ9175 sl@0: @SYMFssID RSgImage::Create(const TSgImageInfo&, const TAny*, TInt)\n sl@0: RSgImage::GetInterface() sl@0: @SYMTestPriority Critical sl@0: @SYMTestType Unit Test sl@0: @SYMTestPurpose To ensure the MSgImage_Sw interface can be returned from RSgImage. sl@0: @SYMTestActions Initialise the graphics resource component. Create an image. Call sl@0: GetInterface() to return the MSgImage_Sw interface. sl@0: @SYMTestExpectedResults Both interfaces are returned successfully. sl@0: @SYMTestStatus Defined sl@0: */ sl@0: void CTSgImageSw::TestGetImageInterfacesSWL() sl@0: { sl@0: sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-RESOURCE-0043 sl@0: @SYMTestCaseDesc Gets the address information from the MSgImage_Sw interface. sl@0: @SYMPREQ PREQ39 sl@0: @SYMFssID RSgImage::Create(const TSgImageInfo&, const TAny*, TInt)\n sl@0: RSgImage::Interface()\n sl@0: MSgImage_Sw::DataAddress()\n sl@0: MSgImage_Sw::DataStride() sl@0: @SYMTestPriority Critical sl@0: @SYMTestType Unit Test sl@0: @SYMTestPurpose To ensure the software solution of the RSgImage returns sl@0: the correct image address information. sl@0: @SYMTestActions Initialise the graphics resource component. Create an image. Call sl@0: GetInterface() to return the MSgImage_Sw interface. Call the DataAddress() sl@0: and DataStride() functions on the interface. Then modify some random sl@0: byte within the data address of the image and read back to check if the sl@0: byte has been modified. sl@0: @SYMTestExpectedResults The byte should be successfully modified. sl@0: @SYMTestStatus Defined sl@0: */ sl@0: void CTSgImageSw::TestGetImageInterfaceAddressInfo() sl@0: { sl@0: sl@0: }