73 test.Next(_L("Scan for open files - one session only")); |
72 test.Next(_L("Scan for open files - one session only")); |
74 |
73 |
75 RFile file1,file2,file3; |
74 RFile file1,file2,file3; |
76 |
75 |
77 TInt r=file1.Open(TheFs,filename1,EFileRead|EFileShareReadersOnly); |
76 TInt r=file1.Open(TheFs,filename1,EFileRead|EFileShareReadersOnly); |
78 test_KErrNone(r); |
77 test(r==KErrNone); |
79 |
78 |
80 r=file2.Open(TheFs,filename2,EFileRead); |
79 r=file2.Open(TheFs,filename2,EFileRead); |
81 test_KErrNone(r); |
80 test(r==KErrNone); |
82 |
81 |
83 r=file3.Open(TheFs,filename1,EFileRead|EFileShareReadersOnly); |
82 r=file3.Open(TheFs,filename1,EFileRead|EFileShareReadersOnly); |
84 test_KErrNone(r); |
83 test(r==KErrNone); |
85 |
84 |
86 CFileList* list=NULL; |
85 CFileList* list=NULL; |
87 TOpenFileScan fileScan(TheFs); |
86 TOpenFileScan fileScan(TheFs); |
88 TRAP(r,fileScan.NextL(list)); |
87 TRAP(r,fileScan.NextL(list)); |
89 test_KErrNone(r); |
88 test(r==KErrNone); |
90 |
89 |
91 if (gRunByBatch) |
90 if (gRunByBatch) |
92 { |
91 { |
93 test(list!=NULL); |
92 test(list!=NULL); |
94 test(list->Count()==1); |
93 test(list->Count()==1); |
132 |
131 |
133 test.Next(_L("Scan for open files - empty sessions")); |
132 test.Next(_L("Scan for open files - empty sessions")); |
134 |
133 |
135 RFs fs1,fs2,fs3,fs4; |
134 RFs fs1,fs2,fs3,fs4; |
136 TInt r=fs1.Connect(); |
135 TInt r=fs1.Connect(); |
137 test_KErrNone(r); |
136 test(r==KErrNone); |
138 r=fs2.Connect(); |
137 r=fs2.Connect(); |
139 test_KErrNone(r); |
138 test(r==KErrNone); |
140 r=fs3.Connect(); |
139 r=fs3.Connect(); |
141 test_KErrNone(r); |
140 test(r==KErrNone); |
142 r=fs4.Connect(); |
141 r=fs4.Connect(); |
143 test_KErrNone(r); |
142 test(r==KErrNone); |
144 |
143 |
145 RFile file1,file2,file3; |
144 RFile file1,file2,file3; |
146 |
145 |
147 r=file1.Open(fs2,filename1,EFileRead|EFileShareReadersOnly); |
146 r=file1.Open(fs2,filename1,EFileRead|EFileShareReadersOnly); |
148 test_KErrNone(r); |
147 test(r==KErrNone); |
149 |
148 |
150 r=file2.Open(fs2,filename2,EFileRead); |
149 r=file2.Open(fs2,filename2,EFileRead); |
151 test_KErrNone(r); |
150 test(r==KErrNone); |
152 |
151 |
153 r=file3.Open(fs2,filename1,EFileRead|EFileShareReadersOnly); |
152 r=file3.Open(fs2,filename1,EFileRead|EFileShareReadersOnly); |
154 test_KErrNone(r); |
153 test(r==KErrNone); |
155 |
154 |
156 CFileList* list; |
155 CFileList* list; |
157 TOpenFileScan fileScan(TheFs); |
156 TOpenFileScan fileScan(TheFs); |
158 fileScan.NextL(list); |
157 fileScan.NextL(list); |
159 |
158 |
202 |
201 |
203 test.Next(_L("Scan for open files - multiple sessions")); |
202 test.Next(_L("Scan for open files - multiple sessions")); |
204 |
203 |
205 RFs fs1,fs2,fs3,fs4; |
204 RFs fs1,fs2,fs3,fs4; |
206 TInt r=fs1.Connect(); |
205 TInt r=fs1.Connect(); |
207 test_KErrNone(r); |
206 test(r==KErrNone); |
208 r=fs2.Connect(); |
207 r=fs2.Connect(); |
209 test_KErrNone(r); |
208 test(r==KErrNone); |
210 r=fs3.Connect(); |
209 r=fs3.Connect(); |
211 test_KErrNone(r); |
210 test(r==KErrNone); |
212 r=fs4.Connect(); |
211 r=fs4.Connect(); |
213 test_KErrNone(r); |
212 test(r==KErrNone); |
214 |
213 |
215 RFile file1,file2,file3; |
214 RFile file1,file2,file3; |
216 |
215 |
217 r=file1.Open(fs2,filename1,EFileRead|EFileShareReadersOnly); |
216 r=file1.Open(fs2,filename1,EFileRead|EFileShareReadersOnly); |
218 test_KErrNone(r); |
217 test(r==KErrNone); |
219 |
218 |
220 r=file2.Open(fs2,filename2,EFileRead|EFileShareReadersOnly); |
219 r=file2.Open(fs2,filename2,EFileRead|EFileShareReadersOnly); |
221 test_KErrNone(r); |
220 test(r==KErrNone); |
222 |
221 |
223 r=file3.Open(fs2,filename1,EFileRead|EFileShareReadersOnly); |
222 r=file3.Open(fs2,filename1,EFileRead|EFileShareReadersOnly); |
224 test_KErrNone(r); |
223 test(r==KErrNone); |
225 |
224 |
226 r=file1.Open(fs4,filename1,EFileRead|EFileShareReadersOnly); |
225 r=file1.Open(fs4,filename1,EFileRead|EFileShareReadersOnly); |
227 test_KErrNone(r); |
226 test(r==KErrNone); |
228 |
227 |
229 r=file2.Open(fs4,filename2,EFileRead|EFileShareReadersOnly); |
228 r=file2.Open(fs4,filename2,EFileRead|EFileShareReadersOnly); |
230 test_KErrNone(r); |
229 test(r==KErrNone); |
231 |
230 |
232 r=file3.Open(fs4,filename1,EFileRead|EFileShareReadersOnly); |
231 r=file3.Open(fs4,filename1,EFileRead|EFileShareReadersOnly); |
233 test_KErrNone(r); |
232 test(r==KErrNone); |
234 |
233 |
235 CFileList* list; |
234 CFileList* list; |
236 TOpenFileScan fileScan(TheFs); |
235 TOpenFileScan fileScan(TheFs); |
237 fileScan.NextL(list); |
236 fileScan.NextL(list); |
238 |
237 |
295 { |
294 { |
296 test.Next(_L("Scan for open files - check RDir sessions are ignored")); |
295 test.Next(_L("Scan for open files - check RDir sessions are ignored")); |
297 |
296 |
298 RFs fs1,fs2,fs3,fs4; |
297 RFs fs1,fs2,fs3,fs4; |
299 TInt r=fs1.Connect(); |
298 TInt r=fs1.Connect(); |
300 test_KErrNone(r); |
299 test(r==KErrNone); |
301 r=fs2.Connect(); |
300 r=fs2.Connect(); |
302 test_KErrNone(r); |
301 test(r==KErrNone); |
303 r=fs3.Connect(); |
302 r=fs3.Connect(); |
304 test_KErrNone(r); |
303 test(r==KErrNone); |
305 r=fs4.Connect(); |
304 r=fs4.Connect(); |
306 test_KErrNone(r); |
305 test(r==KErrNone); |
307 |
306 |
308 RDir dir1,dir2,dir3,dir4; |
307 RDir dir1,dir2,dir3,dir4; |
309 r=dir1.Open(TheFs,dirname1,KEntryAttMaskSupported); |
308 r=dir1.Open(TheFs,dirname1,KEntryAttMaskSupported); |
310 test_KErrNone(r); |
309 test(r==KErrNone); |
311 r=dir2.Open(TheFs,dirname1,KEntryAttMaskSupported); |
310 r=dir2.Open(TheFs,dirname1,KEntryAttMaskSupported); |
312 test_KErrNone(r); |
311 test(r==KErrNone); |
313 r=dir3.Open(TheFs,dirname1,KEntryAttMaskSupported); |
312 r=dir3.Open(TheFs,dirname1,KEntryAttMaskSupported); |
314 test_KErrNone(r); |
313 test(r==KErrNone); |
315 r=dir4.Open(TheFs,dirname1,KEntryAttMaskSupported); |
314 r=dir4.Open(TheFs,dirname1,KEntryAttMaskSupported); |
316 test_KErrNone(r); |
315 test(r==KErrNone); |
317 |
316 |
318 RFile file1,file2,file3; |
317 RFile file1,file2,file3; |
319 r=file1.Open(fs2,filename1,EFileRead|EFileShareReadersOnly); |
318 r=file1.Open(fs2,filename1,EFileRead|EFileShareReadersOnly); |
320 test_KErrNone(r); |
319 test(r==KErrNone); |
321 r=file2.Open(fs2,filename2,EFileRead); |
320 r=file2.Open(fs2,filename2,EFileRead); |
322 test_KErrNone(r); |
321 test(r==KErrNone); |
323 r=file3.Open(fs2,filename1,EFileRead|EFileShareReadersOnly); |
322 r=file3.Open(fs2,filename1,EFileRead|EFileShareReadersOnly); |
324 test_KErrNone(r); |
323 test(r==KErrNone); |
325 |
324 |
326 RDir dir5,dir6,dir7,dir8; |
325 RDir dir5,dir6,dir7,dir8; |
327 r=dir5.Open(fs4,dirname1,KEntryAttMaskSupported); |
326 r=dir5.Open(fs4,dirname1,KEntryAttMaskSupported); |
328 test_KErrNone(r); |
327 test(r==KErrNone); |
329 r=dir6.Open(fs4,dirname1,KEntryAttMaskSupported); |
328 r=dir6.Open(fs4,dirname1,KEntryAttMaskSupported); |
330 test_KErrNone(r); |
329 test(r==KErrNone); |
331 r=dir7.Open(fs4,dirname1,KEntryAttMaskSupported); |
330 r=dir7.Open(fs4,dirname1,KEntryAttMaskSupported); |
332 test_KErrNone(r); |
331 test(r==KErrNone); |
333 r=dir8.Open(fs4,dirname1,KEntryAttMaskSupported); |
332 r=dir8.Open(fs4,dirname1,KEntryAttMaskSupported); |
334 test_KErrNone(r); |
333 test(r==KErrNone); |
335 |
334 |
336 CFileList* list; |
335 CFileList* list; |
337 TOpenFileScan fileScan(TheFs); |
336 TOpenFileScan fileScan(TheFs); |
338 fileScan.NextL(list); |
337 fileScan.NextL(list); |
339 |
338 |
384 |
383 |
385 test.Next(_L("Scan for open files - mixed RDirs and RFiles")); |
384 test.Next(_L("Scan for open files - mixed RDirs and RFiles")); |
386 |
385 |
387 RFile file1,file2,file3; |
386 RFile file1,file2,file3; |
388 TInt r=file1.Open(TheFs,filename1,EFileRead|EFileShareReadersOnly); |
387 TInt r=file1.Open(TheFs,filename1,EFileRead|EFileShareReadersOnly); |
389 test_KErrNone(r); |
388 test(r==KErrNone); |
390 r=file2.Open(TheFs,filename2,EFileRead); |
389 r=file2.Open(TheFs,filename2,EFileRead); |
391 test_KErrNone(r); |
390 test(r==KErrNone); |
392 r=file3.Open(TheFs,filename1,EFileRead|EFileShareReadersOnly); |
391 r=file3.Open(TheFs,filename1,EFileRead|EFileShareReadersOnly); |
393 test_KErrNone(r); |
392 test(r==KErrNone); |
394 |
393 |
395 RDir dir1,dir2,dir3,dir4; |
394 RDir dir1,dir2,dir3,dir4; |
396 r=dir1.Open(TheFs,dirname1,KEntryAttMaskSupported); |
395 r=dir1.Open(TheFs,dirname1,KEntryAttMaskSupported); |
397 test_KErrNone(r); |
396 test(r==KErrNone); |
398 r=dir2.Open(TheFs,dirname1,KEntryAttMaskSupported); |
397 r=dir2.Open(TheFs,dirname1,KEntryAttMaskSupported); |
399 test_KErrNone(r); |
398 test(r==KErrNone); |
400 r=dir3.Open(TheFs,dirname1,KEntryAttMaskSupported); |
399 r=dir3.Open(TheFs,dirname1,KEntryAttMaskSupported); |
401 test_KErrNone(r); |
400 test(r==KErrNone); |
402 r=dir4.Open(TheFs,dirname1,KEntryAttMaskSupported); |
401 r=dir4.Open(TheFs,dirname1,KEntryAttMaskSupported); |
403 test_KErrNone(r); |
402 test(r==KErrNone); |
404 |
403 |
405 CFileList* list; |
404 CFileList* list; |
406 TOpenFileScan fileScan(TheFs); |
405 TOpenFileScan fileScan(TheFs); |
407 fileScan.NextL(list); |
406 fileScan.NextL(list); |
408 |
407 |