author | hgs |
Wed, 12 May 2010 10:34:10 +0100 | |
changeset 133 | 2a0ada0a1bf8 |
parent 90 | 947f0dc9f7a8 |
child 109 | b3a1d9898418 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1996-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_locate.cpp |
|
15 |
// |
|
16 |
// |
|
17 |
#define __E32TEST_EXTENSION__ |
|
18 |
#include <f32file.h> |
|
19 |
#include <e32test.h> |
|
20 |
#include "t_server.h" |
|
21 |
||
22 |
||
23 |
||
24 |
GLDEF_D RTest test(_L("T_LOCATE")); |
|
25 |
||
26 |
LOCAL_D TFileName gPath1; |
|
27 |
LOCAL_D TFileName gPath2; |
|
28 |
LOCAL_D TFileName gPath3; |
|
29 |
LOCAL_D TFileName gPath4; |
|
30 |
LOCAL_D TFileName gPath5; |
|
31 |
||
32 |
||
33 |
LOCAL_D TFileName gRemovableDriveFile; |
|
34 |
LOCAL_D TFileName gInternalDriveFile; |
|
35 |
LOCAL_D TFileName gInternalDriveFile2; |
|
36 |
||
37 |
||
38 |
LOCAL_D TChar removableDriveLetter; |
|
39 |
LOCAL_D TChar internalDriveLetter; |
|
40 |
||
41 |
||
42 |
LOCAL_D TInt removableFlag=0; |
|
43 |
LOCAL_D TInt internalFlag=0; |
|
44 |
||
45 |
||
46 |
||
47 |
LOCAL_C void Md(const TDesC& aDirName) |
|
48 |
// |
|
49 |
// Make a dir |
|
50 |
// |
|
51 |
{ |
|
52 |
||
53 |
TInt r=TheFs.MkDirAll(aDirName); |
|
54 |
if (r == KErrCorrupt) |
|
55 |
test.Printf(_L("Media corruption; previous test may have aborted; else, check hardware\n")); |
|
56 |
else if (r == KErrNotReady) |
|
57 |
test.Printf(_L("No medium present / drive not ready, previous test may have hung; else, check hardware\n")); |
|
58 |
test_Value(r, r == KErrNone || r == KErrAlreadyExists); |
|
59 |
} |
|
60 |
||
61 |
LOCAL_C void Mf(const TDesC& aFileName) |
|
62 |
// |
|
63 |
// Make a file |
|
64 |
// |
|
65 |
{ |
|
66 |
||
67 |
RFile file; |
|
68 |
TInt r = file.Replace(TheFs,aFileName,0); |
|
69 |
if (r == KErrPathNotFound) |
|
70 |
{ |
|
71 |
test.Printf(_L("Mf: Path Not Found\n")); |
|
72 |
Md(aFileName); |
|
73 |
r=file.Replace(TheFs,aFileName,0); |
|
74 |
} |
|
75 |
||
76 |
if (r == KErrCorrupt) |
|
77 |
test.Printf(_L("Media corruption; previous test may have aborted; else, check hardware\n")); |
|
78 |
else if (r == KErrNotReady) |
|
79 |
test.Printf(_L("No medium present / drive not ready, previous test may have hung; else, check hardware\n")); |
|
80 |
||
81 |
test_Value(r, r == KErrNone || r == KErrAlreadyExists); |
|
82 |
file.Close(); |
|
83 |
} |
|
84 |
||
85 |
LOCAL_C void MakeLocateTestDirectoryStructure() |
|
86 |
// |
|
87 |
// Create files for test |
|
88 |
// |
|
89 |
{ |
|
90 |
test.Next(_L("Create LOCTEST directories")); |
|
91 |
Md(_L("\\F32-TST\\LOCTEST\\BIN1\\")); |
|
92 |
Md(_L("\\F32-TST\\LOCTEST\\BIN2\\")); |
|
93 |
Md(_L("\\F32-TST\\LOCTEST\\BIN3\\")); |
|
94 |
Md(_L("\\F32-TST\\LOCTEST\\BIN1\\BIN4\\")); |
|
95 |
||
96 |
||
97 |
||
98 |
#if defined(_DEBUG) |
|
99 |
TheFs.SetErrorCondition(-47,5); |
|
100 |
TDriveInfo drive; |
|
101 |
for (TInt i=0;i<5;i++) |
|
102 |
{ |
|
103 |
TInt r=TheFs.Drive(drive); |
|
104 |
test(r==KErrNone); |
|
105 |
} |
|
106 |
TInt r=TheFs.MkDirAll(_L("alskdjfl")); |
|
107 |
test(r==-47); |
|
108 |
r=TheFs.MkDirAll(_L("alskdjfl")); |
|
109 |
test(r==-47); |
|
110 |
TheFs.SetErrorCondition(KErrNone); |
|
111 |
r=TheFs.Drive(drive); |
|
112 |
test(r==KErrNone); |
|
113 |
#endif |
|
114 |
// |
|
115 |
test.Next(_L("Create LOCTEST files")); |
|
116 |
Mf(_L("\\F32-TST\\LOCTEST\\FILE1.AAA")); |
|
117 |
Mf(_L("\\F32-TST\\LOCTEST\\FILE2.BBB")); |
|
118 |
Mf(_L("\\F32-TST\\LOCTEST\\FILE3.CCC")); |
|
119 |
Mf(_L("\\F32-TST\\LOCTEST\\WORK.AAA")); |
|
120 |
Mf(_L("\\F32-TST\\LOCTEST\\HOME.CCC")); |
|
121 |
Mf(_L("\\F32-TST\\LOCTEST\\FILE.AAA")); |
|
122 |
Mf(_L("C:\\F32-TST\\LOCTEST\\BIN1\\FILE1.AAA")); |
|
123 |
Mf(_L("C:\\F32-TST\\LOCTEST\\BIN1\\WORK.AAA")); |
|
124 |
Mf(_L("C:\\F32-TST\\LOCTEST\\BIN1\\WORK.BBB")); |
|
125 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN1\\FILE1.AAA")); |
|
126 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN1\\WORK.AAA")); |
|
127 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN1\\WORK.BBB")); |
|
128 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN1\\CONFUSED.DOG")); |
|
129 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN2\\FILE1.BBB")); |
|
130 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN2\\WORK.BBB")); |
|
131 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN2\\FILE2.BBB")); |
|
132 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN2\\FILE3.BBB")); |
|
133 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN3\\FILE3.CCC")); |
|
134 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN3\\WORK.CCC")); |
|
135 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN3\\PLAY.CCC")); |
|
136 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN1\\BIN4\\FILE1.AAA")); |
|
137 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN1\\BIN4\\FILE2.BBB")); |
|
138 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN1\\BIN4\\FILE3.CCC")); |
|
139 |
Mf(_L("\\F32-TST\\LOCTEST\\BIN1\\BIN4\\FILE4.DDD")); |
|
140 |
||
141 |
||
142 |
||
143 |
} |
|
144 |
||
145 |
||
146 |
LOCAL_C void CreateFilesInRemovableDrive() |
|
147 |
{ |
|
148 |
||
149 |
||
150 |
TInt err; |
|
151 |
TDriveList driveList; |
|
152 |
TDriveInfo info; |
|
153 |
||
154 |
err = TheFs.DriveList(driveList); |
|
155 |
test( err == KErrNone ); |
|
156 |
||
157 |
for (TInt i = 0; i < KMaxDrives; i++) |
|
158 |
{ |
|
159 |
||
160 |
if (driveList[i]) |
|
161 |
{ |
|
162 |
err = TheFs.Drive(info, i); |
|
163 |
test( err == KErrNone ); |
|
164 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
165 |
if(( info.iDriveAtt & KDriveAttRemovable ) && !( info.iDriveAtt & KDriveAttLogicallyRemovable )) |
0 | 166 |
{ |
167 |
||
168 |
if ( ( info.iType != EMediaNotPresent) && (info.iType != EMediaUnknown) && (info.iType != EMediaCdRom) ) |
|
169 |
{ |
|
170 |
TheFs.DriveToChar(i,removableDriveLetter) ; |
|
171 |
gRemovableDriveFile.Append (removableDriveLetter); |
|
172 |
gRemovableDriveFile.Append (_L(":\\F32-TST\\LOCTEST\\BIN\\FINDFILE.AAA") ); |
|
173 |
||
174 |
Mf(gRemovableDriveFile); |
|
175 |
removableFlag=1; |
|
176 |
break; |
|
177 |
} |
|
178 |
else |
|
179 |
continue; |
|
180 |
||
181 |
||
182 |
} |
|
183 |
||
184 |
||
185 |
} |
|
186 |
||
187 |
} |
|
188 |
||
189 |
} |
|
190 |
||
191 |
||
192 |
||
193 |
LOCAL_C void CreateFilesInInternalDrive() |
|
194 |
{ |
|
195 |
||
196 |
TInt err; |
|
197 |
TDriveList driveList; |
|
198 |
TDriveInfo info; |
|
199 |
||
200 |
err = TheFs.DriveList(driveList); |
|
201 |
test( err == KErrNone ); |
|
202 |
||
203 |
for (TInt i = 0; i < KMaxDrives; i++) |
|
204 |
{ |
|
205 |
||
206 |
if (driveList[i]) |
|
207 |
{ |
|
208 |
err = TheFs.Drive(info, i); |
|
209 |
test( err == KErrNone ); |
|
210 |
||
211 |
if( info.iDriveAtt & KDriveAttInternal ) |
|
212 |
{ |
|
213 |
||
214 |
TheFs.DriveToChar(i,internalDriveLetter) ; |
|
215 |
gInternalDriveFile.Append (internalDriveLetter); |
|
216 |
gInternalDriveFile.Append (_L(":\\F32-TST\\LOCTEST\\BIN\\INT\\FINDINTERNALFILE.AAA") ); |
|
217 |
||
218 |
gInternalDriveFile2.Append (internalDriveLetter); |
|
219 |
gInternalDriveFile2.Append (_L(":\\F32-TST\\LOCTEST\\BIN\\INT\\FINDINTERNALFILE_B.AAA") ); |
|
220 |
||
221 |
Mf(gInternalDriveFile); |
|
222 |
Mf(gInternalDriveFile2); |
|
223 |
internalFlag=1; |
|
224 |
||
225 |
break; |
|
226 |
} |
|
227 |
||
228 |
} |
|
229 |
||
230 |
} |
|
231 |
||
232 |
||
233 |
} |
|
234 |
||
235 |
||
236 |
||
237 |
||
238 |
LOCAL_C void DeleteRemovableDirectory() |
|
239 |
{ |
|
240 |
||
241 |
//Delete the directory structure we created in the removalbe drive |
|
242 |
if ( removableFlag == 1 ) |
|
243 |
{ |
|
244 |
CFileMan* fMan=CFileMan::NewL(TheFs); |
|
245 |
test(fMan!=NULL); |
|
246 |
||
247 |
TFileName gPathRem; |
|
248 |
gPathRem.Append (removableDriveLetter); |
|
249 |
gPathRem.Append (_L(":\\F32-TST\\") ); |
|
250 |
TInt r=fMan->RmDir(gPathRem); |
|
251 |
test(r==KErrNone); |
|
252 |
||
253 |
delete fMan; |
|
254 |
} |
|
255 |
} |
|
256 |
||
257 |
LOCAL_C void DeleteInternalDirectory() |
|
258 |
{ |
|
259 |
||
260 |
//Delete the directory structure we created in the internal drive |
|
261 |
||
262 |
||
263 |
if( internalFlag == 1 ) |
|
264 |
{ |
|
265 |
CFileMan* fMan=CFileMan::NewL(TheFs); |
|
266 |
test(fMan!=NULL); |
|
267 |
||
268 |
TFileName gPathInt; |
|
269 |
gPathInt.Append (internalDriveLetter); |
|
270 |
gPathInt.Append (_L(":\\F32-TST\\") ); |
|
271 |
TInt r=fMan->RmDir(gPathInt); |
|
272 |
test(r==KErrNone); |
|
273 |
||
274 |
delete fMan; |
|
275 |
} |
|
276 |
} |
|
277 |
||
278 |
||
279 |
LOCAL_C void MountRemoteFilesystem() |
|
280 |
{ |
|
281 |
||
282 |
test.Next(_L("Mount Remote Drive simulator on Q:\n")); |
|
283 |
||
284 |
||
285 |
TInt r=TheFs.AddFileSystem(_L("CFAFSDLY")); |
|
286 |
test.Printf(_L("Add remote file system\n")); |
|
287 |
test.Printf(_L("AddFileSystem returned %d\n"),r); |
|
288 |
test (r==KErrNone || r==KErrAlreadyExists); |
|
289 |
||
290 |
||
291 |
r=TheFs.MountFileSystem(_L("DELAYFS"),EDriveQ); |
|
292 |
||
293 |
||
294 |
test.Printf(_L("Mount remote file system\n")); |
|
295 |
test.Printf(_L("MountFileSystem returned %d\n"),r); |
|
296 |
test(r==KErrNone || r==KErrCorrupt || r==KErrNotReady || r==KErrAlreadyExists); |
|
297 |
||
298 |
||
299 |
Mf(_L("Q:\\F32-TST\\LOCTEST\\BIN\\FINDFILE.AAA")); |
|
300 |
||
301 |
} |
|
302 |
||
303 |
||
304 |
||
305 |
LOCAL_C void DisMountRemoteFilesystem() |
|
306 |
{ |
|
307 |
||
308 |
test.Printf(_L("Dismounting the remote Drives \n")); |
|
309 |
||
310 |
TInt r=TheFs.DismountFileSystem(_L("DELAYFS"),EDriveQ); |
|
311 |
||
312 |
test.Printf(_L("Dismounting the Remote Drive returned %d\n"),r); |
|
313 |
||
314 |
test(r==KErrNone ); |
|
315 |
} |
|
316 |
||
317 |
||
318 |
||
319 |
||
320 |
LOCAL_C void Test1() |
|
321 |
// |
|
322 |
// Do simple tests |
|
323 |
// |
|
324 |
{ |
|
325 |
test.Next(_L("Test FindByPath")); |
|
326 |
||
327 |
TAutoClose<RFs> fs; |
|
328 |
TInt r=fs.iObj.Connect(); |
|
329 |
test(r==KErrNone); |
|
330 |
TFindFile finder(fs.iObj); |
|
331 |
TPtrC path=gPath1; |
|
332 |
r=finder.FindByPath(_L("file1.aaa"),&path); |
|
333 |
test(r==KErrNone); |
|
334 |
TParse fileParse; |
|
335 |
fileParse.Set(finder.File(),NULL,NULL); |
|
336 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN1\\")); |
|
337 |
test(fileParse.NameAndExt()==_L("file1.aaa")); |
|
338 |
r=finder.Find(); |
|
339 |
test(r==KErrNotFound); |
|
340 |
||
341 |
||
342 |
path.Set(gPath2); |
|
343 |
r=finder.FindByPath(_L("file1.aaa"),&path); |
|
344 |
test(r==KErrNone); |
|
345 |
fileParse.Set(finder.File(),NULL,NULL); |
|
346 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN1\\")); |
|
347 |
test(fileParse.NameAndExt()==_L("file1.aaa")); |
|
348 |
r=finder.Find(); |
|
349 |
test(r==KErrNone); |
|
350 |
fileParse.Set(finder.File(),NULL,NULL); |
|
351 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN1\\BIN4\\")); |
|
352 |
test(fileParse.NameAndExt()==_L("file1.aaa")); |
|
353 |
r=finder.Find(); |
|
354 |
test(r==KErrNotFound); |
|
355 |
// |
|
356 |
test.Next(_L("Test FindByDir")); |
|
357 |
TPtrC dir=_L("\\F32-TST\\LOCTEST\\BIN2\\"); |
|
358 |
r=finder.FindByDir(_L("file2.bbb"),dir); |
|
359 |
test(r==KErrNone); |
|
360 |
TFileName defaultPath; |
|
361 |
r=TheFs.SessionPath(defaultPath); |
|
362 |
defaultPath.SetLength(2); |
|
363 |
test(r==KErrNone); |
|
364 |
fileParse.Set(finder.File(),NULL,NULL); |
|
365 |
test(fileParse.Drive()==defaultPath); |
|
366 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\")); |
|
367 |
test(_L("file2.bbb").MatchF(fileParse.NameAndExt())!=KErrNotFound); // MatchF only sees wildcards in its argument |
|
368 |
r=finder.Find(); |
|
369 |
if (r==KErrNone) |
|
370 |
{ |
|
371 |
fileParse.Set(finder.File(),NULL,NULL); |
|
372 |
if (defaultPath==_L("C:")) |
|
373 |
test(fileParse.Drive()==_L("Y:")); |
|
374 |
else |
|
375 |
test(fileParse.Drive()==_L("C:")); |
|
376 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\")); |
|
377 |
test(_L("file2.bbb").MatchF(fileParse.NameAndExt())!=KErrNotFound); |
|
378 |
r=finder.Find(); |
|
379 |
} |
|
380 |
test(r==KErrNotFound); |
|
381 |
} |
|
382 |
||
383 |
LOCAL_C void Test2() |
|
384 |
// |
|
385 |
// Test extremes |
|
386 |
// |
|
387 |
{ |
|
388 |
||
389 |
test.Next(_L("Test extremes")); |
|
390 |
TAutoClose<RFs> fs; |
|
391 |
TInt r=fs.iObj.Connect(); |
|
392 |
test(r==KErrNone); |
|
393 |
TBuf<4> temp=_L(""); |
|
394 |
TFindFile finder(fs.iObj); |
|
395 |
r=finder.FindByPath(_L("file1.aaa"),&temp); |
|
396 |
test(r==KErrNotFound); |
|
397 |
r=finder.Find(); |
|
398 |
test(r==KErrNotFound); |
|
399 |
// |
|
400 |
TPtrC path=_L("blarg.7"); |
|
401 |
r=finder.FindByPath(_L(""),&path); |
|
402 |
test(r==KErrArgument); |
|
403 |
r=finder.FindByPath(_L("*"),&path); |
|
404 |
test(r==KErrNotFound); |
|
405 |
r=finder.FindByPath(_L("xmvid"),&path); |
|
406 |
test(r==KErrNotFound); |
|
407 |
r=finder.Find(); |
|
408 |
test(r==KErrNotFound); |
|
409 |
// |
|
410 |
path.Set(_L("C:\\F32-TST\\LOCTEST\\BIN1\\;\\F32-TST\\LOCTEST\\BIN2\\;Z:\\F32-TST\\LOCTEST\\BIN1\\BIN4\\;\\F32-TST\\LOCTEST\\BIN3\\;")); |
|
411 |
r=finder.FindByPath(_L(""),&path); |
|
412 |
test(r==KErrArgument); |
|
413 |
r=finder.FindByPath(_L("xyz.abc"),&path); |
|
414 |
test(r==KErrNotFound); |
|
415 |
r=finder.Find(); |
|
416 |
test(r==KErrNotFound); |
|
417 |
||
418 |
test.Next(_L("Test FindByDir with empty file spec")); |
|
419 |
TPtrC dir2=_L("\\F32-TST\\LOCTEST\\"); |
|
420 |
r=finder.FindByDir(_L(""),dir2); |
|
421 |
test(r==KErrArgument); |
|
422 |
||
423 |
} |
|
424 |
||
425 |
LOCAL_C void Test3() |
|
426 |
// |
|
427 |
// Test FindByDrives in a path=_L("c:\xyz;z:\lmnop;\abc;\y:\help"); |
|
428 |
// |
|
429 |
{ |
|
430 |
||
431 |
test.Next(_L("Test FindInDrivesByPath")); |
|
432 |
TPtrC path=_L("\\F32-TST\\LOCTEST\\BIN2\\"); |
|
433 |
TFileName defaultPath; |
|
434 |
TInt r=TheFs.SessionPath(defaultPath); |
|
435 |
defaultPath.SetLength(2); |
|
436 |
// |
|
437 |
TAutoClose<RFs> fs; |
|
438 |
r=fs.iObj.Connect(); |
|
439 |
test(r==KErrNone); |
|
440 |
TFindFile finder(fs.iObj); |
|
441 |
r=finder.FindByPath(_L("file1.aaa"),&path); |
|
442 |
test(r==KErrNotFound); |
|
443 |
r=finder.Find(); |
|
444 |
test(r==KErrNotFound); |
|
445 |
// |
|
446 |
path.Set(_L("\\F32-TST\\LOCTEST\\BIN2\\")); |
|
447 |
r=finder.FindByPath(_L("file2.bbb"),&path); |
|
448 |
test(r==KErrNone); |
|
449 |
TParse fileParse; |
|
450 |
fileParse.Set(finder.File(),NULL,NULL); |
|
451 |
test(fileParse.Drive()==defaultPath); |
|
452 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\")); |
|
453 |
test(fileParse.NameAndExt()==_L("file2.bbb")); |
|
454 |
r=finder.Find(); |
|
455 |
test(r==KErrNotFound || r==KErrNone); |
|
456 |
if (r==KErrNone) |
|
457 |
{ |
|
458 |
fileParse.Set(finder.File(),NULL,NULL); |
|
459 |
test(fileParse.Drive()!=defaultPath); |
|
460 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\")); |
|
461 |
test(fileParse.NameAndExt()==_L("file2.bbb")); |
|
462 |
r=finder.Find(); |
|
463 |
test(r==KErrNotFound); |
|
464 |
} |
|
465 |
// |
|
466 |
path.Set(_L("C:\\F32-TST\\LOCTEST\\BIN1\\;;\\F32-TST\\LOCTEST\\BIN2\\;Z:\\F32-TST\\LOCTEST\\BIN1\\BIN4\\;\\F32-TST\\LOCTEST\\BIN3\\;")); |
|
467 |
r=finder.FindByPath(_L("xyz.abc"),&path); |
|
468 |
test(r==KErrNotFound); |
|
469 |
r=finder.Find(); |
|
470 |
test(r==KErrNotFound); |
|
471 |
// |
|
472 |
r=finder.FindByPath(_L("file2.bbb"),&path); |
|
473 |
test(r==KErrNone); |
|
474 |
fileParse.Set(finder.File(),NULL,NULL); |
|
475 |
test(fileParse.Drive()==defaultPath); |
|
476 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\")); |
|
477 |
test(fileParse.NameAndExt()==_L("file2.bbb")); |
|
478 |
r=finder.Find(); |
|
479 |
test(r==KErrNotFound || r==KErrNone); |
|
480 |
if (r==KErrNone) |
|
481 |
{ |
|
482 |
fileParse.Set(finder.File(),NULL,NULL); |
|
483 |
test(fileParse.Drive()!=defaultPath); |
|
484 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\")); |
|
485 |
test(fileParse.NameAndExt()==_L("file2.bbb")); |
|
486 |
r=finder.Find(); |
|
487 |
test(r==KErrNotFound); |
|
488 |
} |
|
489 |
} |
|
490 |
||
491 |
LOCAL_C void Test4() |
|
492 |
// |
|
493 |
// Test wildcard findbypath |
|
494 |
// |
|
495 |
{ |
|
496 |
||
497 |
test.Next(_L("FindByPath with wild filenames")); |
|
498 |
TFindFile finder(TheFs); |
|
499 |
CDir* dir; |
|
500 |
TInt count; |
|
501 |
TEntry entry; |
|
502 |
TFileName path; |
|
503 |
||
504 |
TInt r=finder.FindWildByPath(_L("*.aaa"),&gPath3,dir); |
|
505 |
test(r==KErrNone); |
|
506 |
count=dir->Count(); |
|
507 |
test(count==3); |
|
508 |
entry=(*dir)[0]; |
|
509 |
test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound); |
|
510 |
entry=(*dir)[1]; |
|
511 |
test(entry.iName.MatchF(_L("FILE1.AAA"))!=KErrNotFound); |
|
512 |
entry=(*dir)[2]; |
|
513 |
test(entry.iName.MatchF(_L("WORK.AAA"))!=KErrNotFound); |
|
514 |
TParse fileParse; |
|
515 |
fileParse.Set(finder.File(),NULL,NULL); |
|
516 |
path=fileParse.FullName(); |
|
517 |
test(path==_L("*.aaa")); |
|
518 |
delete dir; |
|
519 |
||
520 |
r=finder.FindWild(dir); |
|
521 |
test(r==KErrNone); |
|
522 |
count=dir->Count(); |
|
523 |
test(count==2); |
|
524 |
entry=(*dir)[0]; |
|
525 |
test(entry.iName.MatchF(_L("FILE1.AAA"))!=KErrNotFound); |
|
526 |
entry=(*dir)[1]; |
|
527 |
test(entry.iName.MatchF(_L("WORK.AAA"))!=KErrNotFound); |
|
528 |
fileParse.Set(finder.File(),NULL,NULL); |
|
529 |
path=fileParse.FullName(); |
|
530 |
test(path==_L("C:\\F32-TST\\LOCTEST\\BIN1\\*.aaa")); |
|
531 |
delete dir; |
|
532 |
||
533 |
r=finder.FindWild(dir); |
|
534 |
test(r==KErrNotFound); |
|
535 |
r=finder.FindWild(dir); |
|
536 |
test(r==KErrNotFound); |
|
537 |
||
538 |
r=finder.FindWildByPath(_L("*FILE.AAA*"), &gPath1, dir); |
|
539 |
test(r==KErrNone); |
|
540 |
test(dir->Count()==1); |
|
541 |
entry=(*dir)[0]; |
|
542 |
test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound); |
|
543 |
delete dir; |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
544 |
|
0 | 545 |
r=finder.FindWildByPath(_L("*FILE.AAA"), &gPath1, dir); |
546 |
test(r==KErrNone); |
|
547 |
test(dir->Count()==1); |
|
548 |
entry=(*dir)[0]; |
|
549 |
test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound); |
|
550 |
delete dir; |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
551 |
|
0 | 552 |
r=finder.FindWildByPath(_L("FILE.AAA*"), &gPath1, dir); |
553 |
test(r==KErrNone); |
|
554 |
test(dir->Count()==1); |
|
555 |
entry=(*dir)[0]; |
|
556 |
test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound); |
|
557 |
delete dir; |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
558 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
559 |
|
0 | 560 |
r=finder.FindWildByPath(_L("CONFUSED.DOG"), &gPath1, dir); |
561 |
test(r==KErrNone); |
|
562 |
test(dir->Count()==1); |
|
563 |
entry=(*dir)[0]; |
|
564 |
test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound); |
|
565 |
delete dir; |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
566 |
|
0 | 567 |
r=finder.FindWildByPath(_L("*CONFUSED.DOG"), &gPath1, dir); |
568 |
test(r==KErrNone); |
|
569 |
test(dir->Count()==1); |
|
570 |
entry=(*dir)[0]; |
|
571 |
test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound); |
|
572 |
delete dir; |
|
573 |
r=finder.FindWildByPath(_L("CONFUSED.DOG*"), &gPath1, dir); |
|
574 |
test(r==KErrNone); |
|
575 |
test(dir->Count()==1); |
|
576 |
entry=(*dir)[0]; |
|
577 |
test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound); |
|
578 |
delete dir; |
|
579 |
r=finder.FindWildByPath(_L("*CONFUSED.DOG*"), &gPath1, dir); |
|
580 |
test(r==KErrNone); |
|
581 |
test(dir->Count()==1); |
|
582 |
entry=(*dir)[0]; |
|
583 |
test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound); |
|
584 |
delete dir; |
|
585 |
} |
|
586 |
||
587 |
LOCAL_C void Test5() |
|
588 |
// |
|
589 |
// Test wildcard findbydir |
|
590 |
// |
|
591 |
{ |
|
592 |
||
593 |
test.Next(_L("FindByDir with wild filenames")); |
|
594 |
TFindFile finder(TheFs); |
|
595 |
CDir* dir; |
|
596 |
TInt count; |
|
597 |
TEntry entry; |
|
598 |
TFileName path; |
|
599 |
||
600 |
TInt r=finder.FindWildByDir(_L("FILE*"),_L("\\F32-TST\\LOCTEST\\BIN3\\"),dir); |
|
601 |
test(r==KErrNone); |
|
602 |
count=dir->Count(); |
|
603 |
test(count==1); |
|
604 |
entry=(*dir)[0]; |
|
605 |
test(entry.iName.MatchF(_L("FILE3.CCC"))!=KErrNotFound); |
|
606 |
TParse fileParse; |
|
607 |
fileParse.Set(finder.File(),NULL,NULL); |
|
608 |
path=fileParse.FullName(); |
|
609 |
TFileName tpath=_L("?:\\F32-TST\\LOCTEST\\BIN3\\FILE*"); |
|
610 |
tpath[0]=gSessionPath[0]; |
|
611 |
test(path.CompareF(tpath)==0); |
|
612 |
delete dir; |
|
613 |
||
614 |
r=finder.FindWild(dir); |
|
615 |
if (r==KErrNotFound) |
|
616 |
return; |
|
617 |
test(r==KErrNone); |
|
618 |
entry=(*dir)[0]; |
|
619 |
test(entry.iName.MatchF(_L("FILE3.CCC"))!=KErrNotFound); |
|
620 |
fileParse.Set(finder.File(),NULL,NULL); |
|
621 |
path=fileParse.FullName(); |
|
622 |
test(path.CompareF(tpath)==0); |
|
623 |
delete dir; |
|
624 |
||
625 |
r=finder.FindWild(dir); |
|
626 |
test(r==KErrNotFound); |
|
627 |
r=finder.FindWild(dir); |
|
628 |
test(r==KErrNotFound); |
|
629 |
} |
|
630 |
||
631 |
LOCAL_C void Test6() |
|
632 |
// |
|
633 |
// Test file not found |
|
634 |
// |
|
635 |
{ |
|
636 |
||
637 |
test.Next(_L("Test file not found")); |
|
638 |
TFindFile ff(TheFs); |
|
639 |
TInt r=ff.FindByDir(_L("NOEXIST.EXE"),_L("\\System\\Programs\\")); |
|
640 |
test(r==KErrNotFound); |
|
641 |
} |
|
642 |
||
643 |
||
644 |
||
645 |
||
646 |
// The following test has the requirement that the only remote drive is the one we mount |
|
647 |
// during the test(DELAYFS) and which doesn't have any other attributes set. If this is not the |
|
648 |
// case then test conditions must be changed, in order for the test to stop failing. |
|
649 |
// Even more if a removable drive is not present in the target platform then findfile.aaa |
|
650 |
// only exists in the remote one and this is why we have a distinction in the test results. |
|
651 |
// |
|
652 |
||
653 |
||
654 |
||
655 |
//--------------------------------------------- |
|
656 |
//! @SYMTestCaseID PBASE-T_LOCATE-0553 |
|
657 |
//! @SYMTestType UT |
|
658 |
//! @SYMREQ CR909 |
|
659 |
//! @SYMTestCaseDesc When using the various Find functions of class TFindFile,by default remote drives are |
|
660 |
//! excluded from the list of drives that are searched. Using function |
|
661 |
//! SetFindMask(TUint aMask) it is possible to specify a combination of attributes that |
|
662 |
//! the drives to be searched must match. |
|
663 |
//! @SYMTestActions Call function FindByPath/Find without specifying a mask. Check that remote drives are not |
|
664 |
//! included. Then call SetFindMask(TUint aMask) using various combinations and verify |
|
665 |
//! that FindByPath or Find return appopriate results. |
|
666 |
//! @SYMTestExpectedResults Test that file findfile.aaa is found or not depending on the specified mask. |
|
667 |
//! @SYMTestPriority High |
|
668 |
//! @SYMTestStatus Implemented |
|
669 |
//--------------------------------------------- |
|
670 |
||
671 |
||
672 |
||
673 |
LOCAL_C void Test7() |
|
674 |
||
675 |
{ |
|
676 |
||
677 |
TAutoClose<RFs> fs; |
|
678 |
TInt r=fs.iObj.Connect(); |
|
679 |
test(r==KErrNone); |
|
680 |
TFindFile finder(fs.iObj); |
|
681 |
TPtrC path=gPath4; |
|
682 |
r=finder.FindByPath(_L("findfile.aaa"),&path); |
|
683 |
||
684 |
TParse fileParse; |
|
685 |
||
686 |
test.Next(_L("Test FindByPath without specifying any mask")); |
|
687 |
||
688 |
if (removableFlag == 1) |
|
689 |
{ |
|
690 |
test(r==KErrNone); |
|
691 |
fileParse.Set(finder.File(),NULL,NULL); |
|
692 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\")); |
|
693 |
test(fileParse.NameAndExt()==_L("findfile.aaa")); //The filename.aaa in the removable Drive |
|
694 |
r=finder.Find(); |
|
695 |
test(r==KErrNotFound); //remote drives are excluded by default |
|
696 |
||
697 |
} |
|
698 |
else |
|
699 |
test(r==KErrNotFound); |
|
700 |
||
701 |
||
702 |
||
703 |
test.Next(_L("Search for the specified file in all Drives, including remotes ones \n")); |
|
704 |
||
705 |
||
706 |
r=finder.SetFindMask( KDriveAttAll) ; |
|
707 |
test(r==KErrNone); |
|
708 |
r=finder.FindByPath(_L("findfile.aaa"),&path); |
|
709 |
test(r==KErrNone); |
|
710 |
fileParse.Set(finder.File(),NULL,NULL); |
|
711 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\")); |
|
712 |
test(fileParse.NameAndExt()==_L("findfile.aaa")); //either the remote or removable one. |
|
713 |
r=finder.Find(); |
|
714 |
||
715 |
||
716 |
if (removableFlag == 1) |
|
717 |
{ |
|
718 |
test(r==KErrNone); |
|
719 |
||
720 |
fileParse.Set(finder.File(),NULL,NULL); |
|
721 |
||
722 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\")); |
|
723 |
test(fileParse.NameAndExt()==_L("findfile.aaa")); //either the remote or removable one. |
|
724 |
||
725 |
r=finder.Find(); |
|
726 |
test(r==KErrNotFound); |
|
727 |
} |
|
728 |
else |
|
729 |
{ |
|
730 |
test(r==KErrNotFound); |
|
731 |
||
732 |
} |
|
733 |
||
734 |
||
735 |
test.Next(_L("Search exclusively in remote drives \n")); |
|
736 |
||
737 |
r=finder.SetFindMask( KDriveAttExclusive| KDriveAttRemote); |
|
738 |
test(r==KErrNone); |
|
739 |
r=finder.FindByPath(_L("findfile.aaa"),&path); |
|
740 |
test(r==KErrNone); |
|
741 |
fileParse.Set(finder.File(),NULL,NULL); |
|
742 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\")); |
|
743 |
test(fileParse.NameAndExt()==_L("findfile.aaa")); |
|
744 |
r=finder.Find(); |
|
745 |
test(r==KErrNotFound); |
|
746 |
||
747 |
||
748 |
test.Next(_L("Search excluding removables and remote \n")); |
|
749 |
||
750 |
r=finder.SetFindMask( KDriveAttExclude | KDriveAttRemovable |KDriveAttRemote ); |
|
751 |
test(r==KErrNone); |
|
752 |
r=finder.FindByPath(_L("findfile.aaa"),&path); |
|
753 |
test(r==KErrNotFound); //filename.aaa exists in the remote drive and if present to the removable one |
|
754 |
||
755 |
||
756 |
test.Next(_L("Search in Internal Drives \n")); |
|
757 |
||
758 |
r=finder.SetFindMask(KDriveAttInternal ) ; |
|
759 |
test(r==KErrNone); |
|
760 |
r=finder.FindByPath(_L("findfile.aaa"),&path); |
|
761 |
test(r==KErrNotFound); //filename.aaa exists only in the Removable drive and the remote one. |
|
762 |
||
763 |
||
764 |
} |
|
765 |
||
766 |
||
767 |
//--------------------------------------------- |
|
768 |
//! @SYMTestCaseID PBASE-T_LOCATE-0554 |
|
769 |
//! @SYMTestType UT |
|
770 |
//! @SYMREQ CR909 |
|
771 |
//! @SYMTestCaseDesc Test that SetFindMask(TUint aMask) returns the correct value for all combinations of matching masks. |
|
772 |
//! |
|
773 |
//! @SYMTestActions Call SetFindMask for every combination of mask and check that the correct value is returned. |
|
774 |
//! A structure is used to store the expected value for each combination. |
|
775 |
//! @SYMTestExpectedResults For every combination either KErrNone or KErrArgument must be returned. |
|
776 |
//! @SYMTestPriority High. |
|
777 |
//! @SYMTestStatus Implemented |
|
778 |
//--------------------------------------------- |
|
779 |
||
780 |
||
781 |
||
782 |
||
783 |
LOCAL_C void Test8() |
|
784 |
||
785 |
{ |
|
786 |
||
787 |
test.Next(_L("Test SetFindMask with all mask combinations \n")); |
|
788 |
||
789 |
||
790 |
TAutoClose<RFs> fs; |
|
791 |
TInt r=fs.iObj.Connect(); |
|
792 |
test(r==KErrNone); |
|
793 |
TFindFile finder(fs.iObj); |
|
794 |
TPtrC path=gPath4; |
|
795 |
TParse fileParse; |
|
796 |
||
797 |
||
798 |
r=finder.SetFindMask(KDriveAttAll) ; |
|
799 |
test(r==KErrNone); |
|
800 |
r=finder.FindByPath(_L("findfile.aaa"),&path); |
|
801 |
test(r==KErrNone); |
|
802 |
fileParse.Set(finder.File(),NULL,NULL); |
|
803 |
test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\")); |
|
804 |
test(fileParse.NameAndExt()==_L("findfile.aaa")); |
|
805 |
||
806 |
||
807 |
struct TCombinations |
|
808 |
{ |
|
809 |
TUint iMatchMask; // The Match Mask to be combined with drive attributes |
|
810 |
TInt iExpectedResultNoAtts; // Expected result when flag used on it's own |
|
811 |
TInt iExpectedResultWithAtts; // Expected result when flag used in combination with drive flags |
|
812 |
}; |
|
813 |
||
814 |
TCombinations testCombinations[] = { |
|
815 |
{ 0, KErrNone, KErrNone}, |
|
816 |
{ KDriveAttAll, KErrNone, KErrArgument }, |
|
817 |
{ KDriveAttExclude, KErrArgument, KErrNone }, |
|
818 |
{ KDriveAttExclusive, KErrArgument, KErrNone }, |
|
819 |
{ KDriveAttExclude | KDriveAttExclusive, KErrArgument, KErrNone }, |
|
820 |
{ KDriveAttAll | KDriveAttExclude, KErrArgument, KErrArgument }, |
|
821 |
{ KDriveAttAll | KDriveAttExclusive, KErrArgument, KErrArgument}, |
|
822 |
{ KDriveAttAll | KDriveAttExclude | KDriveAttExclusive, KErrArgument, KErrArgument}}; |
|
823 |
||
824 |
||
825 |
||
826 |
for(TUint matchIdx = 0; matchIdx < sizeof(testCombinations) / sizeof(TCombinations); matchIdx++) |
|
827 |
{ |
|
828 |
test.Printf(_L("\nTest mask : KDriveAttAll[%c] KDriveAttExclude[%c] KDriveAttExclusive[%c]\n"), testCombinations[matchIdx].iMatchMask & KDriveAttAll ? 'X' : ' ', |
|
829 |
testCombinations[matchIdx].iMatchMask & KDriveAttExclude ? 'X' : ' ', |
|
830 |
testCombinations[matchIdx].iMatchMask & KDriveAttExclusive ? 'X' : ' '); |
|
831 |
for(TUint testAtt = 0; testAtt <= KMaxTUint8; testAtt++) |
|
832 |
{ |
|
833 |
r= finder.SetFindMask( testCombinations[matchIdx].iMatchMask | testAtt ) ; |
|
834 |
||
835 |
// test.Printf(_L(" ATT : 0x%08x \n"), testAtt); |
|
836 |
// test.Printf(_L("Expected Result : %d \n"), testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts); |
|
837 |
// test.Printf(_L(" Actual Result : 0x%08x \n"), err); |
|
838 |
||
839 |
// test.Printf(_L("\nTest mask : %d \n"),testCombinations[matchIdx].iMatchMask | testAtt ); |
|
840 |
||
841 |
test( r == (testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts) ); |
|
842 |
||
843 |
||
844 |
if (r== KErrNone) |
|
845 |
{ |
|
846 |
r = finder.FindByPath(_L("findfile.aaa"),&path); |
|
847 |
test (r== KErrNone || r ==KErrNotFound); |
|
848 |
} |
|
849 |
||
850 |
} |
|
851 |
} |
|
852 |
||
853 |
} |
|
854 |
||
855 |
||
856 |
||
857 |
||
858 |
||
859 |
LOCAL_C void Test9() |
|
860 |
// |
|
861 |
// Test wildcard findbydir and FindByWildPath in Removable and Internal Drives |
|
862 |
// |
|
863 |
||
864 |
//--------------------------------------------- |
|
865 |
//! @SYMTestCaseID PBASE-T_LOCATE-0555 |
|
866 |
//! @SYMTestType UT |
|
867 |
//! @SYMREQ CR909 |
|
868 |
//! @SYMTestCaseDesc Check that FindWildByDir and FindByDir functions behave correctly when a mask has been specified |
|
869 |
//! through SetFindMask. |
|
870 |
//! @SYMTestActions Call FindWildByDir with a filename containing wildchars and a specific path. Then call SetFindMask |
|
871 |
//! to exclude Removable drives and call FindWildByDir again.Even more call FindByDir for the file in |
|
872 |
//! the removable drive and for the same directory as before. |
|
873 |
//! @SYMTestExpectedResults The number of files found when excluding the removable drive(if a removable drive exists in the |
|
874 |
//! target platform) must differ by one. The FinByDir must find the same results. |
|
875 |
//! @SYMTestPriority High |
|
876 |
//! @SYMTestStatus Implemented |
|
877 |
//--------------------------------------------- |
|
878 |
||
879 |
||
880 |
{ |
|
881 |
||
882 |
TAutoClose<RFs> fs; |
|
883 |
TInt r=fs.iObj.Connect(); |
|
884 |
test(r==KErrNone); |
|
885 |
||
886 |
TFindFile finder(fs.iObj); |
|
887 |
||
888 |
CDir* dir; |
|
889 |
CDir* dir3; |
|
890 |
||
891 |
TInt count; |
|
892 |
TEntry entry; |
|
893 |
||
894 |
||
895 |
||
896 |
if ( removableFlag == 1 ) |
|
897 |
{ |
|
898 |
||
899 |
test.Next(_L("FindByDir with wild filenames when a find mask is specified")); |
|
900 |
||
901 |
TInt r=finder.SetFindMask(KDriveAttRemovable); |
|
902 |
test(r==KErrNone); |
|
903 |
r=finder.FindWildByDir(_L("FIND*"),_L("\\F32-TST\\LOCTEST\\BIN\\"),dir); |
|
904 |
test(r==KErrNone); |
|
905 |
count=dir->Count(); |
|
906 |
test(count==1); |
|
907 |
entry=(*dir)[0]; |
|
908 |
test(entry.iName.MatchF(_L("FINDFILE.AAA"))!=KErrNotFound); |
|
909 |
delete dir; |
|
910 |
||
911 |
r=finder.FindWild(dir); |
|
912 |
test(r==KErrNotFound); |
|
913 |
||
914 |
||
915 |
r=finder.SetFindMask(KDriveAttExclude| KDriveAttRemovable); |
|
916 |
test(r==KErrNone); |
|
917 |
r=finder.FindWildByDir(_L("FIND*"),_L("\\F32-TST\\LOCTEST\\BIN\\"),dir); |
|
918 |
test(r==KErrNotFound); |
|
919 |
||
920 |
||
921 |
test.Next(_L("Test FindByDir when a find mask is specified")); |
|
922 |
||
923 |
||
924 |
TPtrC dir2=_L("\\F32-TST\\LOCTEST\\BIN\\"); |
|
925 |
||
926 |
r=finder.SetFindMask(KDriveAttExclude | KDriveAttRemote ); |
|
927 |
test(r==KErrNone); |
|
928 |
r=finder.FindByDir(_L("findfile.aaa"),dir2); |
|
929 |
test(r==KErrNone); |
|
930 |
||
931 |
r=finder.Find(); |
|
932 |
test(r==KErrNotFound); |
|
933 |
||
934 |
||
935 |
} |
|
936 |
||
937 |
||
938 |
||
939 |
//--------------------------------------------- |
|
940 |
//! @SYMTestCaseID PBASE-T_LOCATE-0556 |
|
941 |
//! @SYMTestType UT |
|
942 |
//! @SYMREQ CR909 |
|
943 |
//! @SYMTestCaseDesc FindByWildPath and FindByPath functions when supplied with a path that also contains |
|
944 |
//! a Drive letter, they will not need to check other Drives. Therefore calling SetFindMask |
|
945 |
//! does not affect the drives returned. |
|
946 |
//! @SYMTestActions Call FindWildByPath with an appropriate path in the internal drive. Then call SetFindMask |
|
947 |
//! to exclude Internal drives and call FindWildByPath again. |
|
948 |
//! @SYMTestExpectedResults The number of files found in both cases must be the same since no other drive is searched. |
|
949 |
//! @SYMTestPriority High |
|
950 |
//! @SYMTestStatus Implemented |
|
951 |
//--------------------------------------------- |
|
952 |
||
953 |
||
954 |
||
955 |
||
956 |
if( internalFlag == 1 ) |
|
957 |
{ |
|
958 |
||
959 |
||
960 |
test.Next(_L("Test that SetFindMask does not affect Find functions that have a drive letter specified")); |
|
961 |
||
962 |
||
963 |
gPath5.Append (internalDriveLetter); |
|
964 |
gPath5.Append (_L(":\\F32-TST\\LOCTEST\\BIN\\INT\\") ); |
|
965 |
||
966 |
||
967 |
r=finder.FindWildByPath(_L("FIND*.AAA"), &gPath5, dir3); |
|
968 |
test(r==KErrNone); |
|
969 |
test(dir3->Count()==2); |
|
970 |
||
971 |
entry=(*dir3)[0]; |
|
972 |
test( (entry.iName.MatchF(_L("FINDINTERNALFILE_B.AAA"))!=KErrNotFound) || (entry.iName.MatchF(_L("FINDINTERNALFILE.AAA"))!=KErrNotFound) ); |
|
973 |
||
974 |
||
975 |
entry=(*dir3)[1]; |
|
976 |
test( (entry.iName.MatchF(_L("FINDINTERNALFILE_B.AAA"))!=KErrNotFound ) || (entry.iName.MatchF(_L("FINDINTERNALFILE.AAA"))!=KErrNotFound) ); |
|
977 |
||
978 |
||
979 |
delete dir3; |
|
980 |
||
981 |
||
982 |
||
983 |
r=finder.SetFindMask(KDriveAttExclude| KDriveAttInternal); |
|
984 |
test(r==KErrNone); |
|
985 |
r=finder.FindWildByPath(_L("FIND*.AAA"), &gPath5, dir3); |
|
986 |
test(r==KErrNone); |
|
987 |
test(dir3->Count()==2); |
|
988 |
||
989 |
delete dir3; |
|
990 |
||
991 |
||
992 |
r=finder.FindWild(dir3); |
|
993 |
test(r==KErrNotFound); |
|
994 |
||
995 |
||
996 |
} |
|
997 |
||
998 |
||
999 |
} |
|
1000 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1001 |
//--------------------------------------------------------------------------------------- |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1002 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1003 |
Test that callinng TFindFile methods that allocate CDir objects doesn't lead to memory leaks if some error occurs. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1004 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1005 |
void TestFailures() |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1006 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1007 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1008 |
test.Next(_L("Test TFindFile failures\n")); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1009 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1010 |
#ifndef _DEBUG |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1011 |
test.Printf(_L("This test can't be performed in UREL mode, skipping\n")); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1012 |
return; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1013 |
#else |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1014 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1015 |
TFindFile finder(TheFs); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1016 |
CDir* pDir; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1017 |
TInt nRes; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1018 |
TInt cnt=0; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1019 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1020 |
_LIT(KPath, "\\F32-TST\\LOCTEST\\"); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1021 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1022 |
const TInt KMyError = -756; //-- specific error code we will simulate |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1023 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1024 |
//------------------------------------ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1025 |
test.Printf(_L("Test FindWildByPath failures\n")); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1026 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1027 |
__UHEAP_MARK; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1028 |
nRes = finder.FindWildByPath(_L("*"), &gPath1, pDir); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1029 |
test(nRes == KErrNone); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1030 |
test(pDir && pDir->Count() > 1); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1031 |
delete pDir; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1032 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1033 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1034 |
for(cnt = 0; ;cnt++) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1035 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1036 |
nRes =TheFs.SetErrorCondition(KMyError, cnt); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1037 |
test(nRes == KErrNone); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1038 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1039 |
pDir = (CDir*)0xaabbccdd; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1040 |
nRes = finder.FindWildByPath(_L("*"), &gPath1, pDir); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1041 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1042 |
//-- on error the memory allocated internally for CDir shall be freed and the pointer CDir* shall be set to NULL |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1043 |
if(nRes == KErrNone) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1044 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1045 |
test.Printf(_L("Test FindWildByPath->FindWild() failures\n")); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1046 |
test(pDir && pDir->Count() > 1); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1047 |
delete pDir; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1048 |
pDir = (CDir*)0xaabbccdd; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1049 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1050 |
TheFs.SetErrorCondition(KMyError); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1051 |
nRes = finder.FindWild(pDir); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1052 |
test(nRes != KErrNone); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1053 |
test(pDir == NULL); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1054 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1055 |
break; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1056 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1057 |
else |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1058 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1059 |
test(pDir == NULL); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1060 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1061 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1062 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1063 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1064 |
__UHEAP_MARKEND; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1065 |
TheFs.SetErrorCondition(KErrNone); |
0 | 1066 |
|
1067 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1068 |
//------------------------------------ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1069 |
test.Printf(_L("Test FindWildByDir failures\n")); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1070 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1071 |
__UHEAP_MARK; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1072 |
nRes = finder.FindWildByDir(_L("*"), KPath, pDir); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1073 |
test(nRes == KErrNone); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1074 |
test(pDir && pDir->Count() > 1); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1075 |
delete pDir; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1076 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1077 |
for(cnt = 0; ;cnt++) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1078 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1079 |
nRes =TheFs.SetErrorCondition(KMyError, cnt); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1080 |
test(nRes == KErrNone); |
0 | 1081 |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1082 |
pDir = (CDir*)0xaabbccdd; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1083 |
nRes = finder.FindWildByDir(_L("*"), KPath, pDir); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1084 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1085 |
//-- on error the memory allocated internally for CDir shall be freed and the pointer CDir* shall be set to NULL |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1086 |
if(nRes == KErrNone) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1087 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1088 |
test.Printf(_L("Test FindWildByDir->FindWild() failures\n")); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1089 |
test(pDir && pDir->Count() > 1); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1090 |
delete pDir; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1091 |
pDir = (CDir*)0xaabbccdd; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1092 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1093 |
TheFs.SetErrorCondition(KMyError); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1094 |
nRes = finder.FindWild(pDir); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1095 |
test(nRes != KErrNone); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1096 |
test(pDir == NULL); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1097 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1098 |
break; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1099 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1100 |
else |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1101 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1102 |
test(pDir == NULL); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1103 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1104 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1105 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1106 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1107 |
__UHEAP_MARKEND; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1108 |
TheFs.SetErrorCondition(KErrNone); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1109 |
#endif |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1110 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1111 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1112 |
//--------------------------------------------------------------------------------------- |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1113 |
void CallTestsL() |
0 | 1114 |
// |
1115 |
// Do all tests |
|
1116 |
// |
|
1117 |
{ |
|
1118 |
||
1119 |
||
1120 |
gPath3=_L("C:\\F32-TST\\LOCTEST\\BIN1\\;C:\\F32-TST\\LOCTEST\\BIN2\\"); |
|
1121 |
||
1122 |
gPath1=_L(""); |
|
1123 |
gPath1.Append(gSessionPath[0]); |
|
1124 |
gPath1.Append(_L(":\\F32-TST\\LOCTEST\\BIN1\\;")); |
|
1125 |
gPath1.Append(gSessionPath[0]); |
|
1126 |
gPath1.Append(_L(":\\F32-TST\\LOCTEST\\BIN2\\")); |
|
1127 |
||
1128 |
gPath2=gPath1; |
|
1129 |
gPath2.Append(';'); |
|
1130 |
gPath2.Append(gSessionPath[0]); |
|
1131 |
gPath2.Append(_L(":\\F32-TST\\LOCTEST\\BIN1\\BIN4\\;")); |
|
1132 |
if (gSessionPath[0]!='C') |
|
1133 |
gPath2.Append(gSessionPath.Left(2)); |
|
1134 |
gPath2.Append(_L("\\F32-TST\\LOCTEST\\BIN3\\;")); |
|
1135 |
||
1136 |
gPath4=_L(""); |
|
1137 |
gPath4.Append(_L("\\F32-TST\\LOCTEST\\BIN\\")); |
|
1138 |
||
1139 |
||
1140 |
||
1141 |
CreateTestDirectory(_L("\\F32-TST\\LOCTEST\\")); |
|
1142 |
MakeLocateTestDirectoryStructure(); |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1143 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1144 |
TestFailures(); |
0 | 1145 |
Test1(); |
1146 |
Test2(); |
|
1147 |
Test3(); |
|
1148 |
Test4(); |
|
1149 |
Test5(); |
|
1150 |
Test6(); |
|
1151 |
||
1152 |
MountRemoteFilesystem(); |
|
1153 |
CreateFilesInRemovableDrive(); //used in Test7/8/9 |
|
1154 |
||
1155 |
Test7(); |
|
1156 |
Test8(); |
|
1157 |
||
1158 |
CreateFilesInInternalDrive(); //used in Test9 |
|
1159 |
Test9(); |
|
1160 |
||
1161 |
DisMountRemoteFilesystem(); |
|
1162 |
||
1163 |
DeleteTestDirectory(); |
|
1164 |
||
1165 |
//Explicity delete the directories created |
|
1166 |
DeleteRemovableDirectory(); |
|
1167 |
DeleteInternalDirectory(); |
|
1168 |
||
1169 |
||
1170 |
||
1171 |
} |