|
1 /* |
|
2 * Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: test function implement of CTestSdkGraphics |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <e32svr.h> |
|
22 #include <stifparser.h> |
|
23 #include <stiftestinterface.h> |
|
24 #include <palette.h> |
|
25 |
|
26 #include "testsdkgraphics.h" |
|
27 |
|
28 // ============================ MEMBER FUNCTIONS =============================== |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CTestSdkGraphics::RunMethodL |
|
32 // Run specified method. Contains also table of test mothods and their names. |
|
33 // ----------------------------------------------------------------------------- |
|
34 // |
|
35 TInt CTestSdkGraphics::RunMethodL( CStifItemParser& aItem ) |
|
36 { |
|
37 |
|
38 static TStifFunctionInfo const KFunctions[] = |
|
39 { |
|
40 // First string is the function name used in TestScripter script file. |
|
41 // Second is the actual implementation member function. |
|
42 // for DynamicPalette in palette.h. |
|
43 ENTRY( "TestDPDefaultColor256Util", |
|
44 CTestSdkGraphics::TestDPDefaultColor256Util ), |
|
45 ENTRY( "TestDPSetColor256Util", |
|
46 CTestSdkGraphics::TestDPSetColor256Util ), |
|
47 ENTRY( "TestDPColor16array", |
|
48 CTestSdkGraphics::TestDPColor16array ), |
|
49 ENTRY( "TestDPColor16inverse", |
|
50 CTestSdkGraphics::TestDPColor16inverse ), |
|
51 |
|
52 // [test cases entries] |
|
53 |
|
54 }; |
|
55 |
|
56 const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo ); |
|
57 |
|
58 return RunInternalL( KFunctions, count, aItem ); |
|
59 |
|
60 } |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // CTestSdkGraphics::TestDPDefaultColor256Util |
|
64 // ----------------------------------------------------------------------------- |
|
65 // |
|
66 TInt CTestSdkGraphics::TestDPDefaultColor256Util( CStifItemParser& /*aItem*/ ) |
|
67 { |
|
68 |
|
69 // Print to UI |
|
70 _LIT( KTestSdkGraphics, "TestSdkGraphics" ); |
|
71 _LIT( KTestDPDefaultColor256Util, "In TestDPDefaultColor256Util" ); |
|
72 TestModuleIf().Printf( 0, KTestSdkGraphics, KTestDPDefaultColor256Util ); |
|
73 // Print to log file |
|
74 iLog->Log( KTestDPDefaultColor256Util ); |
|
75 |
|
76 DynamicPalette::DefaultColor256Util(); |
|
77 |
|
78 return KErrNone; |
|
79 |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CTestSdkGraphics::TestDPSetColor256Util |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 TInt CTestSdkGraphics::TestDPSetColor256Util( CStifItemParser& /*aItem*/ ) |
|
87 { |
|
88 |
|
89 // Print to UI |
|
90 _LIT( KTestSdkGraphics, "TestSdkGraphics" ); |
|
91 _LIT( KTestDPSetColor256Util, "In TestDPSetColor256Util" ); |
|
92 TestModuleIf().Printf( 0, KTestSdkGraphics, KTestDPSetColor256Util ); |
|
93 // Print to log file |
|
94 iLog->Log( KTestDPSetColor256Util ); |
|
95 |
|
96 DynamicPalette::SetColor256Util( DynamicPalette::EIndex0 ); |
|
97 |
|
98 return KErrNone; |
|
99 |
|
100 } |
|
101 |
|
102 // ----------------------------------------------------------------------------- |
|
103 // CTestSdkGraphics::TestDPColor16array |
|
104 // ----------------------------------------------------------------------------- |
|
105 // |
|
106 TInt CTestSdkGraphics::TestDPColor16array( CStifItemParser& /*aItem*/ ) |
|
107 { |
|
108 |
|
109 // Print to UI |
|
110 _LIT( KTestSdkGraphics, "TestSdkGraphics" ); |
|
111 _LIT( KTestDPColor16array, "In TestDPColor16array" ); |
|
112 TestModuleIf().Printf( 0, KTestSdkGraphics, KTestDPColor16array ); |
|
113 // Print to log file |
|
114 iLog->Log( KTestDPColor16array ); |
|
115 |
|
116 DynamicPalette::Color16array(); |
|
117 |
|
118 return KErrNone; |
|
119 |
|
120 } |
|
121 |
|
122 // ----------------------------------------------------------------------------- |
|
123 // CTestSdkGraphics::TestDPColor16inverse |
|
124 // ----------------------------------------------------------------------------- |
|
125 // |
|
126 TInt CTestSdkGraphics::TestDPColor16inverse( CStifItemParser& /*aItem*/ ) |
|
127 { |
|
128 |
|
129 // Print to UI |
|
130 _LIT( KTestSdkGraphics, "TestSdkGraphics" ); |
|
131 _LIT( KTestDPColor16inverse, "In TestDPColor16inverse" ); |
|
132 TestModuleIf().Printf( 0, KTestSdkGraphics, KTestDPColor16inverse ); |
|
133 // Print to log file |
|
134 iLog->Log( KTestDPColor16inverse ); |
|
135 |
|
136 DynamicPalette::Color16inverse(); |
|
137 |
|
138 return KErrNone; |
|
139 |
|
140 } |
|
141 |
|
142 |
|
143 // [End of File] |