|
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 functions for alfvisual.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <e32svr.h> |
|
22 #include <stifparser.h> |
|
23 #include <stiftestinterface.h> |
|
24 |
|
25 #include "testplatalfvisual.h" |
|
26 |
|
27 // CONSTANTS |
|
28 const TInt KBufSize = 64; |
|
29 |
|
30 // FORWARD DECLARATION |
|
31 /*This class test protected function of CAlfCurvePathLayout*/ |
|
32 class CTestCAlfCurvePathLayout : public CAlfCurvePathLayout |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * C++ default constructor. |
|
37 */ |
|
38 CTestCAlfCurvePathLayout(); |
|
39 /** |
|
40 * Destructor. |
|
41 */ |
|
42 ~CTestCAlfCurvePathLayout(); |
|
43 /** |
|
44 * TestProtectedFuncForVisual test protected functions of CAlfCurvePathLayout |
|
45 * @since S60 5.0 |
|
46 * @param aItem is not used. |
|
47 * @return Symbian OS error code. |
|
48 */ |
|
49 TInt TestProtectedFuncForVisual( CStifItemParser& aItem ); |
|
50 }; |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // CTestCAlfCurvePathLayout::CTestCAlfCurvePathLayout |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 CTestCAlfCurvePathLayout::CTestCAlfCurvePathLayout(){} |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // CTestCAlfCurvePathLayout::~CTestCAlfCurvePathLayout |
|
60 // ----------------------------------------------------------------------------- |
|
61 // |
|
62 CTestCAlfCurvePathLayout::~CTestCAlfCurvePathLayout(){} |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // CTestCAlfCurvePathLayout::TestProtectedFuncForVisual |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 TInt CTestCAlfCurvePathLayout::TestProtectedFuncForVisual( CStifItemParser& /*aItem*/ ) |
|
69 { |
|
70 TUid vUid = { 0x00000000 }; |
|
71 PropertyOwnerExtension( vUid, NULL ); |
|
72 DoRemoveAndDestroyAllD(); |
|
73 return KErrNone; |
|
74 } |
|
75 |
|
76 // ============================ MEMBER FUNCTIONS =============================== |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CTestPlatAlfVisual::TestAlfCurvePathLayoutAddNewL |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 TInt CTestPlatAlfVisual::TestAlfCurvePathLayoutAddNewL( CStifItemParser& /*aItem*/ ) |
|
83 { |
|
84 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
85 _LIT( KTestAlfCurvePathLayoutAddNewL, "TestAlfCurvePathLayoutAddNewL" ); |
|
86 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathLayoutAddNewL ); |
|
87 // Print to log file |
|
88 iLog->Log( KTestAlfCurvePathLayoutAddNewL ); |
|
89 |
|
90 CAlfCurvePathLayout* vLayout = CAlfCurvePathLayout::AddNewL( *iAlfCtl ); |
|
91 STIF_ASSERT_NOT_NULL( vLayout ); |
|
92 |
|
93 return KErrNone; |
|
94 } |
|
95 |
|
96 // ----------------------------------------------------------------------------- |
|
97 // CTestPlatAlfVisual::TestAlfCurvePathLayoutFullConstructL |
|
98 // ----------------------------------------------------------------------------- |
|
99 // |
|
100 TInt CTestPlatAlfVisual::TestAlfCurvePathLayoutFullConstructL( CStifItemParser& /*aItem*/ ) |
|
101 { |
|
102 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
103 _LIT( KTestAlfCurvePathLayoutFullConstructL, "TestAlfCurvePathLayoutFullConstructL" ); |
|
104 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathLayoutFullConstructL ); |
|
105 // Print to log file |
|
106 iLog->Log( KTestAlfCurvePathLayoutFullConstructL ); |
|
107 |
|
108 CAlfCurvePathLayout* vLayout = new ( ELeave ) CAlfCurvePathLayout; |
|
109 CleanupStack::PushL( vLayout ); |
|
110 vLayout->ConstructL( *iAlfCtl ); |
|
111 CleanupStack::Pop( vLayout ); |
|
112 |
|
113 return KErrNone; |
|
114 } |
|
115 |
|
116 // ----------------------------------------------------------------------------- |
|
117 // CTestPlatAlfVisual::TestAlfCurvePathLayoutForLayoutL |
|
118 // ----------------------------------------------------------------------------- |
|
119 // |
|
120 TInt CTestPlatAlfVisual::TestAlfCurvePathLayoutForLayoutL( CStifItemParser& /*aItem*/ ) |
|
121 { |
|
122 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
123 _LIT( KTestAlfCurvePathLayoutForLayoutL, "TestAlfCurvePathLayoutForLayoutL" ); |
|
124 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathLayoutForLayoutL ); |
|
125 // Print to log file |
|
126 iLog->Log( KTestAlfCurvePathLayoutForLayoutL ); |
|
127 |
|
128 CAlfCurvePathLayout* vLayout = CAlfCurvePathLayout::AddNewL( *iAlfCtl ); |
|
129 vLayout->BaseUnit(); |
|
130 vLayout->CurvePath(); |
|
131 |
|
132 return KErrNone; |
|
133 } |
|
134 |
|
135 // ----------------------------------------------------------------------------- |
|
136 // CTestPlatAlfVisual::TestAlfCurvePathLayoutForVisualL |
|
137 // ----------------------------------------------------------------------------- |
|
138 // |
|
139 TInt CTestPlatAlfVisual::TestAlfCurvePathLayoutForVisualL( CStifItemParser& /*aItem*/ ) |
|
140 { |
|
141 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
142 _LIT( KTestAlfCurvePathLayoutForVisualL, "TestAlfCurvePathLayoutForVisualL" ); |
|
143 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathLayoutForVisualL ); |
|
144 // Print to log file |
|
145 iLog->Log( KTestAlfCurvePathLayoutForVisualL ); |
|
146 |
|
147 CAlfCurvePathLayout* vLayout = CAlfCurvePathLayout::AddNewL( *iAlfCtl ); |
|
148 _LIT8( KTest, "tset" ); |
|
149 TBuf8<KBufSize> vBuf( KTest ); |
|
150 vLayout->FindTag( vBuf ); |
|
151 vLayout->UpdateChildrenLayout(); |
|
152 vLayout->RemoveAndDestroyAllD(); |
|
153 |
|
154 return KErrNone; |
|
155 } |
|
156 |
|
157 // ----------------------------------------------------------------------------- |
|
158 // CTestPlatAlfVisual::TestAlfCurvePathLayoutForMapL |
|
159 // ----------------------------------------------------------------------------- |
|
160 // |
|
161 TInt CTestPlatAlfVisual::TestAlfCurvePathLayoutForMapL( CStifItemParser& /*aItem*/ ) |
|
162 { |
|
163 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
164 _LIT( KTestAlfCurvePathLayoutForMapL, "TestAlfCurvePathLayoutForMapL" ); |
|
165 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathLayoutForMapL ); |
|
166 // Print to log file |
|
167 iLog->Log( KTestAlfCurvePathLayoutForMapL ); |
|
168 |
|
169 CAlfCurvePathLayout* vLayout = CAlfCurvePathLayout::AddNewL( *iAlfCtl ); |
|
170 |
|
171 vLayout->MappingFunctionIdentifier(); |
|
172 vLayout->MapValue( 1, 0 ); |
|
173 |
|
174 return KErrNone; |
|
175 } |
|
176 |
|
177 // ----------------------------------------------------------------------------- |
|
178 // CTestPlatAlfVisual::TestAlfCurvePathLayoutProtectedFuncL |
|
179 // ----------------------------------------------------------------------------- |
|
180 // |
|
181 TInt CTestPlatAlfVisual::TestAlfCurvePathLayoutProtectedFuncL( CStifItemParser& aItem ) |
|
182 { |
|
183 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
184 _LIT( KTestAlfCurvePathLayoutProtectedFuncL, "TestAlfCurvePathLayoutProtectedFuncL" ); |
|
185 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathLayoutProtectedFuncL ); |
|
186 // Print to log file |
|
187 iLog->Log( KTestAlfCurvePathLayoutProtectedFuncL ); |
|
188 |
|
189 CTestCAlfCurvePathLayout* vLayout = new ( ELeave ) CTestCAlfCurvePathLayout; |
|
190 CleanupStack::PushL( vLayout ); |
|
191 vLayout->ConstructL( *iAlfCtl ); |
|
192 vLayout->TestProtectedFuncForVisual( aItem ); |
|
193 CleanupStack::Pop( vLayout ); |
|
194 |
|
195 return KErrNone; |
|
196 } |
|
197 |
|
198 // End of file |