107 RFile file1,file2,file3; |
106 RFile file1,file2,file3; |
108 TFileName fn; |
107 TFileName fn; |
109 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
108 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
110 fn[0] = gExeFileName[0]; |
109 fn[0] = gExeFileName[0]; |
111 TInt r=file1.Open(TheFs,fn,EFileRead|EFileShareReadersOnly); |
110 TInt r=file1.Open(TheFs,fn,EFileRead|EFileShareReadersOnly); |
112 test_KErrNone(r); |
111 test(r==KErrNone); |
113 fn = _L("Z:\\TEST\\T_FILE.CPP"); |
112 fn = _L("Z:\\TEST\\T_FILE.CPP"); |
114 fn[0] = gExeFileName[0]; |
113 fn[0] = gExeFileName[0]; |
115 r=file2.Open(TheFs,fn,EFileRead); |
114 r=file2.Open(TheFs,fn,EFileRead); |
116 test_KErrNone(r); |
115 test(r==KErrNone); |
117 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
116 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
118 fn[0] = gExeFileName[0]; |
117 fn[0] = gExeFileName[0]; |
119 r=file3.Open(TheFs,fn,EFileRead|EFileShareReadersOnly); |
118 r=file3.Open(TheFs,fn,EFileRead|EFileShareReadersOnly); |
120 test_KErrNone(r); |
119 test(r==KErrNone); |
121 |
120 |
122 CFileList* list; |
121 CFileList* list; |
123 TOpenFileScan fileScan(TheFs); |
122 TOpenFileScan fileScan(TheFs); |
124 fileScan.NextL(list); |
123 fileScan.NextL(list); |
125 |
124 |
163 { |
162 { |
164 test.Next(_L("Scan for open files - empty sessions")); |
163 test.Next(_L("Scan for open files - empty sessions")); |
165 |
164 |
166 RFs fs1,fs2,fs3,fs4; |
165 RFs fs1,fs2,fs3,fs4; |
167 TInt r=fs1.Connect(); |
166 TInt r=fs1.Connect(); |
168 test_KErrNone(r); |
167 test(r==KErrNone); |
169 r=fs2.Connect(); |
168 r=fs2.Connect(); |
170 test_KErrNone(r); |
169 test(r==KErrNone); |
171 r=fs3.Connect(); |
170 r=fs3.Connect(); |
172 test_KErrNone(r); |
171 test(r==KErrNone); |
173 r=fs4.Connect(); |
172 r=fs4.Connect(); |
174 test_KErrNone(r); |
173 test(r==KErrNone); |
175 |
174 |
176 RFile file1,file2,file3; |
175 RFile file1,file2,file3; |
177 TFileName fn; |
176 TFileName fn; |
178 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
177 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
179 fn[0] = gExeFileName[0]; |
178 fn[0] = gExeFileName[0]; |
180 r=file1.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
179 r=file1.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
181 test_KErrNone(r); |
180 test(r==KErrNone); |
182 fn = _L("Z:\\TEST\\T_FILE.CPP"); |
181 fn = _L("Z:\\TEST\\T_FILE.CPP"); |
183 fn[0] = gExeFileName[0]; |
182 fn[0] = gExeFileName[0]; |
184 r=file2.Open(fs2,fn,EFileRead); |
183 r=file2.Open(fs2,fn,EFileRead); |
185 test_KErrNone(r); |
184 test(r==KErrNone); |
186 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
185 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
187 fn[0] = gExeFileName[0]; |
186 fn[0] = gExeFileName[0]; |
188 r=file3.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
187 r=file3.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
189 test_KErrNone(r); |
188 test(r==KErrNone); |
190 |
189 |
191 CFileList* list; |
190 CFileList* list; |
192 TOpenFileScan fileScan(TheFs); |
191 TOpenFileScan fileScan(TheFs); |
193 fileScan.NextL(list); |
192 fileScan.NextL(list); |
194 |
193 |
236 { |
235 { |
237 test.Next(_L("Scan for open files - multiple sessions")); |
236 test.Next(_L("Scan for open files - multiple sessions")); |
238 |
237 |
239 RFs fs1,fs2,fs3,fs4; |
238 RFs fs1,fs2,fs3,fs4; |
240 TInt r=fs1.Connect(); |
239 TInt r=fs1.Connect(); |
241 test_KErrNone(r); |
240 test(r==KErrNone); |
242 r=fs2.Connect(); |
241 r=fs2.Connect(); |
243 test_KErrNone(r); |
242 test(r==KErrNone); |
244 r=fs3.Connect(); |
243 r=fs3.Connect(); |
245 test_KErrNone(r); |
244 test(r==KErrNone); |
246 r=fs4.Connect(); |
245 r=fs4.Connect(); |
247 test_KErrNone(r); |
246 test(r==KErrNone); |
248 |
247 |
249 RFile file1,file2,file3; |
248 RFile file1,file2,file3; |
250 TFileName fn; |
249 TFileName fn; |
251 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
250 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
252 fn[0] = gExeFileName[0]; |
251 fn[0] = gExeFileName[0]; |
253 r=file1.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
252 r=file1.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
254 test_KErrNone(r); |
253 test(r==KErrNone); |
255 fn = _L("Z:\\TEST\\T_FILE.CPP"); |
254 fn = _L("Z:\\TEST\\T_FILE.CPP"); |
256 fn[0] = gExeFileName[0]; |
255 fn[0] = gExeFileName[0]; |
257 r=file2.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
256 r=file2.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
258 test_KErrNone(r); |
257 test(r==KErrNone); |
259 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
258 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
260 fn[0] = gExeFileName[0]; |
259 fn[0] = gExeFileName[0]; |
261 r=file3.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
260 r=file3.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
262 test_KErrNone(r); |
261 test(r==KErrNone); |
263 |
262 |
264 r=file1.Open(fs4,fn,EFileRead|EFileShareReadersOnly); |
263 r=file1.Open(fs4,fn,EFileRead|EFileShareReadersOnly); |
265 test_KErrNone(r); |
264 test(r==KErrNone); |
266 fn = _L("Z:\\TEST\\T_FILE.CPP"); |
265 fn = _L("Z:\\TEST\\T_FILE.CPP"); |
267 fn[0] = gExeFileName[0]; |
266 fn[0] = gExeFileName[0]; |
268 r=file2.Open(fs4,fn,EFileRead|EFileShareReadersOnly); |
267 r=file2.Open(fs4,fn,EFileRead|EFileShareReadersOnly); |
269 test_KErrNone(r); |
268 test(r==KErrNone); |
270 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
269 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
271 fn[0] = gExeFileName[0]; |
270 fn[0] = gExeFileName[0]; |
272 r=file3.Open(fs4,fn,EFileRead|EFileShareReadersOnly); |
271 r=file3.Open(fs4,fn,EFileRead|EFileShareReadersOnly); |
273 test_KErrNone(r); |
272 test(r==KErrNone); |
274 |
273 |
275 CFileList* list; |
274 CFileList* list; |
276 TOpenFileScan fileScan(TheFs); |
275 TOpenFileScan fileScan(TheFs); |
277 fileScan.NextL(list); |
276 fileScan.NextL(list); |
278 |
277 |
336 test.Next(_L("Scan for open files - check RDir sessions are ignored")); |
335 test.Next(_L("Scan for open files - check RDir sessions are ignored")); |
337 |
336 |
338 RFs fs1,fs2,fs3,fs4; |
337 RFs fs1,fs2,fs3,fs4; |
339 TFileName fn; |
338 TFileName fn; |
340 TInt r=fs1.Connect(); |
339 TInt r=fs1.Connect(); |
341 test_KErrNone(r); |
340 test(r==KErrNone); |
342 r=fs2.Connect(); |
341 r=fs2.Connect(); |
343 test_KErrNone(r); |
342 test(r==KErrNone); |
344 r=fs3.Connect(); |
343 r=fs3.Connect(); |
345 test_KErrNone(r); |
344 test(r==KErrNone); |
346 r=fs4.Connect(); |
345 r=fs4.Connect(); |
347 test_KErrNone(r); |
346 test(r==KErrNone); |
348 |
347 |
349 RDir dir1,dir2,dir3,dir4; |
348 RDir dir1,dir2,dir3,dir4; |
350 fn = _L("Z:\\TEST\\*.XDE"); |
349 fn = _L("Z:\\TEST\\*.XDE"); |
351 fn[0] = gExeFileName[0]; |
350 fn[0] = gExeFileName[0]; |
352 r=dir1.Open(TheFs,fn,KEntryAttMaskSupported); |
351 r=dir1.Open(TheFs,fn,KEntryAttMaskSupported); |
353 test_KErrNone(r); |
352 test(r==KErrNone); |
354 r=dir2.Open(TheFs,fn,KEntryAttMaskSupported); |
353 r=dir2.Open(TheFs,fn,KEntryAttMaskSupported); |
355 test_KErrNone(r); |
354 test(r==KErrNone); |
356 r=dir3.Open(TheFs,fn,KEntryAttMaskSupported); |
355 r=dir3.Open(TheFs,fn,KEntryAttMaskSupported); |
357 test_KErrNone(r); |
356 test(r==KErrNone); |
358 r=dir4.Open(TheFs,fn,KEntryAttMaskSupported); |
357 r=dir4.Open(TheFs,fn,KEntryAttMaskSupported); |
359 test_KErrNone(r); |
358 test(r==KErrNone); |
360 |
359 |
361 RFile file1,file2,file3; |
360 RFile file1,file2,file3; |
362 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
361 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
363 fn[0] = gExeFileName[0]; |
362 fn[0] = gExeFileName[0]; |
364 r=file1.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
363 r=file1.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
365 test_KErrNone(r); |
364 test(r==KErrNone); |
366 fn = _L("Z:\\TEST\\T_FILE.CPP"); |
365 fn = _L("Z:\\TEST\\T_FILE.CPP"); |
367 fn[0] = gExeFileName[0]; |
366 fn[0] = gExeFileName[0]; |
368 r=file2.Open(fs2,fn,EFileRead); |
367 r=file2.Open(fs2,fn,EFileRead); |
369 test_KErrNone(r); |
368 test(r==KErrNone); |
370 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
369 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
371 fn[0] = gExeFileName[0]; |
370 fn[0] = gExeFileName[0]; |
372 r=file3.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
371 r=file3.Open(fs2,fn,EFileRead|EFileShareReadersOnly); |
373 test_KErrNone(r); |
372 test(r==KErrNone); |
374 |
373 |
375 RDir dir5,dir6,dir7,dir8; |
374 RDir dir5,dir6,dir7,dir8; |
376 fn = _L("Z:\\TEST\\*.XDE"); |
375 fn = _L("Z:\\TEST\\*.XDE"); |
377 fn[0] = gExeFileName[0]; |
376 fn[0] = gExeFileName[0]; |
378 r=dir5.Open(fs4,fn,KEntryAttMaskSupported); |
377 r=dir5.Open(fs4,fn,KEntryAttMaskSupported); |
379 test_KErrNone(r); |
378 test(r==KErrNone); |
380 r=dir6.Open(fs4,fn,KEntryAttMaskSupported); |
379 r=dir6.Open(fs4,fn,KEntryAttMaskSupported); |
381 test_KErrNone(r); |
380 test(r==KErrNone); |
382 r=dir7.Open(fs4,fn,KEntryAttMaskSupported); |
381 r=dir7.Open(fs4,fn,KEntryAttMaskSupported); |
383 test_KErrNone(r); |
382 test(r==KErrNone); |
384 r=dir8.Open(fs4,fn,KEntryAttMaskSupported); |
383 r=dir8.Open(fs4,fn,KEntryAttMaskSupported); |
385 test_KErrNone(r); |
384 test(r==KErrNone); |
386 |
385 |
387 CFileList* list; |
386 CFileList* list; |
388 TOpenFileScan fileScan(TheFs); |
387 TOpenFileScan fileScan(TheFs); |
389 fileScan.NextL(list); |
388 fileScan.NextL(list); |
390 |
389 |
438 RFile file1,file2,file3; |
437 RFile file1,file2,file3; |
439 TFileName fn; |
438 TFileName fn; |
440 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
439 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
441 fn[0] = gExeFileName[0]; |
440 fn[0] = gExeFileName[0]; |
442 TInt r=file1.Open(TheFs,fn,EFileRead|EFileShareReadersOnly); |
441 TInt r=file1.Open(TheFs,fn,EFileRead|EFileShareReadersOnly); |
443 test_KErrNone(r); |
442 test(r==KErrNone); |
444 fn = _L("Z:\\TEST\\T_FILE.CPP"); |
443 fn = _L("Z:\\TEST\\T_FILE.CPP"); |
445 fn[0] = gExeFileName[0]; |
444 fn[0] = gExeFileName[0]; |
446 r=file2.Open(TheFs,fn,EFileRead); |
445 r=file2.Open(TheFs,fn,EFileRead); |
447 test_KErrNone(r); |
446 test(r==KErrNone); |
448 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
447 fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
449 fn[0] = gExeFileName[0]; |
448 fn[0] = gExeFileName[0]; |
450 r=file3.Open(TheFs,fn,EFileRead|EFileShareReadersOnly); |
449 r=file3.Open(TheFs,fn,EFileRead|EFileShareReadersOnly); |
451 test_KErrNone(r); |
450 test(r==KErrNone); |
452 |
451 |
453 RDir dir1,dir2,dir3,dir4; |
452 RDir dir1,dir2,dir3,dir4; |
454 fn = _L("Z:\\TEST\\*.XDE"); |
453 fn = _L("Z:\\TEST\\*.XDE"); |
455 fn[0] = gExeFileName[0]; |
454 fn[0] = gExeFileName[0]; |
456 r=dir1.Open(TheFs,fn,KEntryAttMaskSupported); |
455 r=dir1.Open(TheFs,fn,KEntryAttMaskSupported); |
457 test_KErrNone(r); |
456 test(r==KErrNone); |
458 r=dir2.Open(TheFs,fn,KEntryAttMaskSupported); |
457 r=dir2.Open(TheFs,fn,KEntryAttMaskSupported); |
459 test_KErrNone(r); |
458 test(r==KErrNone); |
460 r=dir3.Open(TheFs,fn,KEntryAttMaskSupported); |
459 r=dir3.Open(TheFs,fn,KEntryAttMaskSupported); |
461 test_KErrNone(r); |
460 test(r==KErrNone); |
462 r=dir4.Open(TheFs,fn,KEntryAttMaskSupported); |
461 r=dir4.Open(TheFs,fn,KEntryAttMaskSupported); |
463 test_KErrNone(r); |
462 test(r==KErrNone); |
464 |
463 |
465 CFileList* list; |
464 CFileList* list; |
466 TOpenFileScan fileScan(TheFs); |
465 TOpenFileScan fileScan(TheFs); |
467 fileScan.NextL(list); |
466 fileScan.NextL(list); |
468 |
467 |
550 testObject[i+1].testInitialisation(aTest); |
549 testObject[i+1].testInitialisation(aTest); |
551 testObject[i+1].testSubst(aTest); |
550 testObject[i+1].testSubst(aTest); |
552 testObject[i+1].testDriveList(aTest); |
551 testObject[i+1].testDriveList(aTest); |
553 // Reconnect session[i] |
552 // Reconnect session[i] |
554 r=session[i].Connect(); |
553 r=session[i].Connect(); |
555 test_KErrNone(r); |
554 test(r==KErrNone); |
556 testObject[i].Initialise(session[i]); |
555 testObject[i].Initialise(session[i]); |
557 testObject[i].SetSessionPath(aDrive); |
556 testObject[i].SetSessionPath(aDrive); |
558 testObject[i].testSetVolume(aTest); |
557 testObject[i].testSetVolume(aTest); |
559 testObject[i+1].testInitialisation(aTest); |
558 testObject[i+1].testInitialisation(aTest); |
560 testObject[i].testSubst(aTest); |
559 testObject[i].testSubst(aTest); |
568 testObject[i].testInitialisation(aTest); |
567 testObject[i].testInitialisation(aTest); |
569 testObject[i].testSubst(aTest); |
568 testObject[i].testSubst(aTest); |
570 testObject[i].testDriveList(aTest); |
569 testObject[i].testDriveList(aTest); |
571 // Reconnect session[i+1] |
570 // Reconnect session[i+1] |
572 r=session[i+1].Connect(); |
571 r=session[i+1].Connect(); |
573 test_KErrNone(r); |
572 test(r==KErrNone); |
574 testObject[i+1].Initialise(session[i+1]); |
573 testObject[i+1].Initialise(session[i+1]); |
575 testObject[i+1].SetSessionPath(aDrive); |
574 testObject[i+1].SetSessionPath(aDrive); |
576 testObject[i].testSetVolume(aTest); |
575 testObject[i].testSetVolume(aTest); |
577 testObject[i+1].testInitialisation(aTest); |
576 testObject[i+1].testInitialisation(aTest); |
578 testObject[i].testSubst(aTest); |
577 testObject[i].testSubst(aTest); |