Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 @internalComponent - Internal Symbian test code
22 #include "tsgimagesw.h"
23 #include <graphics/sgimage_sw.h>
25 CTSgImageSw::CTSgImageSw()
27 INFO_PRINTF1(_L("Graphics resource component test - RSgImage Sw Implementation Tests.\r\n"));
30 CTSgImageSw::~CTSgImageSw()
35 Overrides of base class pure virtual
36 Our implementation only gets called if the base class doTestStepPreambleL() did
37 not leave. That being the case, the current test result value will be EPass.
38 @leave Gets system wide error code
41 TVerdict CTSgImageSw::doTestStepL()
43 SetTestStepID(_L("GRAPHICS-RESOURCE-0041"));
44 INFO_PRINTF1(_L("Getting supported pixel formats on software implementation.\r\n"));
45 TestGetPixelFormatsSWL();
48 SetTestStepID(_L("GRAPHICS-RESOURCE-0042"));
49 INFO_PRINTF1(_L("Getting the interfaces implemented by CSgImageImpl class.\r\n"));
50 TestGetImageInterfacesSWL();
53 SetTestStepID(_L("GRAPHICS-RESOURCE-0043"));
54 INFO_PRINTF1(_L("Getting the address information from the MSgImage_Sw interface.\r\n"));
55 TestGetImageInterfaceAddressInfo();
58 return TestStepResult();
62 @SYMTestCaseID GRAPHICS-RESOURCE-0041
63 @SYMTestCaseDesc Gets supported pixel formats on software reference implementation.
67 @SYMFssID RSgImage::GetPixelFormats(const TSgImageInfo&, TUidPixelFormat*, TInt&)
68 @SYMTestPriority Critical
69 @SYMTestType Unit Test
70 @SYMTestPurpose To ensure all the available pixel formats are returned
71 in the array and the actual number of pixel formats in
72 the input/output aCount parameter for the software
73 reference implementation.
74 @SYMTestActions Initialise the graphics resource component. Construct a
75 TSgImageInfo object and Initialise the member variables.
76 Construct a TInt array of size\n
78 \t 2. greater than the number of supported pixel formats\n
79 \t 3. equal to the number of supported pixel formats\n
80 \t 4. less than the number of supported pixel formats
81 @SYMTestExpectedResults The function must return\n
86 The supported pixel formats are populated into the array
87 and aCount stores the actual number of supported pixel formats.
88 The returned pixel formats should cover the pixel formats
89 in the image compatibility table that works on all platforms.
90 All the returned pixel formats should appear on the image
91 compatibility list for the software reference implementation.
92 @SYMTestStatus Defined
94 void CTSgImageSw::TestGetPixelFormatsSWL()
97 //check all the pixel formats returned are in the common compatibility guarantees table
98 TestGetPixelFormatCompatibilityGuaranteesL();
100 //check the pixel formates supported by the reference implementation only
101 CallGetPixelFormatsL(ESgCpuAccessNone, ESgUsageDirectGdiSource|ESgUsageCompositionSource|ESgUsageOpenGlesTexture2D|ESgUsageOpenVgImage|ESgUsageDirectGdiTarget, ETrue, KSgScreenIdMain);
102 CheckPixelFormatPresent(EUidPixelFormatRGB_565);
103 CheckPixelFormatPresent(EUidPixelFormatXRGB_8888);
104 CheckPixelFormatPresent(EUidPixelFormatARGB_8888_PRE);
111 @SYMTestCaseID GRAPHICS-RESOURCE-0042
112 @SYMTestCaseDesc Gets the interfaces implemented by CSgImageImpl class.
116 @SYMFssID RSgImage::Create(const TSgImageInfo&, const TAny*, TInt)\n
117 RSgImage::GetInterface()
118 @SYMTestPriority Critical
119 @SYMTestType Unit Test
120 @SYMTestPurpose To ensure the MSgImage_Sw interface can be returned from RSgImage.
121 @SYMTestActions Initialise the graphics resource component. Create an image. Call
122 GetInterface() to return the MSgImage_Sw interface.
123 @SYMTestExpectedResults Both interfaces are returned successfully.
124 @SYMTestStatus Defined
126 void CTSgImageSw::TestGetImageInterfacesSWL()
132 @SYMTestCaseID GRAPHICS-RESOURCE-0043
133 @SYMTestCaseDesc Gets the address information from the MSgImage_Sw interface.
135 @SYMFssID RSgImage::Create(const TSgImageInfo&, const TAny*, TInt)\n
136 RSgImage::Interface()\n
137 MSgImage_Sw::DataAddress()\n
138 MSgImage_Sw::DataStride()
139 @SYMTestPriority Critical
140 @SYMTestType Unit Test
141 @SYMTestPurpose To ensure the software solution of the RSgImage returns
142 the correct image address information.
143 @SYMTestActions Initialise the graphics resource component. Create an image. Call
144 GetInterface() to return the MSgImage_Sw interface. Call the DataAddress()
145 and DataStride() functions on the interface. Then modify some random
146 byte within the data address of the image and read back to check if the
147 byte has been modified.
148 @SYMTestExpectedResults The byte should be successfully modified.
149 @SYMTestStatus Defined
151 void CTSgImageSw::TestGetImageInterfaceAddressInfo()