133 |
131 |
134 oldName=KOldFile; |
132 oldName=KOldFile; |
135 oldName[0]=(TText)gDriveToTest; |
133 oldName[0]=(TText)gDriveToTest; |
136 |
134 |
137 r=TheFs.GetShortName(systestfile, shortfilename); |
135 r=TheFs.GetShortName(systestfile, shortfilename); |
138 test(r==KErrNotFound || r==KErrNotSupported); |
136 test_Value(r, r == KErrNotFound || r==KErrNotSupported); |
139 |
137 |
140 r=TheFs.GetLongName(systestfile1, longfilename); |
138 r=TheFs.GetLongName(systestfile1, longfilename); |
141 test(r==KErrNotFound || r==KErrNotSupported); |
139 test_Value(r, r == KErrNotFound || r==KErrNotSupported); |
142 |
140 |
143 r=file1.Create(TheFs,oldName,EFileWrite); |
141 r=file1.Create(TheFs,oldName,EFileWrite); |
144 test(r==KErrNone || r==KErrAlreadyExists); |
142 test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
145 file1.Close(); |
143 file1.Close(); |
146 |
144 |
147 r=TheFs.Replace(oldName,systestfile); |
145 r=TheFs.Replace(oldName,systestfile); |
148 test(r==KErrNone); |
146 test_KErrNone(r); |
149 |
147 |
150 r=TheFs.Rename(systestfile,systestfile1); |
148 r=TheFs.Rename(systestfile,systestfile1); |
151 test(r==KErrNone); |
149 test_KErrNone(r); |
152 |
150 |
153 r=TheFs.Entry(systestfile1,entry); |
151 r=TheFs.Entry(systestfile1,entry); |
154 test(r==KErrNone); |
152 test_KErrNone(r); |
155 |
153 |
156 r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
154 r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
157 test(r==KErrNone); |
155 test_KErrNone(r); |
158 |
156 |
159 r=TheFs.Delete(systestfile1); |
157 r=TheFs.Delete(systestfile1); |
160 test(r==KErrNone); |
158 test_KErrNone(r); |
161 } |
159 } |
162 |
160 |
163 LOCAL_C void ResourceRFsTest() |
161 LOCAL_C void ResourceRFsTest() |
164 // |
162 // |
165 // |
163 // |
200 |
198 |
201 oldName=KOldFile; |
199 oldName=KOldFile; |
202 oldName[0]=(TText)gDriveToTest; |
200 oldName[0]=(TText)gDriveToTest; |
203 |
201 |
204 r=TheFs.GetShortName(restestfile, shortfilename); |
202 r=TheFs.GetShortName(restestfile, shortfilename); |
205 test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported); |
203 test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported); |
206 |
204 |
207 r=TheFs.GetLongName(restestfile1, longfilename); |
205 r=TheFs.GetLongName(restestfile1, longfilename); |
208 test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported); |
206 test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported); |
209 |
207 |
210 r=file1.Create(TheFs,oldName,EFileWrite); |
208 r=file1.Create(TheFs,oldName,EFileWrite); |
211 test(r==KErrNone || r==KErrAlreadyExists); |
209 test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
212 file1.Close(); |
210 file1.Close(); |
213 |
211 |
214 r=TheFs.Replace(oldName,restestfile); |
212 r=TheFs.Replace(oldName,restestfile); |
215 test(r==KErrNone); |
213 test_KErrNone(r); |
216 |
214 |
217 r=TheFs.Rename(restestfile,restestfile1); |
215 r=TheFs.Rename(restestfile,restestfile1); |
218 test(r==KErrNone); |
216 test_KErrNone(r); |
219 |
217 |
220 r=TheFs.Entry(restestfile1,entry); |
218 r=TheFs.Entry(restestfile1,entry); |
221 test(r==KErrNone); |
219 test_KErrNone(r); |
222 |
220 |
223 r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
221 r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
224 test(r==KErrNone); |
222 test_KErrNone(r); |
225 |
223 |
226 r=TheFs.Delete(restestfile1); |
224 r=TheFs.Delete(restestfile1); |
227 test(r==KErrNone); |
225 test_KErrNone(r); |
228 |
226 |
229 } |
227 } |
230 |
228 |
231 |
229 |
232 LOCAL_C void privatefalseIDRFsTest() |
230 LOCAL_C void privatefalseIDRFsTest() |
272 |
270 |
273 oldName=KOldFile; |
271 oldName=KOldFile; |
274 oldName[0]=(TText)gDriveToTest; |
272 oldName[0]=(TText)gDriveToTest; |
275 |
273 |
276 r=TheFs.GetShortName(pritestfile, shortfilename); |
274 r=TheFs.GetShortName(pritestfile, shortfilename); |
277 test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported); |
275 test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported); |
278 |
276 |
279 r=TheFs.GetLongName(pritestfile1, longfilename); |
277 r=TheFs.GetLongName(pritestfile1, longfilename); |
280 test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported); |
278 test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported); |
281 |
279 |
282 r=file1.Create(TheFs,oldName,EFileWrite); |
280 r=file1.Create(TheFs,oldName,EFileWrite); |
283 test(r==KErrNone || r==KErrAlreadyExists); |
281 test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
284 file1.Close(); |
282 file1.Close(); |
285 |
283 |
286 r=TheFs.Replace(oldName,pritestfile); |
284 r=TheFs.Replace(oldName,pritestfile); |
287 test(r==KErrNone); |
285 test_KErrNone(r); |
288 |
286 |
289 r=TheFs.Rename(pritestfile,pritestfile1); |
287 r=TheFs.Rename(pritestfile,pritestfile1); |
290 test(r==KErrNone); |
288 test_KErrNone(r); |
291 |
289 |
292 r=TheFs.Entry(pritestfile1,entry); |
290 r=TheFs.Entry(pritestfile1,entry); |
293 test(r==KErrNone); |
291 test_KErrNone(r); |
294 |
292 |
295 r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
293 r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
296 test(r==KErrNone); |
294 test_KErrNone(r); |
297 |
295 |
298 r=TheFs.Delete(pritestfile1); |
296 r=TheFs.Delete(pritestfile1); |
299 test(r==KErrNone); |
297 test_KErrNone(r); |
300 |
298 |
301 } |
299 } |
302 |
300 |
303 |
301 |
304 |
302 |
345 |
343 |
346 oldName=KOldFile; |
344 oldName=KOldFile; |
347 oldName[0]=(TText)gDriveToTest; |
345 oldName[0]=(TText)gDriveToTest; |
348 |
346 |
349 r=TheFs.GetShortName(pritestfile, shortfilename); |
347 r=TheFs.GetShortName(pritestfile, shortfilename); |
350 test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported); |
348 test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported); |
351 |
349 |
352 r=TheFs.GetLongName(pritestfile1, longfilename); |
350 r=TheFs.GetLongName(pritestfile1, longfilename); |
353 test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported); |
351 test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported); |
354 |
352 |
355 r=file1.Create(TheFs,oldName,EFileWrite); |
353 r=file1.Create(TheFs,oldName,EFileWrite); |
356 test(r==KErrNone || r==KErrAlreadyExists); |
354 test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
357 file1.Close(); |
355 file1.Close(); |
358 |
356 |
359 r=TheFs.Replace(oldName,pritestfile); |
357 r=TheFs.Replace(oldName,pritestfile); |
360 test(r==KErrNone); |
358 test_KErrNone(r); |
361 |
359 |
362 r=TheFs.Rename(pritestfile,pritestfile1); |
360 r=TheFs.Rename(pritestfile,pritestfile1); |
363 test(r==KErrNone); |
361 test_KErrNone(r); |
364 |
362 |
365 r=TheFs.Entry(pritestfile1,entry); |
363 r=TheFs.Entry(pritestfile1,entry); |
366 test(r==KErrNone); |
364 test_KErrNone(r); |
367 |
365 |
368 r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
366 r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
369 test(r==KErrNone); |
367 test_KErrNone(r); |
370 |
368 |
371 r=TheFs.Delete(pritestfile1); |
369 r=TheFs.Delete(pritestfile1); |
372 test(r==KErrNone); |
370 test_KErrNone(r); |
373 |
371 |
374 } |
372 } |
375 |
373 |
376 |
374 |
377 LOCAL_C void privateSIDRFstest() |
375 LOCAL_C void privateSIDRFstest() |
411 |
409 |
412 oldName=KOldFile; |
410 oldName=KOldFile; |
413 oldName[0]=(TText)gDriveToTest; |
411 oldName[0]=(TText)gDriveToTest; |
414 |
412 |
415 r=TheFs.GetShortName(pritestfile, shortfilename); |
413 r=TheFs.GetShortName(pritestfile, shortfilename); |
416 test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported); |
414 test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported); |
417 |
415 |
418 r=TheFs.GetLongName(pritestfile1, longfilename); |
416 r=TheFs.GetLongName(pritestfile1, longfilename); |
419 test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported); |
417 test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported); |
420 |
418 |
421 r=file1.Create(TheFs,oldName,EFileWrite); |
419 r=file1.Create(TheFs,oldName,EFileWrite); |
422 test(r==KErrNone || r==KErrAlreadyExists); |
420 test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
423 file1.Close(); |
421 file1.Close(); |
424 |
422 |
425 r=TheFs.Replace(oldName,pritestfile); |
423 r=TheFs.Replace(oldName,pritestfile); |
426 test(r==KErrNone); |
424 test_KErrNone(r); |
427 |
425 |
428 r=TheFs.Rename(pritestfile,pritestfile1); |
426 r=TheFs.Rename(pritestfile,pritestfile1); |
429 test(r==KErrNone || r==KErrAlreadyExists); |
427 test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
430 |
428 |
431 r=TheFs.Entry(pritestfile1,entry); |
429 r=TheFs.Entry(pritestfile1,entry); |
432 test(r==KErrNone); |
430 test_KErrNone(r); |
433 |
431 |
434 r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
432 r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
435 test(r==KErrNone); |
433 test_KErrNone(r); |
436 |
434 |
437 r=TheFs.Delete(pritestfile1); |
435 r=TheFs.Delete(pritestfile1); |
438 test(r==KErrNone); |
436 test_KErrNone(r); |
439 } |
437 } |
440 |
438 |
441 |
439 |
442 LOCAL_C void systemRFiletest() |
440 LOCAL_C void systemRFiletest() |
443 // |
441 // |
444 //RFile testing with session path set to //system// |
442 //RFile testing with session path set to //system// |
445 // |
443 // |
446 { |
444 { |
447 |
445 |
448 r=TheFs.SetSessionPath(systestname); |
446 r=TheFs.SetSessionPath(systestname); |
449 test(r==KErrNone); |
447 test_KErrNone(r); |
450 |
448 |
451 r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite); |
449 r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite); |
452 test(r==KErrNone); |
450 test_KErrNone(r); |
453 file1.Close(); |
451 file1.Close(); |
454 |
452 |
455 r=file1.Create(TheFs,KFileSys,EFileWrite); |
453 r=file1.Create(TheFs,KFileSys,EFileWrite); |
456 test(r==KErrNone); |
454 test_KErrNone(r); |
457 file1.Close(); |
455 file1.Close(); |
458 |
456 |
459 r=file1.Open(TheFs,KFileSys,EFileWrite); |
457 r=file1.Open(TheFs,KFileSys,EFileWrite); |
460 test(r==KErrNone); |
458 test_KErrNone(r); |
461 file1.Close(); |
459 file1.Close(); |
462 |
460 |
463 r=file1.Open(TheFs,KFileSys,EFileRead); |
461 r=file1.Open(TheFs,KFileSys,EFileRead); |
464 test(r==KErrNone); |
462 test_KErrNone(r); |
465 file1.Close(); |
463 file1.Close(); |
466 |
464 |
467 r=file1.Replace(TheFs,KFileSys,EFileWrite); |
465 r=file1.Replace(TheFs,KFileSys,EFileWrite); |
468 test(r==KErrNone); |
466 test_KErrNone(r); |
469 |
467 |
470 r=file1.Rename(KFileSys3); |
468 r=file1.Rename(KFileSys3); |
471 test(r==KErrNone); |
469 test_KErrNone(r); |
472 file1.Close(); |
470 file1.Close(); |
473 |
471 |
474 TFindFile finder(TheFs); |
472 TFindFile finder(TheFs); |
475 CDir* dir = NULL; |
473 CDir* dir = NULL; |
476 r=finder.FindWildByDir(KWildFile, KWildPath, dir); |
474 r=finder.FindWildByDir(KWildFile, KWildPath, dir); |
477 if (!(r==KErrNone)) |
475 if (!(r==KErrNone)) |
478 test.Printf(_L("T_DCALLCAPS: test find wildcards r = %d (expected KErrNone)\n"), r); |
476 test.Printf(_L("T_DCALLCAPS: test find wildcards r = %d (expected KErrNone)\n"), r); |
479 test(r==KErrNone); |
477 test_KErrNone(r); |
480 delete dir; |
478 delete dir; |
481 } |
479 } |
482 |
480 |
483 LOCAL_C void resourceRFiletest() |
481 LOCAL_C void resourceRFiletest() |
484 // |
482 // |
485 //RFile testing with session path set to //resource// |
483 //RFile testing with session path set to //resource// |
486 // |
484 // |
487 { |
485 { |
488 r=TheFs.SetSessionPath(restestname); |
486 r=TheFs.SetSessionPath(restestname); |
489 test(r==KErrNone); |
487 test_KErrNone(r); |
490 |
488 |
491 r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite); |
489 r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite); |
492 test(r==KErrNone); |
490 test_KErrNone(r); |
493 file1.Close(); |
491 file1.Close(); |
494 |
492 |
495 r=file1.Create(TheFs,KFileRes,EFileWrite); |
493 r=file1.Create(TheFs,KFileRes,EFileWrite); |
496 test(r==KErrNone); |
494 test_KErrNone(r); |
497 file1.Close(); |
495 file1.Close(); |
498 |
496 |
499 r=file1.Open(TheFs,KFileRes,EFileWrite|EFileShareExclusive ); |
497 r=file1.Open(TheFs,KFileRes,EFileWrite|EFileShareExclusive ); |
500 test(r==KErrNone); |
498 test_KErrNone(r); |
501 |
499 |
502 r=file1.Rename(KFileRes3); |
500 r=file1.Rename(KFileRes3); |
503 test(r==KErrNone); |
501 test_KErrNone(r); |
504 file1.Close(); |
502 file1.Close(); |
505 |
503 |
506 r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileRead); |
504 r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileRead); |
507 test(r==KErrNone); |
505 test_KErrNone(r); |
508 file1.Close(); |
506 file1.Close(); |
509 |
507 |
510 r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileWrite); |
508 r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileWrite); |
511 test(r==KErrNone); |
509 test_KErrNone(r); |
512 file1.Close(); |
510 file1.Close(); |
513 |
511 |
514 r=file1.Open(TheFs,KFileRes3,EFileShareReadersOnly); |
512 r=file1.Open(TheFs,KFileRes3,EFileShareReadersOnly); |
515 test(r==KErrNone); |
513 test_KErrNone(r); |
516 |
514 |
517 r=file1.ChangeMode(EFileShareExclusive); |
515 r=file1.ChangeMode(EFileShareExclusive); |
518 test(r==KErrNone); |
516 test_KErrNone(r); |
519 file1.Close(); |
517 file1.Close(); |
520 |
518 |
521 r=file1.Replace(TheFs,KFileRes,EFileWrite); |
519 r=file1.Replace(TheFs,KFileRes,EFileWrite); |
522 test(r==KErrNone); |
520 test_KErrNone(r); |
523 file1.Close(); |
521 file1.Close(); |
524 } |
522 } |
525 |
523 |
526 |
524 |
527 LOCAL_C void privatefalseIDRFiletest() |
525 LOCAL_C void privatefalseIDRFiletest() |
528 // |
526 // |
529 //RFile testing with session path set to //Private//falseID |
527 //RFile testing with session path set to //Private//falseID |
530 // |
528 // |
531 { |
529 { |
532 r=TheFs.SetSessionPath(pritestfalseidname); |
530 r=TheFs.SetSessionPath(pritestfalseidname); |
533 test(r==KErrNone); |
531 test_KErrNone(r); |
534 |
532 |
535 r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite); |
533 r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite); |
536 test(r==KErrNone); |
534 test_KErrNone(r); |
537 file1.Close(); |
535 file1.Close(); |
538 |
536 |
539 r=file1.Create(TheFs,KFilePri,EFileWrite); |
537 r=file1.Create(TheFs,KFilePri,EFileWrite); |
540 test(r==KErrNone); |
538 test_KErrNone(r); |
541 file1.Close(); |
539 file1.Close(); |
542 |
540 |
543 r=file1.Open(TheFs,KFilePri,EFileWrite); |
541 r=file1.Open(TheFs,KFilePri,EFileWrite); |
544 test(r==KErrNone); |
542 test_KErrNone(r); |
545 file1.Close(); |
543 file1.Close(); |
546 |
544 |
547 r=file1.Open(TheFs,KFilePri,EFileRead); |
545 r=file1.Open(TheFs,KFilePri,EFileRead); |
548 test(r==KErrNone); |
546 test_KErrNone(r); |
549 file1.Close(); |
547 file1.Close(); |
550 |
548 |
551 r=file1.Replace(TheFs,KFilePri,EFileWrite); |
549 r=file1.Replace(TheFs,KFilePri,EFileWrite); |
552 test(r==KErrNone); |
550 test_KErrNone(r); |
553 |
551 |
554 r=file1.Rename(KFilePri3); |
552 r=file1.Rename(KFilePri3); |
555 test(r==KErrNone); |
553 test_KErrNone(r); |
556 file1.Close(); |
554 file1.Close(); |
557 } |
555 } |
558 |
556 |
559 LOCAL_C void privateRFiletest() |
557 LOCAL_C void privateRFiletest() |
560 // |
558 // |
561 //RFile testing with session path set to //Private//falseID |
559 //RFile testing with session path set to //Private//falseID |
562 // |
560 // |
563 { |
561 { |
564 r=TheFs.SetSessionPath(pritestname); |
562 r=TheFs.SetSessionPath(pritestname); |
565 test(r==KErrNone); |
563 test_KErrNone(r); |
566 |
564 |
567 r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite); |
565 r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite); |
568 test(r==KErrNone); |
566 test_KErrNone(r); |
569 file1.Close(); |
567 file1.Close(); |
570 |
568 |
571 r=file1.Create(TheFs,KFilePri,EFileWrite); |
569 r=file1.Create(TheFs,KFilePri,EFileWrite); |
572 test(r==KErrNone); |
570 test_KErrNone(r); |
573 file1.Close(); |
571 file1.Close(); |
574 |
572 |
575 r=file1.Open(TheFs,KFilePri,EFileWrite); |
573 r=file1.Open(TheFs,KFilePri,EFileWrite); |
576 test(r==KErrNone); |
574 test_KErrNone(r); |
577 file1.Close(); |
575 file1.Close(); |
578 |
576 |
579 r=file1.Open(TheFs,KFilePri,EFileRead); |
577 r=file1.Open(TheFs,KFilePri,EFileRead); |
580 test(r==KErrNone); |
578 test_KErrNone(r); |
581 file1.Close(); |
579 file1.Close(); |
582 |
580 |
583 r=file1.Replace(TheFs,KFilePri,EFileWrite); |
581 r=file1.Replace(TheFs,KFilePri,EFileWrite); |
584 test(r==KErrNone); |
582 test_KErrNone(r); |
585 |
583 |
586 r=file1.Rename(KFilePri3); |
584 r=file1.Rename(KFilePri3); |
587 test(r==KErrNone); |
585 test_KErrNone(r); |
588 file1.Close(); |
586 file1.Close(); |
589 } |
587 } |
590 |
588 |
591 |
589 |
592 |
590 |
631 //system |
629 //system |
632 CDir* dirEntries; |
630 CDir* dirEntries; |
633 TBuf<30> dirNameBuf(KSystemPath); |
631 TBuf<30> dirNameBuf(KSystemPath); |
634 dirNameBuf[0]=(TText)gDriveToTest; |
632 dirNameBuf[0]=(TText)gDriveToTest; |
635 r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
633 r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
636 test(r==KErrNone); |
634 test_KErrNone(r); |
637 dir.Close(); |
635 dir.Close(); |
638 r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
636 r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
639 test(r==KErrNone); |
637 test_KErrNone(r); |
640 dirNameBuf.Zero(); |
638 dirNameBuf.Zero(); |
641 delete dirEntries; |
639 delete dirEntries; |
642 //Private//falseID |
640 //Private//falseID |
643 dirNameBuf=KPrivateFalseID; |
641 dirNameBuf=KPrivateFalseID; |
644 dirNameBuf[0]=(TText)gDriveToTest; |
642 dirNameBuf[0]=(TText)gDriveToTest; |
645 r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
643 r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
646 test(r==KErrNone); |
644 test_KErrNone(r); |
647 dir.Close(); |
645 dir.Close(); |
648 r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
646 r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
649 test(r==KErrNone); |
647 test_KErrNone(r); |
650 dirNameBuf.Zero(); |
648 dirNameBuf.Zero(); |
651 delete dirEntries; |
649 delete dirEntries; |
652 //Private |
650 //Private |
653 dirNameBuf=KPrivatePath; |
651 dirNameBuf=KPrivatePath; |
654 dirNameBuf[0]=(TText)gDriveToTest; |
652 dirNameBuf[0]=(TText)gDriveToTest; |
655 r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
653 r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
656 test(r==KErrNone); |
654 test_KErrNone(r); |
657 dir.Close(); |
655 dir.Close(); |
658 r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
656 r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
659 test(r==KErrNone); |
657 test_KErrNone(r); |
660 dirNameBuf.Zero(); |
658 dirNameBuf.Zero(); |
661 delete dirEntries; |
659 delete dirEntries; |
662 //Private/uid |
660 //Private/uid |
663 TheFs.PrivatePath(dirNameBuf); |
661 TheFs.PrivatePath(dirNameBuf); |
664 dirNameBuf.Insert(0,_L("?:")); |
662 dirNameBuf.Insert(0,_L("?:")); |
665 dirNameBuf[0]=(TText)gDriveToTest; |
663 dirNameBuf[0]=(TText)gDriveToTest; |
666 r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
664 r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
667 test(r==KErrNone); |
665 test_KErrNone(r); |
668 dir.Close(); |
666 dir.Close(); |
669 r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
667 r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
670 test(r==KErrNone); |
668 test_KErrNone(r); |
671 dirNameBuf.Zero(); |
669 dirNameBuf.Zero(); |
672 delete dirEntries; |
670 delete dirEntries; |
673 //Resource |
671 //Resource |
674 dirNameBuf=KResourcePath; |
672 dirNameBuf=KResourcePath; |
675 dirNameBuf[0]=(TText)gDriveToTest; |
673 dirNameBuf[0]=(TText)gDriveToTest; |
676 r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
674 r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
677 test(r==KErrNone); |
675 test_KErrNone(r); |
678 r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
676 r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
679 test(r==KErrNone); |
677 test_KErrNone(r); |
680 dir.Close(); |
678 dir.Close(); |
681 delete dirEntries; |
679 delete dirEntries; |
682 } |
680 } |
683 |
681 |
684 |
682 |
725 test(aStat2==KErrNone); |
723 test(aStat2==KErrNone); |
726 test(aStat3==KErrNone); |
724 test(aStat3==KErrNone); |
727 test(aStat4==KErrNone); |
725 test(aStat4==KErrNone); |
728 |
726 |
729 r=TheFs.SetSessionPath(systestname); |
727 r=TheFs.SetSessionPath(systestname); |
730 test(r==KErrNone); |
728 test_KErrNone(r); |
731 |
729 |
732 //Test RRawDisk class |
730 //Test RRawDisk class |
733 r=rawdisk.Open(TheFs,gTheDriveNum); |
731 r=rawdisk.Open(TheFs,gTheDriveNum); |
734 test(r==KErrNone); |
732 test_KErrNone(r); |
735 rawdisk.Close(); |
733 rawdisk.Close(); |
736 |
734 |
737 RDirtest(); |
735 RDirtest(); |
738 |
736 |
739 #ifdef __WINS__ |
737 #ifdef __WINS__ |
740 if (User::UpperCase(driveBuf[0]) != 'C') |
738 if (User::UpperCase(driveBuf[0]) != 'C') |
741 #endif |
739 #endif |
742 { |
740 { |
743 //Test RFormat class |
741 //Test RFormat class |
744 r=format.Open(TheFs,driveBuf,EHighDensity,count); |
742 r=format.Open(TheFs,driveBuf,EHighDensity,count); |
745 test(r==KErrNone); |
743 test_KErrNone(r); |
746 |
744 |
747 while(count) |
745 while(count) |
748 { |
746 { |
749 TInt r=format.Next(count); |
747 TInt r=format.Next(count); |
750 test(r==KErrNone); |
748 test_KErrNone(r); |
751 } |
749 } |
752 format.Close(); |
750 format.Close(); |
753 } |
751 } |
754 |
752 |
755 driveBuf[0]=(TText)gDriveToTest; |
753 driveBuf[0]=(TText)gDriveToTest; |
756 r=TheFs.ScanDrive(driveBuf); |
754 r=TheFs.ScanDrive(driveBuf); |
757 test(r==KErrNone || r==KErrNotSupported); |
755 test_Value(r, r == KErrNone || r==KErrNotSupported); |
758 r=TheFs.CheckDisk(driveBuf); |
756 r=TheFs.CheckDisk(driveBuf); |
759 test(r==KErrNone || r==KErrNotSupported); |
757 test_Value(r, r == KErrNone || r==KErrNotSupported); |
760 } |
758 } |
761 |
759 |
762 LOCAL_C void TestCaps() |
760 LOCAL_C void TestCaps() |
763 // |
761 // |
764 // test format etc that require certain capabilities |
762 // test format etc that require certain capabilities |
825 TBuf<30> sesspath; |
823 TBuf<30> sesspath; |
826 sesspath=_L("?:\\"); |
824 sesspath=_L("?:\\"); |
827 sesspath[0] = (TText)gDriveToTest; |
825 sesspath[0] = (TText)gDriveToTest; |
828 |
826 |
829 TInt r= TheFs.SetSessionPath(sesspath); |
827 TInt r= TheFs.SetSessionPath(sesspath); |
830 test(r==KErrNone); |
828 test_KErrNone(r); |
831 |
829 |
832 //cleanup from previous run of this test |
830 //cleanup from previous run of this test |
833 TBuf<20> delDir; |
831 TBuf<20> delDir; |
834 CFileMan* fMan=CFileMan::NewL(TheFs); |
832 CFileMan* fMan=CFileMan::NewL(TheFs); |
835 delDir=KResourcePath; |
833 delDir=KResourcePath; |
836 delDir[0]=(TText)gDriveToTest; |
834 delDir[0]=(TText)gDriveToTest; |
837 r=fMan->RmDir(delDir); |
835 r=fMan->RmDir(delDir); |
838 test(r==KErrNone || KErrNotFound); |
836 test_Value(r, r == KErrNone || r == KErrNotFound); |
839 delDir=KSystemPath; |
837 delDir=KSystemPath; |
840 delDir[0]=(TText)gDriveToTest; |
838 delDir[0]=(TText)gDriveToTest; |
841 r=fMan->RmDir(delDir); |
839 r=fMan->RmDir(delDir); |
842 test(r==KErrNone || KErrNotFound); |
840 test_Value(r, r == KErrNone || r == KErrNotFound); |
843 delDir=KPrivatePath; |
841 delDir=KPrivatePath; |
844 delDir[0]=(TText)gDriveToTest; |
842 delDir[0]=(TText)gDriveToTest; |
845 r=fMan->RmDir(delDir); |
843 r=fMan->RmDir(delDir); |
846 test(r==KErrNone || KErrNotFound); |
844 test_Value(r, r == KErrNone || r == KErrNotFound); |
847 delete fMan; |
845 delete fMan; |
848 |
846 |
849 //check double mode ie that Defpath still works |
847 //check double mode ie that Defpath still works |
850 RFs fs1; |
848 RFs fs1; |
851 RFs fs2; |
849 RFs fs2; |
852 |
850 |
853 r=fs1.Connect(); |
851 r=fs1.Connect(); |
854 test(r==KErrNone); |
852 test_KErrNone(r); |
855 r=fs1.SessionPath(sesspath); |
853 r=fs1.SessionPath(sesspath); |
856 test(r==KErrNone); |
854 test_KErrNone(r); |
857 test.Printf(_L("session1 Path=%S"),&sesspath); |
855 test.Printf(_L("session1 Path=%S"),&sesspath); |
858 |
856 |
859 TBuf<30> privatepath; |
857 TBuf<30> privatepath; |
860 r=fs1.SetSessionToPrivate(gTheDriveNum); |
858 r=fs1.SetSessionToPrivate(gTheDriveNum); |
861 test(r==KErrNone); |
859 test_KErrNone(r); |
862 r=fs1.PrivatePath(privatepath); |
860 r=fs1.PrivatePath(privatepath); |
863 test(r==KErrNone); |
861 test_KErrNone(r); |
864 r=privatepath.Compare(KExpectedPrivatePath()); |
862 r=privatepath.Compare(KExpectedPrivatePath()); |
865 test(r==0); |
863 test_Value(r, r == 0); |
866 r=fs1.SessionPath(sesspath); |
864 r=fs1.SessionPath(sesspath); |
867 test(r==KErrNone); |
865 test_KErrNone(r); |
868 r=privatepath.Compare(sesspath.Mid(KPathPosition)); |
866 r=privatepath.Compare(sesspath.Mid(KPathPosition)); |
869 test(r==0); |
867 test_Value(r, r == 0); |
870 r=fs1.CreatePrivatePath(gTheDriveNum); |
868 r=fs1.CreatePrivatePath(gTheDriveNum); |
871 test(r==KErrNone); |
869 test_KErrNone(r); |
872 fs1.Close(); |
870 fs1.Close(); |
873 |
871 |
874 r=fs2.Connect(); |
872 r=fs2.Connect(); |
875 test(r==KErrNone); |
873 test_KErrNone(r); |
876 r=fs2.SessionPath(sesspath); |
874 r=fs2.SessionPath(sesspath); |
877 test(r==KErrNone); |
875 test_KErrNone(r); |
878 test.Printf(_L("session2 Path=%S"),&sesspath); |
876 test.Printf(_L("session2 Path=%S"),&sesspath); |
879 fs2.Close(); |
877 fs2.Close(); |
880 |
878 |
881 TestCaps(); |
879 TestCaps(); |
882 |
880 |