|
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 the License "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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // f32test\server\T_FatCharSetConv_Aux.h |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef T_FATCHARSETCONV_AUX_H |
|
19 #define T_FATCHARSETCONV_AUX_H |
|
20 |
|
21 #include <f32file.h> |
|
22 #include <e32test.h> |
|
23 #include <hal.h> |
|
24 #include "t_server.h" |
|
25 #include "fat_utils.h" |
|
26 |
|
27 using namespace Fat_Test_Utils; |
|
28 class TTestLogFailureData; |
|
29 extern TTestLogFailureData gLogFailureData; |
|
30 extern RRawDisk TheDisk; |
|
31 extern TFatBootSector gBootSector; |
|
32 extern TBool gIOTesting; |
|
33 extern RFs TheFs; |
|
34 extern RFile TheFile; |
|
35 extern RDir TheDir; |
|
36 extern TFileName gSessionPath; |
|
37 extern TInt gAllocFailOff; |
|
38 extern TInt gAllocFailOn; |
|
39 extern TChar gDriveToTest; |
|
40 extern TFileName gFileName; |
|
41 extern TBool gAutoTest; |
|
42 |
|
43 |
|
44 enum TTCType |
|
45 { |
|
46 EUnitaryTest, |
|
47 EBinaryTest, |
|
48 ESymbianFATSpecific |
|
49 }; |
|
50 |
|
51 extern TTCType gTCType; |
|
52 extern TUint gTCId; |
|
53 |
|
54 // function declarations |
|
55 class TTestSwitches; |
|
56 class TTestParamAll; |
|
57 struct TTestCaseUnitaryBasic; |
|
58 |
|
59 // Constants |
|
60 const TInt KFileName350=350; |
|
61 const TInt KFileName50=50; |
|
62 const TInt KFileName20=20; |
|
63 |
|
64 // Literals |
|
65 // Code Pages |
|
66 _LIT(KTestLocale, "t_tlocl_cp932.dll"); |
|
67 |
|
68 //Log file specific |
|
69 _LIT(KLogFileName,"C:\\Failure"); |
|
70 _LIT(KExeLogFileName,"C:\\ExecutionFailure"); |
|
71 _LIT(KVerLogFileName,"C:\\VerificationFailure"); |
|
72 _LIT(KExtension,".txt"); |
|
73 _LIT(KComma,","); |
|
74 _LIT(KUnderScore,"_"); |
|
75 _LIT(KNewLine,"\n"); |
|
76 |
|
77 // FileSystem specific |
|
78 _LIT(KFAT,"Fat"); |
|
79 _LIT(KWin32,"Win32"); |
|
80 |
|
81 // test case type |
|
82 _LIT(KUnitary,"Unitary"); |
|
83 _LIT(KBinary,"Binary"); |
|
84 _LIT(KSymbianFATSpecific,"SymbianFATSpecific"); |
|
85 |
|
86 // test case phases |
|
87 _LIT(KExecution,"Execution"); |
|
88 _LIT(KVerification,"Verification"); |
|
89 |
|
90 // os names |
|
91 _LIT(KWindows,"Windows"); |
|
92 _LIT(KSymbian,"Symbian"); |
|
93 _LIT(KNone,"None"); |
|
94 |
|
95 // log file header |
|
96 _LIT(KLogFileHeader,"IOT,TestCase,FailedDuring,Id,Path,FileSystem,ExeOsName,ExeDrive,VerOsName,VerDrive,API,Line,FunctionName,File"); |
|
97 |
|
98 // general purpose |
|
99 _LIT(KYes,"Yes"); |
|
100 _LIT(KNo,"No"); |
|
101 |
|
102 // function names |
|
103 _LIT(KDoAllBasicUnitaryTestsL,"DoAllBasicUnitaryTestsL"); |
|
104 _LIT(KDoAllBasicBinaryTestsL,"DoAllBasicBinaryTestsL"); |
|
105 _LIT(KTestLeadingE5Handling,"TestLeadingE5Handling"); |
|
106 _LIT(KTestFileLengthMax,"TestFileLengthMax"); |
|
107 _LIT(KTestFileLengthExceedMax,"TestFileLengthExceedMax"); |
|
108 _LIT(KTestVFATCase1,"TestVFATCase1"); |
|
109 _LIT(KTestVFATCase2,"TestVFATCase2"); |
|
110 _LIT(KTestVFATCase3,"TestVFATCase3"); |
|
111 _LIT(KTestIllegalCharsWithDll,"TestIllegalCharsWithDll"); |
|
112 _LIT(KTestIllegalCharsWithoutDLL,"TestIllegalCharsWithoutDLL"); |
|
113 _LIT(KCheckDisk,"CheckDisk"); |
|
114 _LIT(KLogTestFailureData,"LogTestFailureData"); |
|
115 _LIT(KDataGenerationL,"DataGenerationL"); |
|
116 _LIT(KDeletePathAfterTest,"DeletePathAfterTest"); |
|
117 _LIT(KDataExecutionL,"DataExecutionL"); |
|
118 _LIT(KDataVerificationL,"DataVerificationL"); |
|
119 _LIT(KSearchTestCaseByArrayIdx,"SearchTestCaseByArrayIdx"); |
|
120 _LIT(KScanTestDrive,"ScanTestDrive"); |
|
121 _LIT(KTestCompatibility,"TestCompatibility"); |
|
122 |
|
123 // api names |
|
124 _LIT(KGetShortName,"EGetShortName"); |
|
125 _LIT(KGetShortNameWithDLL,"EGetShortNameWithDLL"); |
|
126 _LIT(KGetShortNameWithoutDLL,"EGetShortNameWithoutDLL"); |
|
127 _LIT(KCreateFile,"ECreateFile"); |
|
128 _LIT(KIsValidName,"EIsValidName"); |
|
129 _LIT(KRenameFile,"ERenameFile"); |
|
130 _LIT(KReadFileSection,"EReadFileSection"); |
|
131 _LIT(KDeleteFile,"EDeleteFile"); |
|
132 _LIT(KOpenDir,"EOpenDir"); |
|
133 _LIT(KReadDir,"EReadDir"); |
|
134 _LIT(KRemoveDir,"ERemoveDir"); |
|
135 _LIT(KIsFileInRom,"EIsFileInRom"); |
|
136 _LIT(KReplaceFile,"EReplaceFile"); |
|
137 _LIT(KOperateOnFileNames,"EOperateOnFileNames"); |
|
138 _LIT(KFileModify,"EFileModify"); |
|
139 _LIT(KFileAttributes,"EFileAttributes"); |
|
140 _LIT(KRFsEntry,"ERFsEntry)"); |
|
141 _LIT(KRFsReplace,"ERFsReplace"); |
|
142 _LIT(KRFsRename,"ERFsRename"); |
|
143 _LIT(KGetDir,"EGetDir"); |
|
144 _LIT(KWriteToFile,"EWriteToFile"); |
|
145 _LIT(KReadFromFile,"EReadFromFile"); |
|
146 _LIT(KMkDir,"EMkDir"); |
|
147 _LIT(KMkDirAll,"EMkDirAll"); |
|
148 _LIT(KFileTemp,"EFileTemp"); |
|
149 _LIT(KLongShortConversion,"ELongShortConversion"); |
|
150 |
|
151 #ifdef LOG_FAILURE_DATA |
|
152 #define testAndLog(flag) \ |
|
153 { \ |
|
154 if(flag == EFalse) \ |
|
155 { \ |
|
156 TInt line = __LINE__; \ |
|
157 test.Printf(_L("\nFAILURE on LINE: %d"),line); \ |
|
158 LogTestFailureData(gTCType, failedOnBuf, gTCId, tcUniquePath, line); \ |
|
159 } \ |
|
160 } |
|
161 #else |
|
162 #define testAndLog(flag) \ |
|
163 { \ |
|
164 test(flag); \ |
|
165 } |
|
166 #endif |
|
167 |
|
168 |
|
169 // forward declaration |
|
170 struct TDirSetupFiles; |
|
171 |
|
172 /////////////////////////////////////////////////////////////////////////////// |
|
173 // Files Setup Pattern Definitions |
|
174 /////////////////////////////////////////////////////////////////////////////// |
|
175 static TPtrC gDirPatterns[] = |
|
176 { |
|
177 |
|
178 // ******************************ALPHABETIC-CHARACTERS*************************************************** |
|
179 |
|
180 _L("ABC(DE).TX"), //0 MAJOR <8 ,EXT <3 |
|
181 _L("ABC(DE).TXTTXT"), //1 MAJOR <8 ,EXT >3 |
|
182 _L("ABC(DE).TXT"), //2 MAJOR <8 ,EXT =3 |
|
183 |
|
184 _L("ABCDEF(GH).TX"), //3 MAJOR >8 ,EXT <3 |
|
185 _L("ABCDEF(GH).TXTTXT"), //4 MAJOR >8 ,EXT >3 |
|
186 _L("ABCDEF(GH).TXT"), //5 MAJOR >8 ,EXT =3 |
|
187 |
|
188 _L("ABC(DEF).TX"), //6 MAJOR =8 ,EXT <3 |
|
189 _L("ABC(DEF).TXTTXT"), //7 MAJOR =8 ,EXT >3 |
|
190 _L("ABC(DEF).TXT"), //8 MAJOR =8 ,EXT =3 |
|
191 |
|
192 // ******************************UNICODE-CHARACTERS******************************************************* |
|
193 |
|
194 _L("\x65B0\x65B0.\x65B0"), //9 MAJOR <8 ,EXT <3 |
|
195 _L("\x65B0\x6587.\x65B0\x6587"), //10 MAJOR <8 ,EXT 3>6 |
|
196 _L("\x65B0\x65B0.\x65B0\x65B0\x65B0"), //11 MAJOR <8 ,EXT =6 |
|
197 _L("\x65B0\x65B0.\x65B0\x65B0\x65B0\x65B0"), //12 MAJOR >8 ,EXT >6 |
|
198 |
|
199 _L("\x65B0\x65B0\x65B0\x65B0.\x65B0"), //13 MAJOR =8 ,EXT <3 |
|
200 _L("\x65B0\x65B0\x65B0\x6587.\x65B0\x6587"), //14 MAJOR =8 ,EXT 3>6 |
|
201 _L("\x65B0\x65B0\x65B0\x4EF6.\x65B0\x65B0\x65B0"), //15 MAJOR =8 ,EXT =6 |
|
202 _L("\x65B0\x4EF6\x65B0\x6587.\x65B0\x4EF6\x65B0\x6587"), //16 MAJOR =8 ,EXT >6 |
|
203 |
|
204 _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.\x65B0"), //17 MAJOR 8<16 ,EXT <3 |
|
205 _L("\x65B0\x4EF6\x65B0\x65B0\x6587.\x65B0\x6587"), //18 MAJOR 8<16 ,EXT >3 |
|
206 _L("\x65B0\x6587\x65B0\x4EF6\x65B0.\x65B0\x65B0\x65B0"), //19 MAJOR 8<16 ,EXT =6 |
|
207 _L("\x65B0\x6587\x6587\x6587\x4EF6.\x65B0\x65B0\x65B0\x65B0"), //20 MAJOR 8<16 ,EXT >6 |
|
208 |
|
209 _L("\x65B0\x4EF6\x65B0\x4EF6\x65B0\x4EF6\x65B0\x4EF6.\x4EF6"), //21 MAJOR =16 ,EXT <3 |
|
210 _L("\x4EF6\x4EF6\x65B0\x65B0\x65B0\x65B0\x65B0\x6587.\x65B0\x6587"), //22 MAJOR =16 ,EXT 3>6 |
|
211 _L("\x65B0\x65B0\x65B0\x4EF6\x65B0\x4EF6\x4EF6.\x65B0\x4EF6\x65B0"), //23 MAJOR =16 ,EXT =6 |
|
212 _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.\x65B0\x65B0\x65B0\x65B0"), //24 MAJOR =16 ,EXT >6 |
|
213 |
|
214 _L("\x6587\x6587\x6587\x6587\x65B0\x65B0\x65B0\x65B0\x4EF6\x4EF6.\x65B0"), //25 MAJOR >16 ,EXT <3 |
|
215 _L("\x4EF6\x4EF6\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.\x65B0\x6587"), //26 MAJOR >16 ,EXT 3>6 |
|
216 _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.\x65B0\x65B0\x65B0"), //27 MAJOR >16 ,EXT =6 |
|
217 _L("\x65B0\x65B0\x4EF6\x65B0\x65B0\x65B0\x4EF6\x65B0\x65B0.\x65B0\x65B0\x65B0\x65B0"), //28 MAJOR >16 ,EXT >6 |
|
218 |
|
219 // ******************************MIXED-CHARACTERS********************************************************************* |
|
220 |
|
221 _L("\x65B0(A).\x65B0"), //29 MAJOR <8 ,EXT <3 |
|
222 _L("\x65B0(A).A\x65B0"), //30 MAJOR <8 ,EXT =3 |
|
223 _L("\x65B0(A).A\x65B0\x6587"), //31 MAJOR <8 ,EXT 3<6 |
|
224 _L("\x65B0(A).AB\x65B0\x65B0"), //32 MAJOR <8 ,EXT <6 |
|
225 _L("\x65B0(A).AB\x65B0\x65B0\x65B0\x65B0"), //33 MAJOR <8 ,EXT >6 |
|
226 |
|
227 _L("\x65B0\x65B0(AB).\x65B0"), //34 MAJOR =8 ,EXT <3 |
|
228 _L("(AB)\x65B0\x65B0.A\x65B0"), //35 MAJOR =8 ,EXT =3 |
|
229 _L("\x65B0(AB)\x65B0.A\x65B0\x6587"), //36 MAJOR =8 ,EXT 3<6 |
|
230 _L("\x65B0(\x65B0)AB.AB\x65B0\x65B0"), //37 MAJOR =8 ,EXT <6 |
|
231 _L("\x65B0\x65B0(CD).AB\x65B0\x65B0\x65B0\x65B0"), //38 MAJOR =8 ,EXT >6 |
|
232 |
|
233 _L("\x65B0\x65B0\x65B0\x65B0(AB).\x65B0"), //39 MAJOR 8<16 ,EXT <3 |
|
234 _L("\x65B0\x65B0\x65B0\x65B0(AB).A\x65B0"), //40 MAJOR 8<16 ,EXT =3 |
|
235 _L("AB\x65B0\x6587\x65B0\x65B0.A\x65B0\x6587"), //41 MAJOR 8<16 ,EXT 3<6 |
|
236 _L("CD\x65B0\x6587\x65B0\x65B0.AB\x65B0\x65B0"), //42 MAJOR 8<16 ,EXT <6 |
|
237 _L("\x65B0\x6587(\x65B0\x65B0).AB\x65B0\x65B0\x65B0\x65B0"), //43 MAJOR 8<16 ,EXT >6 |
|
238 |
|
239 _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0(AB).\x65B0"), //44 MAJOR =16 ,EXT <3 |
|
240 _L("(AB)\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.A\x65B0"), //45 MAJOR =16 ,EXT =3 |
|
241 _L("\x65B0\x65B0\x65B0(AB)\x65B0\x65B0\x65B0.A\x65B0\x6587"), //46 MAJOR =16 ,EXT 3<6 |
|
242 _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0(CD).AB\x65B0\x65B0"), //47 MAJOR =16 ,EXT <6 |
|
243 _L("\x65B0\x65B0(\x65B0\x65B0)CD\x65B0\x65B0.AB\x65B0\x65B0\x65B0\x65B0"), //48 MAJOR =16 ,EXT >6 |
|
244 |
|
245 _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0(AB).\x65B0"), //49 MAJOR >16 ,EXT <3 |
|
246 _L("(AB)\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.A\x65B0"), //50 MAJOR >16 ,EXT =3 |
|
247 _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0(CD).A\x65B0\x6587"), //51 MAJOR >16 ,EXT 3<6 |
|
248 _L("\x65B0\x65B0\x65B0(\x65B0\x65B0\x65B0)CD\x65B0\x65B0.AB\x65B0\x65B0"), //52 MAJOR >16 ,EXT <6 |
|
249 _L("CD\x65B0\x65B0(\x65B0\x65B0)\x65B0\x65B0\x65B0\x65B0.AB\x65B0\x65B0\x65B0\x65B0"), //53 MAJOR >16 ,EXT >6 |
|
250 |
|
251 // **************************************************************************************************************************** |
|
252 |
|
253 _L("TESTDIR\\"), //54 |
|
254 _L("TESTDIR\\DIR1\\"), //55 |
|
255 _L("TESTDIR\\DIR2\\"), //56 |
|
256 _L("TESTDIR\\DIR3\\"), //57 |
|
257 _L("TESTDIR\\DIR4\\"), //58 |
|
258 |
|
259 _L("TESTDIR_FS\\"), //59 |
|
260 _L("TESTDIR_FS\\DIR3\\"), //60 |
|
261 _L("TESTDIR_FS\\DIR1\\"), //61 |
|
262 _L("TESTDIR_FS\\DIR2\\"), //62 |
|
263 |
|
264 _L("TESTDIR_FS\\DIR3\\FILE03.TXT"), //63 |
|
265 _L("TESTDIR_FS\\DIR1\\FILE01.TXT"), //64 |
|
266 _L("TESTDIR_FS\\DIR2\\FILE02.TXT"), //65 |
|
267 |
|
268 _L("TESTALPHA.TXT"), //66 |
|
269 _L("TESTALPHA.TXTTXT"), //67 |
|
270 |
|
271 _L("REPLACED.TXT"), //68 |
|
272 _L("REPLACED.TX"), //69 |
|
273 _L("REPLACED.TXTTXT"), //70 |
|
274 |
|
275 _L("XYZ\\"), //71 |
|
276 _L("TESTRENAME.DAT"), //72 |
|
277 |
|
278 _L("\x65B0\x65B0\x65B0\\"), //73 |
|
279 _L("\x65B0\x6587\x4EF6\x4EF6\x6587\x65B0.\x65B0\x4EF6"), //74 |
|
280 |
|
281 _L("AB(\x65B0\x6587)CD\\"), //75 |
|
282 _L("AB\x65B0\x6587(CDEF).\x4EF6(AB)"), //76 |
|
283 |
|
284 |
|
285 _L("\x65B0\x6587\x65B0\x4EF6.TXT"), //77 |
|
286 _L("\x65B0\x6587\x65B0\x4EF6(A).TXT"), //78 |
|
287 _L("\x65B0\x6587\x65B0\x4EF6(B).TXT"), //79 |
|
288 _L("\x65B0\x6587\x65B0\x4EF6(C).TXT"), //80 |
|
289 |
|
290 _L("\x65B0.TXT"), //81 |
|
291 _L("\x65B0\x6587.TXTTXT"), //82 |
|
292 _L("\x65B0\x6587\x4EF6.TX"), //83 |
|
293 |
|
294 _L("ABCDE.\x65B0\x65B0"), //84 |
|
295 _L("ABCDEFG.\x65B0\x65B0\x65B0"), //85 |
|
296 _L("ABCD.\x65B0T"), //86 |
|
297 _L("ABCDE.T\x65B0"), //87 |
|
298 |
|
299 _L("\x222F\x2F3A\x3C3E\x7C00.TXT"), //88 |
|
300 _L("\x235B\x245C\x255D\x265E.TXT"), //89 |
|
301 |
|
302 _L("\x65B0\x6587\\"), //90 |
|
303 _L("\x65B0\x6587\\\x65B0\x6587\x65B0\\"), //91 |
|
304 _L("\x65B0\x6587\\\x65B0\x6587\x65B0\x6587\\"), //92 |
|
305 _L("\x65B0\x6587\\\x65B0\x6587\x65B0\x6587\x65B0\\"), //93 |
|
306 _L("\x65B0\x6587\\\x65B0\x6587\x65B0\x6587\x65B0\x6587\\"), //94 |
|
307 |
|
308 _L("\x65B0\x6587\x4EF6\\"), //95 |
|
309 _L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\\"), //96 |
|
310 _L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\x4EF6\\"), //97 |
|
311 _L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\x4EF6\x6587\\"), //98 |
|
312 |
|
313 _L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\\\x65B0\x4EF6\x65B0\x4EF6\x65B0\x4EF6\x65B0\x4EF6.\x4EF6"), //99 |
|
314 _L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\x4EF6\\\x4EF6\x4EF6\x65B0\x65B0\x65B0\x65B0\x65B0\x6587.\x65B0\x6587"), //100 |
|
315 _L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\x4EF6\x6587\\\x65B0\x65B0\x65B0\x4EF6\x65B0\x4EF6\x4EF6.\x65B0\x4EF6\x65B0"), //101 |
|
316 |
|
317 _L("\x65B0(A)\x6587\\"), //102 |
|
318 _L("\x65B0(A)\x6587\\\x65B0(AB)\x65B0\\"), //103 |
|
319 _L("\x65B0(A)\x6587\\\x65B0(ABCD)\x65B0\\"), //104 |
|
320 _L("\x65B0(A)\x6587\\\x65B0\x65B0(ABCDEF)\x65B0\x65B0\\"), //105 |
|
321 _L("\x65B0(A)\x6587\\\x65B0\x65B0\x65B0(ABGH)\x65B0\x65B0\x65B0\\"), //106 |
|
322 |
|
323 _L("\x65B0\x6587(AB)\\"), //107 |
|
324 _L("\x65B0\x6587(AB)\\\x65B0(A)\x65B0\\"), //108 |
|
325 _L("\x65B0\x6587(AB)\\\x65B0\x4EF6(AB)\x4EF6\\"), //109 |
|
326 _L("\x65B0\x6587(AB)\\\x65B0\x4EF6(ABCDEF)\x4EF6\x6587\\"), //110 |
|
327 |
|
328 _L("\x65B0\x6587(AB)\\\x65B0(A)\x65B0\\\x65B0\x4EF6\x65B0(AB)\x4EF6\x65B0\x4EF6.\x4EF6"), //111 |
|
329 _L("\x65B0\x6587(AB)\\\x65B0\x4EF6(AB)\x4EF6\\\x4EF6\x4EF6(ABC)\x65B0\x65B0\x6587.\x65B0\x6587"), //112 |
|
330 _L("\x65B0\x6587(AB)\\\x65B0\x4EF6(ABCDEF)\x4EF6\x6587\\\x65B0\x65B0\x65B0(CD)\x4EF6\x4EF6.\x65B0\x4EF6\x65B0"), //113 |
|
331 }; |
|
332 |
|
333 #define EOB -1 // 'End Of Block' tag |
|
334 #define CON (EOB - 1) // 'Continue' tag |
|
335 #define LAST 130 // Last item's tag |
|
336 //... |
|
337 |
|
338 // Predefined dir data blocks for testing data setup: |
|
339 #define ALL {0,CON,LAST,EOB} // Block includes all items |
|
340 |
|
341 #define EMPTY {EOB} // Empty block |
|
342 |
|
343 #define BLOCK01 {0,CON,8,EOB} |
|
344 #define BLOCK02 {9,CON,12,EOB} |
|
345 #define BLOCK03 {13,CON,16,EOB} |
|
346 #define BLOCK04 {17,CON,20,EOB} |
|
347 #define BLOCK05 {21,CON,24,EOB} |
|
348 #define BLOCK06 {25,CON,28,EOB} |
|
349 #define BLOCK07 {29,CON,33,EOB} |
|
350 #define BLOCK08 {34,CON,38,EOB} |
|
351 #define BLOCK09 {39,CON,43,EOB} |
|
352 #define BLOCK10 {44,CON,48,EOB} |
|
353 #define BLOCK11 {49,CON,53,EOB} |
|
354 #define BLOCK12 {54,CON,58,EOB} |
|
355 #define BLOCK13 {59,CON,62,EOB} |
|
356 #define BLOCK14 {63,CON,65,EOB} |
|
357 #define BLOCK15 {77,CON,80,EOB} |
|
358 #define BLOCK16 {81,CON,87,EOB} |
|
359 #define BLOCK17 {90,CON,94,EOB} |
|
360 #define BLOCK18 {95,CON,98,EOB} |
|
361 #define BLOCK19 {99,CON,101,EOB} |
|
362 #define BLOCK20 {102,CON,106,EOB} |
|
363 #define BLOCK21 {107,CON,110,EOB} |
|
364 #define BLOCK22 {111,CON,113,EOB} |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 /////////////////////////////////////////////////////////////////////////////// |
|
370 // Data structures for building test case parameters |
|
371 /////////////////////////////////////////////////////////////////////////////// |
|
372 enum TTestingAPI |
|
373 { |
|
374 EGetShortName, |
|
375 EGetShortNameWithDLL, |
|
376 EGetShortNameWithoutDLL, |
|
377 ECreateFile, |
|
378 EIsValidName, |
|
379 ERenameFile, |
|
380 EReadFileSection, |
|
381 EDeleteFile, |
|
382 EOpenDir, |
|
383 EReadDir, |
|
384 ERemoveDir, |
|
385 EIsFileInRom, |
|
386 EReplaceFile, |
|
387 EOperateOnFileNames, |
|
388 EFileModify, |
|
389 EFileAttributes, |
|
390 ERFsEntry, |
|
391 ERFsReplace, |
|
392 ERFsRename, |
|
393 EGetDir, |
|
394 EWriteToFile, |
|
395 EReadFromFile, |
|
396 EMkDir, |
|
397 EMkDirAll, |
|
398 EFileTemp, |
|
399 ELongShortConversion, |
|
400 }; |
|
401 |
|
402 struct TDirSetupFiles |
|
403 { |
|
404 TInt iAddingBlock[25]; |
|
405 TInt iDeductBlock[25]; |
|
406 }; |
|
407 // Basic Testing Parameters |
|
408 struct TTestParamBasic |
|
409 { |
|
410 TUint iTestCaseID; |
|
411 TTestingAPI iAPI; |
|
412 TUint iSwitch; |
|
413 TInt iSyncReturn; |
|
414 TInt iAsyncReturn; |
|
415 TInt iAsyncStatus; |
|
416 }; |
|
417 |
|
418 |
|
419 // Basic Presettings Parameters |
|
420 struct TTestParamBasicPrs |
|
421 { |
|
422 TChar* iDrvChar; |
|
423 TText16* iCmdPath; |
|
424 TText16* iPrsPath; |
|
425 TDirSetupFiles iPrsFiles; |
|
426 TText16* iCmpPath; |
|
427 TDirSetupFiles iCmpFiles; |
|
428 |
|
429 }; |
|
430 |
|
431 // Presettings with file open mode |
|
432 struct TTestParamPrsFileOpen |
|
433 { |
|
434 TTestParamBasicPrs iBasicPrs; |
|
435 TBool iFileOpen; |
|
436 }; |
|
437 |
|
438 // Presettings with file attribs and modified time |
|
439 struct TTestParamPrsAttribsTime |
|
440 { |
|
441 TTestParamBasicPrs iBasicPrs; |
|
442 TUint iAttribsSet; |
|
443 TTime iTime; |
|
444 }; |
|
445 |
|
446 |
|
447 /////////////////////////////////////////////////////////// |
|
448 // Test case data structures |
|
449 /////////////////////////////////////////////////////////// |
|
450 struct TTestCaseUnitaryBasic |
|
451 { |
|
452 TTestParamBasic iBasic; |
|
453 TTestParamBasicPrs iSrcPrsBasic; |
|
454 }; |
|
455 |
|
456 struct TTestCaseBinaryBasic |
|
457 { |
|
458 TTestParamBasic iBasic; |
|
459 TTestParamBasicPrs iSrcPrsBasic; |
|
460 TTestParamBasicPrs iTrgPrsBasic; |
|
461 }; |
|
462 |
|
463 struct TTestCaseUnitaryAttribTime |
|
464 { |
|
465 TTestParamBasic iBasic; |
|
466 TUint iSetAttribs; |
|
467 TUint iClearAttribs; |
|
468 TTestParamPrsAttribsTime iSrcPrsAT; |
|
469 }; |
|
470 |
|
471 struct TTestCaseBinaryAttribTime |
|
472 { |
|
473 TTestParamBasic iBasic; |
|
474 TTestParamPrsAttribsTime iSrcPrsAT; |
|
475 TTestParamPrsAttribsTime iTrgPrsAT; |
|
476 }; |
|
477 |
|
478 //////////////////////////////////////////////////////////// |
|
479 // An interface between test framework and test cases |
|
480 //////////////////////////////////////////////////////////// |
|
481 class TTestParamAll |
|
482 { |
|
483 public: |
|
484 TUint iTestCaseID; |
|
485 TTestingAPI iAPI; |
|
486 TFileName iAPIName; |
|
487 TUint iSwitch; |
|
488 TInt iSyncReturn; |
|
489 TInt iAsyncReturn; |
|
490 TInt iAsyncStatus; |
|
491 |
|
492 TBool iIsWithDLL; |
|
493 |
|
494 TUint iSetAttribs; |
|
495 TUint iClearAttribs; |
|
496 TTime iSetModified; |
|
497 |
|
498 TChar* iSrcDrvChar; |
|
499 |
|
500 TFileName iSrcCmdPath; |
|
501 TFileName iSrcPrsPath; |
|
502 TFileName iTrgCmdPath; |
|
503 |
|
504 TDirSetupFiles iSrcPrsFiles; |
|
505 TUint iSrcPrsAttribs; |
|
506 TTime iSrcPrsTime; |
|
507 TBool iSrcPrsFileOpen; |
|
508 |
|
509 |
|
510 TChar* iTrgDrvChar; |
|
511 |
|
512 }; |
|
513 |
|
514 class TTestSwitches |
|
515 { |
|
516 public: |
|
517 |
|
518 TBool iExeOnSymbian; |
|
519 TBool iVerOnSymbian; |
|
520 TBool iExeOnWindows; |
|
521 TBool iVerOnWindows; |
|
522 TChar iExeDriveChar; |
|
523 TChar iVerDriveChar; |
|
524 TInt iExeDriveNum; |
|
525 TInt iVerDriveNum; |
|
526 TBuf<20> iMountedFSName; |
|
527 }; |
|
528 |
|
529 class TTestLogFailureData |
|
530 { |
|
531 public: |
|
532 |
|
533 TFileName iTCTypeName; // unitary/binary/Special |
|
534 TFileName iTCFailureOn; // test phase data execution/data verification |
|
535 TUint iTCId; |
|
536 TFileName iTCUniquePath; // complete path with DLL/without DLL with Synch/Asynch etc |
|
537 TBuf<20> iFSName; |
|
538 TFileName iExeOsName; // OS name |
|
539 TFileName iVerOsName; // OS name |
|
540 TChar iExeDrive; |
|
541 TChar iVerDrive; |
|
542 TFileName iAPIName; |
|
543 TInt iLineNum; |
|
544 TFileName iFuncName; |
|
545 TBuf8<50> iFileName; |
|
546 }; |
|
547 |
|
548 |
|
549 void LogTestFailureData(TTCType tcType, TFileName failedOn, TUint tcId, TFileName tcUniquePath,TInt line); |
|
550 void ClearTCLogData(); |
|
551 void InitLogData(); |
|
552 void CheckDisk(); |
|
553 void GetBootInfo(); |
|
554 void ReadBootSector(TFatBootSector& aBootSector); |
|
555 void QuickFormat(); |
|
556 TInt SearchTestCaseByArrayIdx(TUint aIdx, const TTestCaseUnitaryBasic aBasicBinaryTestCaseGroup[], TTestParamAll& aTestCaseFound, TBool aIsWithDLL); |
|
557 TInt SearchTestCaseByArrayIdx(TUint aIdx, const TTestCaseBinaryBasic aBasicBinaryTestCaseGroup[], TTestParamAll& aTestCaseFound, TBool aIsWithDLL); |
|
558 void Help(); |
|
559 void ClearSwitches(TTestSwitches& aSwitches); |
|
560 void ParseCommandArguments(TTestSwitches& aSwitches); |
|
561 void InitialiseL(); |
|
562 void RmDir(const TDesC& aDirName); |
|
563 void Cleanup(); |
|
564 void ParsingDirDataBlock(const TInt aDataBlock[], RArray<TInt>& aDirDataArray); |
|
565 void CheckIfIOTesting(TTestSwitches& aSwitches); |
|
566 /*template <class C> |
|
567 TInt controlIo(RFs &fs, TInt drv, TInt fkn, C &c);*/ |
|
568 void MakeFile(const TDesC& aFileName,const TUidType& aUidType,const TDesC8& aFileContents); |
|
569 void MakeFile(const TDesC& aFileName,const TDesC8& aFileContents); |
|
570 void MakeFile(const TDesC& aFileName,TInt anAttributes); |
|
571 void MakeFile(const TDesC& aFileName); |
|
572 TInt CurrentDrive(TChar aDriveChar); |
|
573 TInt CurrentDrive(); |
|
574 void CreateTestDirectory(const TDesC& aSessionPath); |
|
575 void ReportCheckDiskFailure(TInt aRet); |
|
576 void MakeDir(const TDesC& aDirName); |
|
577 void Format(TInt aDrive); |
|
578 |
|
579 //Function declarations |
|
580 void RmDir(const TDesC& aDirName); |
|
581 TBool CompareL(const TDesC& aDir1,const TDesC& aDir2); |
|
582 void SetupDirectories(TBool aCreateFiles, TFileName* aDestOtherDrive); |
|
583 void InitialiseL(); |
|
584 void Cleanup(); |
|
585 void CleanupFileHandles(); |
|
586 void ParsingDirDataBlock(TInt aDataBlock[], RArray<TInt>& aFinalDirDataArray); |
|
587 void SetupDir(TDesC& aPath, TDirSetupFiles aDirSetupData); |
|
588 void SetupDirFiles(const TDesC& aPath, const TDirSetupFiles& aDirFiles); |
|
589 void PrintDir(const TDesC& aPath, const TChar& aDrv); |
|
590 void DoSymbianSpecificCases(); |
|
591 inline TBool isFAT(const TDesC& aFSName) |
|
592 { |
|
593 return (aFSName.Compare(KFAT) == 0); |
|
594 } |
|
595 inline TBool isWin32(const TDesC& aFSName) |
|
596 { |
|
597 return (aFSName.Compare(KWin32) == 0); |
|
598 } |
|
599 |
|
600 //functions that are required by both the .cpp files. |
|
601 GLREF_C void TestLeadingE5Handling(); |
|
602 GLREF_C void TestFileLengthMax(); |
|
603 GLREF_C void TestFileLengthExceedMax(); |
|
604 GLREF_C void TestIllegalCharsWithoutDLL(); |
|
605 GLREF_C void TestIllegalCharsWithDll(); |
|
606 GLREF_C void TestVFATCase1(); |
|
607 GLREF_C void TestVFATCase2(); |
|
608 GLREF_C void TestVFATCase3(); |
|
609 |
|
610 GLREF_C void GetBootInfo(); |
|
611 GLREF_C void QuickFormat(); |
|
612 GLREF_C void ReadBootSector(TFatBootSector& aBootSector); |
|
613 |
|
614 |
|
615 |
|
616 #endif /*T_FATCHARSETCONV_AUX_H*/ |