|
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 alftextureautosizeparams.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <alf/alftextureautosizeparams.h> |
|
22 |
|
23 #include "testplatalfvisual.h" |
|
24 |
|
25 |
|
26 |
|
27 // ============================ MEMBER FUNCTIONS =============================== |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CTestPlatAlfVisual::TestTxtAutoSizeParamsConstructor |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 TInt CTestPlatAlfVisual::TestTxtAutoSizeParamsConstructor( CStifItemParser& /*aItem*/ ) |
|
34 { |
|
35 // Print to UI |
|
36 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
37 _LIT( KTestTxtAutoSizeParamsConstructor, "TestTxtAutoSizeParamsConstructor" ); |
|
38 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtAutoSizeParamsConstructor ); |
|
39 // Print to log file |
|
40 iLog->Log( KTestTxtAutoSizeParamsConstructor ); |
|
41 |
|
42 TAlfTextureAutoSizeParams params; |
|
43 |
|
44 return KErrNone; |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CTestPlatAlfVisual::TestTxtAutoSizeParamsGetMethods |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 TInt CTestPlatAlfVisual::TestTxtAutoSizeParamsGetMethods( CStifItemParser& /*aItem*/ ) |
|
52 { |
|
53 // Print to UI |
|
54 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
55 _LIT( KTestTxtAutoSizeParamsGetMethods, "TestTxtAutoSizeParamsGetMethods" ); |
|
56 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtAutoSizeParamsGetMethods ); |
|
57 // Print to log file |
|
58 iLog->Log( KTestTxtAutoSizeParamsGetMethods ); |
|
59 |
|
60 TAlfTextureAutoSizeParams params; |
|
61 |
|
62 TInt target = TAlfTextureAutoSizeParams::EHigh; |
|
63 params.SetSizeLowerThreshold( target ); |
|
64 TInt result = params.SizeLowerThreshold(); |
|
65 STIF_ASSERT_EQUALS( target, result ); |
|
66 target = TAlfTextureAutoSizeParams::ELow; |
|
67 params.SetSizeLowerThreshold( target ); |
|
68 result = params.SizeLowerThreshold(); |
|
69 STIF_ASSERT_EQUALS( target, result ); |
|
70 |
|
71 target = TAlfTextureAutoSizeParams::EHigh; |
|
72 params.SetSizeUpperThreshold( target ); |
|
73 result = params.SizeUpperThreshold(); |
|
74 STIF_ASSERT_EQUALS( target, result ); |
|
75 target = TAlfTextureAutoSizeParams::ELow; |
|
76 params.SetSizeUpperThreshold( target ); |
|
77 result = params.SizeUpperThreshold(); |
|
78 STIF_ASSERT_EQUALS( target, result ); |
|
79 |
|
80 target = TAlfTextureAutoSizeParams::EHigh; |
|
81 params.SetMinSizeChange( target ); |
|
82 result = params.MinSizeChange(); |
|
83 STIF_ASSERT_EQUALS( target, result ); |
|
84 target = TAlfTextureAutoSizeParams::ELow; |
|
85 params.SetMinSizeChange( target ); |
|
86 result = params.MinSizeChange(); |
|
87 STIF_ASSERT_EQUALS( target, result ); |
|
88 |
|
89 target = TAlfTextureAutoSizeParams::EHigh; |
|
90 params.SetDownsizeSettleThreshold( target ); |
|
91 result = params.DownsizeSettleThreshold(); |
|
92 STIF_ASSERT_EQUALS( target, result ); |
|
93 target = TAlfTextureAutoSizeParams::ELow; |
|
94 params.SetDownsizeSettleThreshold( target ); |
|
95 result = params.DownsizeSettleThreshold(); |
|
96 STIF_ASSERT_EQUALS( target, result ); |
|
97 |
|
98 return KErrNone; |
|
99 } |
|
100 |
|
101 // ----------------------------------------------------------------------------- |
|
102 // CTestPlatAlfVisual::TestTxtAutoSizeParamsSetMethods |
|
103 // ----------------------------------------------------------------------------- |
|
104 // |
|
105 TInt CTestPlatAlfVisual::TestTxtAutoSizeParamsSetMethods( CStifItemParser& /*aItem*/ ) |
|
106 { |
|
107 // Print to UI |
|
108 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
109 _LIT( KTestTxtAutoSizeParamsSetMethods, "TestTxtAutoSizeParamsSetMethods" ); |
|
110 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtAutoSizeParamsSetMethods ); |
|
111 // Print to log file |
|
112 iLog->Log( KTestTxtAutoSizeParamsSetMethods ); |
|
113 |
|
114 TAlfTextureAutoSizeParams params; |
|
115 |
|
116 TInt target = TAlfTextureAutoSizeParams::EHigh; |
|
117 params.SetSizeLowerThreshold( target ); |
|
118 TInt result = params.SizeLowerThreshold(); |
|
119 STIF_ASSERT_EQUALS( target, result ); |
|
120 target = TAlfTextureAutoSizeParams::ELow; |
|
121 params.SetSizeLowerThreshold( target ); |
|
122 result = params.SizeLowerThreshold(); |
|
123 STIF_ASSERT_EQUALS( target, result ); |
|
124 |
|
125 target = TAlfTextureAutoSizeParams::EHigh; |
|
126 params.SetSizeUpperThreshold( target ); |
|
127 result = params.SizeUpperThreshold(); |
|
128 STIF_ASSERT_EQUALS( target, result ); |
|
129 target = TAlfTextureAutoSizeParams::ELow; |
|
130 params.SetSizeUpperThreshold( target ); |
|
131 result = params.SizeUpperThreshold(); |
|
132 STIF_ASSERT_EQUALS( target, result ); |
|
133 |
|
134 target = TAlfTextureAutoSizeParams::EHigh; |
|
135 params.SetMinSizeChange( target ); |
|
136 result = params.MinSizeChange(); |
|
137 STIF_ASSERT_EQUALS( target, result ); |
|
138 target = TAlfTextureAutoSizeParams::ELow; |
|
139 params.SetMinSizeChange( target ); |
|
140 result = params.MinSizeChange(); |
|
141 STIF_ASSERT_EQUALS( target, result ); |
|
142 |
|
143 target = TAlfTextureAutoSizeParams::EHigh; |
|
144 params.SetDownsizeSettleThreshold( target ); |
|
145 result = params.DownsizeSettleThreshold(); |
|
146 STIF_ASSERT_EQUALS( target, result ); |
|
147 target = TAlfTextureAutoSizeParams::ELow; |
|
148 params.SetDownsizeSettleThreshold( target ); |
|
149 result = params.DownsizeSettleThreshold(); |
|
150 STIF_ASSERT_EQUALS( target, result ); |
|
151 |
|
152 return KErrNone; |
|
153 } |
|
154 |
|
155 |
|
156 // [End of File] |