103 // |
102 // |
104 // |
103 // |
105 { |
104 { |
106 TVolumeInfo v; |
105 TVolumeInfo v; |
107 TInt r=TheFs.Volume(v,aDrive); |
106 TInt r=TheFs.Volume(v,aDrive); |
108 test_KErrNone(r); |
107 test(r==KErrNone); |
109 return(v.iFree); |
108 return(v.iFree); |
110 } |
109 } |
111 |
110 |
112 LOCAL_C TInt64 DiskSize(TInt aDrive) |
111 LOCAL_C TInt64 DiskSize(TInt aDrive) |
113 // |
112 // |
114 // |
113 // |
115 // |
114 // |
116 { |
115 { |
117 TVolumeInfo v; |
116 TVolumeInfo v; |
118 TInt r=TheFs.Volume(v,aDrive); |
117 TInt r=TheFs.Volume(v,aDrive); |
119 test_KErrNone(r); |
118 test(r==KErrNone); |
120 return(v.iSize); |
119 return(v.iSize); |
121 } |
120 } |
122 |
121 |
123 // MinimumFileSize() - |
122 // MinimumFileSize() - |
124 // Deduces the minimum space occupied by a file by creating a file of one byte |
123 // Deduces the minimum space occupied by a file by creating a file of one byte |
125 // in length. This should equal the cluster size on FAT volumes. |
124 // in length. This should equal the cluster size on FAT volumes. |
126 // |
125 // |
127 LOCAL_C TInt MinimumFileSize(TInt aDrive) |
126 LOCAL_C TInt MinimumFileSize(TInt aDrive) |
128 { |
127 { |
129 TInt r = TheFs.Delete(KTestFile1); |
128 TInt r = TheFs.Delete(KTestFile1); |
130 test_Value(r, r == KErrNone || r==KErrNotFound); |
129 test(r==KErrNone || r==KErrNotFound); |
131 |
130 |
132 TInt64 freeSpace = FreeDiskSpace(aDrive); |
131 TInt64 freeSpace = FreeDiskSpace(aDrive); |
133 |
132 |
134 RFile file; |
133 RFile file; |
135 |
134 |
136 |
135 |
137 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
136 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
138 test_KErrNone(r); |
137 test(r==KErrNone); |
139 |
138 |
140 r = file.Write(TheBuffer,1); |
139 r = file.Write(TheBuffer,1); |
141 test_KErrNone(r); |
140 test(r==KErrNone); |
142 file.Close(); |
141 file.Close(); |
143 TInt64 newSpace = FreeDiskSpace(aDrive); |
142 TInt64 newSpace = FreeDiskSpace(aDrive); |
144 |
143 |
145 r = TheFs.Delete(KTestFile1); |
144 r = TheFs.Delete(KTestFile1); |
146 test_KErrNone(r); |
145 test(r==KErrNone); |
147 |
146 |
148 |
147 |
149 TInt64 minFileSize = freeSpace - newSpace; |
148 TInt64 minFileSize = freeSpace - newSpace; |
150 test (minFileSize >= 0); |
149 test (minFileSize >= 0); |
151 minFileSize = Max(minFileSize, 512); |
150 minFileSize = Max(minFileSize, 512); |
215 test.Printf(_L("inside init++++++++++++++++++++++++++>\n\n\n")); |
214 test.Printf(_L("inside init++++++++++++++++++++++++++>\n\n\n")); |
216 test.Printf(_L("RemovableDrive = %d\n"),RemovableDrive); |
215 test.Printf(_L("RemovableDrive = %d\n"),RemovableDrive); |
217 // initialise removable drive descriptor |
216 // initialise removable drive descriptor |
218 TChar c; |
217 TChar c; |
219 TInt r=RFs::DriveToChar(RemovableDrive,c); |
218 TInt r=RFs::DriveToChar(RemovableDrive,c); |
220 test_KErrNone(r); |
219 test(r==KErrNone); |
221 RemovableDriveBuf[0]=(TText)c; |
220 RemovableDriveBuf[0]=(TText)c; |
222 |
221 |
223 if( !LffsDrive ) |
222 if( !LffsDrive ) |
224 { |
223 { |
225 // and create the default directory |
224 // and create the default directory |
241 Format(EDriveC); |
240 Format(EDriveC); |
242 #endif |
241 #endif |
243 TheDiskSize=DiskSize(KDefaultDrive); |
242 TheDiskSize=DiskSize(KDefaultDrive); |
244 // and set the default directory |
243 // and set the default directory |
245 r=TheFs.MkDirAll(gSessionPath); |
244 r=TheFs.MkDirAll(gSessionPath); |
246 test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
245 test(r==KErrNone || r==KErrAlreadyExists); |
247 |
246 |
248 r=TheFs.Delete(KFileFiller); |
247 r=TheFs.Delete(KFileFiller); |
249 test_Value(r, r == KErrNone || r==KErrNotFound); |
248 test(r==KErrNone || r==KErrNotFound); |
250 r=TheFs.Delete(KTestFile1); |
249 r=TheFs.Delete(KTestFile1); |
251 test_Value(r, r == KErrNone || r==KErrNotFound); |
250 test(r==KErrNone || r==KErrNotFound); |
252 r=TheFs.Delete(KTestFile2); |
251 r=TheFs.Delete(KTestFile2); |
253 test_Value(r, r == KErrNone || r==KErrNotFound); |
252 test(r==KErrNone || r==KErrNotFound); |
254 r=TheFs.RmDir(KTestDir1); |
253 r=TheFs.RmDir(KTestDir1); |
255 test_Value(r, r == KErrNone || r==KErrNotFound); |
254 test(r==KErrNone || r==KErrNotFound); |
256 r=TheFs.RmDir(KTestDir2); |
255 r=TheFs.RmDir(KTestDir2); |
257 test_Value(r, r == KErrNone || r==KErrNotFound); |
256 test(r==KErrNone || r==KErrNotFound); |
258 |
257 |
259 gMinFileSize = MinimumFileSize(drive); |
258 gMinFileSize = MinimumFileSize(drive); |
260 } |
259 } |
261 |
260 |
262 LOCAL_C TInt64 FillDisk(RFile& aFile,TInt64 aNewSpace,TInt aDrive) |
261 LOCAL_C TInt64 FillDisk(RFile& aFile,TInt64 aNewSpace,TInt aDrive) |
352 TInt r; |
351 TInt r; |
353 switch(aTask) |
352 switch(aTask) |
354 { |
353 { |
355 case ETaskMkDir: |
354 case ETaskMkDir: |
356 r=TheFs.RmDir(KTestDir1); |
355 r=TheFs.RmDir(KTestDir1); |
357 test_KErrNone(r); |
356 test(r==KErrNone); |
358 break; |
357 break; |
359 case ETaskRmDir: break; |
358 case ETaskRmDir: break; |
360 case ETaskDelete: break; |
359 case ETaskDelete: break; |
361 case ETaskReplace: |
360 case ETaskReplace: |
362 r=TheFs.Delete(KTestFile2); |
361 r=TheFs.Delete(KTestFile2); |
363 test_KErrNone(r); |
362 test(r==KErrNone); |
364 break; |
363 break; |
365 case ETaskFileReplace: |
364 case ETaskFileReplace: |
366 r=TheFs.Delete(KTestFile1); |
365 r=TheFs.Delete(KTestFile1); |
367 test_KErrNone(r); |
366 test(r==KErrNone); |
368 break; |
367 break; |
369 case ETaskFileWrite: |
368 case ETaskFileWrite: |
370 case ETaskFileWrite4KB: |
369 case ETaskFileWrite4KB: |
371 case ETaskFileWrite64KB: |
370 case ETaskFileWrite64KB: |
372 case ETaskFileSetSize: |
371 case ETaskFileSetSize: |
395 switch(aTask) |
394 switch(aTask) |
396 { |
395 { |
397 case ETaskMkDir: break; |
396 case ETaskMkDir: break; |
398 case ETaskRmDir: |
397 case ETaskRmDir: |
399 r=TheFs.MkDir(KTestDir1); |
398 r=TheFs.MkDir(KTestDir1); |
400 test_KErrNone(r); |
399 test(r==KErrNone); |
401 break; |
400 break; |
402 case ETaskDelete: |
401 case ETaskDelete: |
403 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
402 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
404 test_KErrNone(r); |
403 test(r==KErrNone); |
405 if( !LffsDrive ) |
404 if( !LffsDrive ) |
406 { |
405 { |
407 r=file.SetSize(KFileSize1); |
406 r=file.SetSize(KFileSize1); |
408 test_KErrNone(r); |
407 test(r==KErrNone); |
409 } |
408 } |
410 else |
409 else |
411 { |
410 { |
412 // LFFS supports sparse files, so we have to write real data |
411 // LFFS supports sparse files, so we have to write real data |
413 // into the file to ensure that it uses up disk space |
412 // into the file to ensure that it uses up disk space |
415 } |
414 } |
416 file.Close(); |
415 file.Close(); |
417 break; |
416 break; |
418 case ETaskReplace: |
417 case ETaskReplace: |
419 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
418 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
420 test_KErrNone(r); |
419 test(r==KErrNone); |
421 if( !LffsDrive ) |
420 if( !LffsDrive ) |
422 { |
421 { |
423 r=file.SetSize(KFileSize1); |
422 r=file.SetSize(KFileSize1); |
424 test_KErrNone(r); |
423 test(r==KErrNone); |
425 } |
424 } |
426 else |
425 else |
427 { |
426 { |
428 WriteToFile( file, KFileSize2 ); |
427 WriteToFile( file, KFileSize2 ); |
429 } |
428 } |
430 file.Close(); |
429 file.Close(); |
431 r=file2.Create(TheFs,KTestFile2,EFileShareAny|EFileWrite); |
430 r=file2.Create(TheFs,KTestFile2,EFileShareAny|EFileWrite); |
432 test_KErrNone(r); |
431 test(r==KErrNone); |
433 if( !LffsDrive ) |
432 if( !LffsDrive ) |
434 { |
433 { |
435 r=file2.SetSize(KFileSize3); |
434 r=file2.SetSize(KFileSize3); |
436 test_KErrNone(r); |
435 test(r==KErrNone); |
437 } |
436 } |
438 else |
437 else |
439 { |
438 { |
440 WriteToFile( file2, gMinFileSize << 4); // 512 * 16 = 8K |
439 WriteToFile( file2, gMinFileSize << 4); // 512 * 16 = 8K |
441 } |
440 } |
442 file2.Close(); |
441 file2.Close(); |
443 break; |
442 break; |
444 case ETaskFileReplace: |
443 case ETaskFileReplace: |
445 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
444 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
446 test_KErrNone(r); |
445 test(r==KErrNone); |
447 if( !LffsDrive ) |
446 if( !LffsDrive ) |
448 { |
447 { |
449 r=file.SetSize(KFileSize3*2); |
448 r=file.SetSize(KFileSize3*2); |
450 } |
449 } |
451 else |
450 else |
452 { |
451 { |
453 WriteToFile( file, KFileSize3 ); |
452 WriteToFile( file, KFileSize3 ); |
454 } |
453 } |
455 test_KErrNone(r); |
454 test(r==KErrNone); |
456 file.Close(); |
455 file.Close(); |
457 break; |
456 break; |
458 case ETaskFileWrite: |
457 case ETaskFileWrite: |
459 case ETaskFileWrite4KB: |
458 case ETaskFileWrite4KB: |
460 case ETaskFileWrite64KB: |
459 case ETaskFileWrite64KB: |
461 case ETaskFileSetSize: |
460 case ETaskFileSetSize: |
462 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
461 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
463 test_KErrNone(r); |
462 test(r==KErrNone); |
464 file.Close(); |
463 file.Close(); |
465 break; |
464 break; |
466 case ETaskNoChange1: |
465 case ETaskNoChange1: |
467 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
466 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
468 test_KErrNone(r); |
467 test(r==KErrNone); |
469 if( !LffsDrive ) |
468 if( !LffsDrive ) |
470 { |
469 { |
471 r=file.SetSize(KFileSize1); |
470 r=file.SetSize(KFileSize1); |
472 test_KErrNone(r); |
471 test(r==KErrNone); |
473 } |
472 } |
474 else |
473 else |
475 { |
474 { |
476 WriteToFile( file, KFileSize1 ); |
475 WriteToFile( file, KFileSize1 ); |
477 } |
476 } |
478 file.Close(); |
477 file.Close(); |
479 break; |
478 break; |
480 case ETaskNoChange2: |
479 case ETaskNoChange2: |
481 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
480 r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
482 test_KErrNone(r); |
481 test(r==KErrNone); |
483 file.Close(); |
482 file.Close(); |
484 break; |
483 break; |
485 case ETaskFileCreateLffs: |
484 case ETaskFileCreateLffs: |
486 r = TheFs.Delete(KTestFile1); |
485 r = TheFs.Delete(KTestFile1); |
487 break; |
486 break; |
496 // |
495 // |
497 { |
496 { |
498 RTest test(_L("T_DSPACE_ThreadFunction")); |
497 RTest test(_L("T_DSPACE_ThreadFunction")); |
499 RFs fs; |
498 RFs fs; |
500 TInt r=fs.Connect(); |
499 TInt r=fs.Connect(); |
501 test_KErrNone(r); |
500 test(r==KErrNone); |
502 r=fs.SetSessionPath(gSessionPath); |
501 r=fs.SetSessionPath(gSessionPath); |
503 test_KErrNone(r); |
502 test(r==KErrNone); |
504 TThreadTask task=*(TThreadTask*)&aThreadTask; |
503 TThreadTask task=*(TThreadTask*)&aThreadTask; |
505 RFile file; |
504 RFile file; |
506 switch(task) |
505 switch(task) |
507 { |
506 { |
508 case ETaskMkDir: |
507 case ETaskMkDir: |
509 r=fs.MkDir(KTestDir1); |
508 r=fs.MkDir(KTestDir1); |
510 test_KErrNone(r); |
509 test(r==KErrNone); |
511 break; |
510 break; |
512 case ETaskRmDir: |
511 case ETaskRmDir: |
513 r=fs.RmDir(KTestDir1); |
512 r=fs.RmDir(KTestDir1); |
514 test_KErrNone(r); |
513 test(r==KErrNone); |
515 break; |
514 break; |
516 case ETaskDelete: |
515 case ETaskDelete: |
517 r=fs.Delete(KTestFile1); |
516 r=fs.Delete(KTestFile1); |
518 test_KErrNone(r); |
517 test(r==KErrNone); |
519 break; |
518 break; |
520 case ETaskReplace: |
519 case ETaskReplace: |
521 r=fs.Replace(KTestFile1,KTestFile2); |
520 r=fs.Replace(KTestFile1,KTestFile2); |
522 test_KErrNone(r); |
521 test(r==KErrNone); |
523 break; |
522 break; |
524 case ETaskFileReplace: |
523 case ETaskFileReplace: |
525 r=file.Replace(fs,KTestFile1,EFileShareAny|EFileWrite); |
524 r=file.Replace(fs,KTestFile1,EFileShareAny|EFileWrite); |
526 test_KErrNone(r); |
525 test(r==KErrNone); |
527 file.Close(); |
526 file.Close(); |
528 break; |
527 break; |
529 case ETaskFileWrite: |
528 case ETaskFileWrite: |
530 r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
529 r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
531 test_KErrNone(r); |
530 test(r==KErrNone); |
532 #if defined(__WINS__) |
531 #if defined(__WINS__) |
533 WriteToFile( file, gMinFileSize << 4); // 512 * 16 = 8K |
532 WriteToFile( file, gMinFileSize << 4); // 512 * 16 = 8K |
534 #else |
533 #else |
535 WriteToFile( file, gMinFileSize << 1); // 512 * 2 = 1K |
534 WriteToFile( file, gMinFileSize << 1); // 512 * 2 = 1K |
536 #endif |
535 #endif |
537 file.Close(); |
536 file.Close(); |
538 break; |
537 break; |
539 case ETaskFileWrite4KB: |
538 case ETaskFileWrite4KB: |
540 r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
539 r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
541 test_KErrNone(r); |
540 test(r==KErrNone); |
542 WriteToFile(file,gMinFileSize << 3); // 512 * 2^3 = 512 * 8 = 4K |
541 WriteToFile(file,gMinFileSize << 3); // 512 * 2^3 = 512 * 8 = 4K |
543 file.Close(); |
542 file.Close(); |
544 break; |
543 break; |
545 case ETaskFileWrite64KB: |
544 case ETaskFileWrite64KB: |
546 r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
545 r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
547 test_KErrNone(r); |
546 test(r==KErrNone); |
548 WriteToFile(file,gMinFileSize<<7); // 512 * 2^7 = 512 * 128 = 64K |
547 WriteToFile(file,gMinFileSize<<7); // 512 * 2^7 = 512 * 128 = 64K |
549 file.Close(); |
548 file.Close(); |
550 break; |
549 break; |
551 case ETaskFileSetSize: |
550 case ETaskFileSetSize: |
552 r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
551 r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
553 test_KErrNone(r); |
552 test(r==KErrNone); |
554 r=file.SetSize(KFileSize3); |
553 r=file.SetSize(KFileSize3); |
555 file.Close(); |
554 file.Close(); |
556 break; |
555 break; |
557 case ETaskFileCreateLffs: |
556 case ETaskFileCreateLffs: |
558 r=file.Create(fs,KTestFile1,EFileShareAny|EFileWrite); |
557 r=file.Create(fs,KTestFile1,EFileShareAny|EFileWrite); |
559 test_KErrNone(r); |
558 test(r==KErrNone); |
560 file.Close(); |
559 file.Close(); |
561 break; |
560 break; |
562 case ETaskNoChange1: |
561 case ETaskNoChange1: |
563 { |
562 { |
564 r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
563 r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
565 test_KErrNone(r); |
564 test(r==KErrNone); |
566 TTime time; |
565 TTime time; |
567 time.HomeTime(); |
566 time.HomeTime(); |
568 r=file.SetModified(time); |
567 r=file.SetModified(time); |
569 test_KErrNone(r); |
568 test(r==KErrNone); |
570 file.Close(); |
569 file.Close(); |
571 break; |
570 break; |
572 } |
571 } |
573 case ETaskNoChange2: |
572 case ETaskNoChange2: |
574 { |
573 { |
575 TEntry e; |
574 TEntry e; |
576 r=fs.Entry(KTestFile1,e); |
575 r=fs.Entry(KTestFile1,e); |
577 test_KErrNone(r); |
576 test(r==KErrNone); |
578 break; |
577 break; |
579 } |
578 } |
580 case ETaskSpin: |
579 case ETaskSpin: |
581 for(;;) {}; |
580 for(;;) {}; |
582 |
581 |
731 // |
730 // |
732 { |
731 { |
733 // make default directory |
732 // make default directory |
734 _LIT(defaultDir,"C:\\F32-TST\\"); |
733 _LIT(defaultDir,"C:\\F32-TST\\"); |
735 TInt r=TheFs.MkDirAll(defaultDir); |
734 TInt r=TheFs.MkDirAll(defaultDir); |
736 test_Value(r, r == KErrNone||r==KErrAlreadyExists); |
735 test(r==KErrNone||r==KErrAlreadyExists); |
737 // create the filler file |
736 // create the filler file |
738 RFile file; |
737 RFile file; |
739 TFileName fileName=_L("C:"); |
738 TFileName fileName=_L("C:"); |
740 fileName+=KFileFiller; |
739 fileName+=KFileFiller; |
741 r=file.Create(TheFs,fileName,EFileShareAny|EFileWrite); |
740 r=file.Create(TheFs,fileName,EFileShareAny|EFileWrite); |
742 test_KErrNone(r); |
741 test(r==KErrNone); |
743 TInt64 free=FreeDiskSpace(EDriveC); |
742 TInt64 free=FreeDiskSpace(EDriveC); |
744 // use up 16KB |
743 // use up 16KB |
745 FillDisk(file,free-16384,EDriveC); |
744 FillDisk(file,free-16384,EDriveC); |
746 |
745 |
747 // test formatting notifies clients on only specific drive |
746 // test formatting notifies clients on only specific drive |
753 TheFs.NotifyDiskSpace(freeD-1024,RemovableDrive,stat2); |
752 TheFs.NotifyDiskSpace(freeD-1024,RemovableDrive,stat2); |
754 test(stat1==KRequestPending && stat2==KRequestPending); |
753 test(stat1==KRequestPending && stat2==KRequestPending); |
755 RFormat f; |
754 RFormat f; |
756 TInt count; |
755 TInt count; |
757 r=f.Open(TheFs,RemovableDriveBuf,EQuickFormat,count); |
756 r=f.Open(TheFs,RemovableDriveBuf,EQuickFormat,count); |
758 test_KErrNone(r); |
757 test(r==KErrNone); |
759 while(count) |
758 while(count) |
760 { |
759 { |
761 r=f.Next(count); |
760 r=f.Next(count); |
762 test_KErrNone(r); |
761 test(r==KErrNone); |
763 } |
762 } |
764 f.Close(); |
763 f.Close(); |
765 User::After(1000000); |
764 User::After(1000000); |
766 User::WaitForRequest(stat2); |
765 User::WaitForRequest(stat2); |
767 test(stat1==KRequestPending && stat2==KErrNone); |
766 test(stat1==KRequestPending && stat2==KErrNone); |
771 // and create the test directory for the removable drive |
770 // and create the test directory for the removable drive |
772 TFileName fName=_L(""); |
771 TFileName fName=_L(""); |
773 fName+=RemovableDriveBuf; |
772 fName+=RemovableDriveBuf; |
774 fName+=_L("F32-TST\\"); |
773 fName+=_L("F32-TST\\"); |
775 r=TheFs.MkDirAll(fName); |
774 r=TheFs.MkDirAll(fName); |
776 test_KErrNone(r); |
775 test(r==KErrNone); |
777 |
776 |
778 // test that a media change notifies clients on all drives |
777 // test that a media change notifies clients on all drives |
779 test.Next(_L("media change")); |
778 test.Next(_L("media change")); |
780 freeC=FreeDiskSpace(EDriveC); |
779 freeC=FreeDiskSpace(EDriveC); |
781 freeD=FreeDiskSpace(RemovableDrive); |
780 freeD=FreeDiskSpace(RemovableDrive); |
805 |
804 |
806 // test that scandrive notifies clients on only specific drives |
805 // test that scandrive notifies clients on only specific drives |
807 test.Next(_L("scandrive")); |
806 test.Next(_L("scandrive")); |
808 // first test that scandrive does not find any problems on the removable media |
807 // first test that scandrive does not find any problems on the removable media |
809 r=TheFs.ScanDrive(RemovableDriveBuf); |
808 r=TheFs.ScanDrive(RemovableDriveBuf); |
810 test_KErrNone(r); |
809 test(r==KErrNone); |
811 // now set up disk space notification |
810 // now set up disk space notification |
812 freeC=FreeDiskSpace(EDriveC); |
811 freeC=FreeDiskSpace(EDriveC); |
813 freeD=FreeDiskSpace(RemovableDrive); |
812 freeD=FreeDiskSpace(RemovableDrive); |
814 test.Printf(_L("free space on drive %d = 0x%x\n"),EDriveC,freeC); |
813 test.Printf(_L("free space on drive %d = 0x%x\n"),EDriveC,freeC); |
815 test.Printf(_L("free space on drive %d = 0x%x\n"),RemovableDrive,freeD); |
814 test.Printf(_L("free space on drive %d = 0x%x\n"),RemovableDrive,freeD); |
816 TheFs.NotifyDiskSpace(freeC+8192,EDriveC,stat1); |
815 TheFs.NotifyDiskSpace(freeC+8192,EDriveC,stat1); |
817 TheFs.NotifyDiskSpace(freeD-8192,RemovableDrive,stat2); |
816 TheFs.NotifyDiskSpace(freeD-8192,RemovableDrive,stat2); |
818 test(stat1==KRequestPending && stat2==KRequestPending); |
817 test(stat1==KRequestPending && stat2==KRequestPending); |
819 r=TheFs.ScanDrive(RemovableDriveBuf); |
818 r=TheFs.ScanDrive(RemovableDriveBuf); |
820 test_KErrNone(r); |
819 test(r==KErrNone); |
821 User::After(1000000); |
820 User::After(1000000); |
822 User::WaitForRequest(stat2); |
821 User::WaitForRequest(stat2); |
823 test(stat1==KRequestPending && stat2==KErrNone); |
822 test(stat1==KRequestPending && stat2==KErrNone); |
824 TheFs.NotifyDiskSpaceCancel(stat1); |
823 TheFs.NotifyDiskSpaceCancel(stat1); |
825 test(stat1==KErrCancel); |
824 test(stat1==KErrCancel); |
826 |
825 |
827 file.Close(); |
826 file.Close(); |
828 r=TheFs.Delete(fileName); |
827 r=TheFs.Delete(fileName); |
829 test_KErrNone(r); |
828 test(r==KErrNone); |
830 if(gSessionPath[0]!=(TText)'C') |
829 if(gSessionPath[0]!=(TText)'C') |
831 { |
830 { |
832 r=TheFs.RmDir(defaultDir); |
831 r=TheFs.RmDir(defaultDir); |
833 test_Value(r, r == KErrNone||r==KErrInUse); |
832 test(r==KErrNone||r==KErrInUse); |
834 } |
833 } |
835 |
834 |
836 } |
835 } |
837 |
836 |
838 void TestFunctions() |
837 void TestFunctions() |
844 { |
843 { |
845 test.Next(_L("test disk space functions")); |
844 test.Next(_L("test disk space functions")); |
846 // create the filler file |
845 // create the filler file |
847 RFile file; |
846 RFile file; |
848 TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
847 TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
849 test_KErrNone(r); |
848 test(r==KErrNone); |
850 TInt64 newSpace = FreeDiskSpace(KDefaultDrive)-8192; |
849 TInt64 newSpace = FreeDiskSpace(KDefaultDrive)-8192; |
851 FillDisk(file,newSpace,KDefaultDrive); |
850 FillDisk(file,newSpace,KDefaultDrive); |
852 |
851 |
853 // check file write |
852 // check file write |
854 test.Next(_L("check RFile:Write")); |
853 test.Next(_L("check RFile:Write")); |
859 TInt64 threshold=free-200; |
858 TInt64 threshold=free-200; |
860 TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
859 TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
861 test(stat1==KRequestPending); |
860 test(stat1==KRequestPending); |
862 RThread thread; |
861 RThread thread; |
863 r=thread.Create(_L("thread1"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
862 r=thread.Create(_L("thread1"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
864 test_KErrNone(r); |
863 test(r==KErrNone); |
865 thread.Resume(); |
864 thread.Resume(); |
866 User::WaitForRequest(stat1); |
865 User::WaitForRequest(stat1); |
867 test(stat1==KErrNone); |
866 test(stat1==KErrNone); |
868 free=FreeDiskSpace(KDefaultDrive); |
867 free=FreeDiskSpace(KDefaultDrive); |
869 test(free<threshold); |
868 test(free<threshold); |
884 free=FreeDiskSpace(KDefaultDrive); |
883 free=FreeDiskSpace(KDefaultDrive); |
885 threshold=free-100; |
884 threshold=free-100; |
886 TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
885 TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
887 test(stat1==KRequestPending); |
886 test(stat1==KRequestPending); |
888 r=thread.Create(_L("thread2"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
887 r=thread.Create(_L("thread2"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
889 test_KErrNone(r); |
888 test(r==KErrNone); |
890 TRequestStatus deathStat; |
889 TRequestStatus deathStat; |
891 thread.Logon( deathStat ); |
890 thread.Logon( deathStat ); |
892 thread.Resume(); |
891 thread.Resume(); |
893 User::WaitForRequest(stat1); |
892 User::WaitForRequest(stat1); |
894 test(stat1==KErrNone); |
893 test(stat1==KErrNone); |
910 free=FreeDiskSpace(KDefaultDrive); |
909 free=FreeDiskSpace(KDefaultDrive); |
911 threshold=free+100; |
910 threshold=free+100; |
912 TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
911 TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
913 test(stat1==KRequestPending); |
912 test(stat1==KRequestPending); |
914 r=thread.Create(_L("thread3"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
913 r=thread.Create(_L("thread3"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
915 test_KErrNone(r); |
914 test(r==KErrNone); |
916 thread.Logon( deathStat ); |
915 thread.Logon( deathStat ); |
917 thread.Resume(); |
916 thread.Resume(); |
918 |
917 |
919 User::After(1000000); |
918 User::After(1000000); |
920 |
919 |
943 free=FreeDiskSpace(KDefaultDrive); |
942 free=FreeDiskSpace(KDefaultDrive); |
944 threshold=free+300; |
943 threshold=free+300; |
945 TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
944 TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
946 test(stat1==KRequestPending); |
945 test(stat1==KRequestPending); |
947 r=thread.Create(_L("thread4"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
946 r=thread.Create(_L("thread4"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
948 test_KErrNone(r); |
947 test(r==KErrNone); |
949 thread.Logon( deathStat ); |
948 thread.Logon( deathStat ); |
950 thread.Resume(); |
949 thread.Resume(); |
951 User::WaitForRequest(stat1); |
950 User::WaitForRequest(stat1); |
952 test(stat1==KErrNone); |
951 test(stat1==KErrNone); |
953 free=FreeDiskSpace(KDefaultDrive); |
952 free=FreeDiskSpace(KDefaultDrive); |
979 |
978 |
980 TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
979 TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
981 test(stat1==KRequestPending); |
980 test(stat1==KRequestPending); |
982 |
981 |
983 r=thread.Create(_L("thread5"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
982 r=thread.Create(_L("thread5"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
984 test_KErrNone(r); |
983 test(r==KErrNone); |
985 thread.Logon( deathStat ); |
984 thread.Logon( deathStat ); |
986 thread.Resume(); |
985 thread.Resume(); |
987 |
986 |
988 User::After(1000000); |
987 User::After(1000000); |
989 test(stat1==KRequestPending); |
988 test(stat1==KRequestPending); |
1003 free=FreeDiskSpace(KDefaultDrive); |
1002 free=FreeDiskSpace(KDefaultDrive); |
1004 threshold=free+200; |
1003 threshold=free+200; |
1005 TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
1004 TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
1006 test(stat1==KRequestPending); |
1005 test(stat1==KRequestPending); |
1007 r=thread.Create(_L("thread6"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1006 r=thread.Create(_L("thread6"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1008 test_KErrNone(r); |
1007 test(r==KErrNone); |
1009 thread.Logon( deathStat ); |
1008 thread.Logon( deathStat ); |
1010 thread.Resume(); |
1009 thread.Resume(); |
1011 User::WaitForRequest(stat1); |
1010 User::WaitForRequest(stat1); |
1012 //User::After(1000000); |
1011 //User::After(1000000); |
1013 test(stat1==KErrNone); |
1012 test(stat1==KErrNone); |
1032 _LIT(someFile,"X:\\abcdef"); |
1031 _LIT(someFile,"X:\\abcdef"); |
1033 #else |
1032 #else |
1034 TBuf<10> someFile=_L("?:\\abcdef"); |
1033 TBuf<10> someFile=_L("?:\\abcdef"); |
1035 TChar c; |
1034 TChar c; |
1036 TInt r=RFs::DriveToChar(RemovableDrive,c); |
1035 TInt r=RFs::DriveToChar(RemovableDrive,c); |
1037 test_KErrNone(r); |
1036 test(r==KErrNone); |
1038 someFile[0]=(TText)c; |
1037 someFile[0]=(TText)c; |
1039 #endif |
1038 #endif |
1040 _LIT(someDir,"C:\\1234\\"); |
1039 _LIT(someDir,"C:\\1234\\"); |
1041 |
1040 |
1042 r=f2.Create(TheFs,someFile,EFileShareAny|EFileWrite); |
1041 r=f2.Create(TheFs,someFile,EFileShareAny|EFileWrite); |
1043 test_KErrNone(r); |
1042 test(r==KErrNone); |
1044 r=TheFs.MkDir(someDir); |
1043 r=TheFs.MkDir(someDir); |
1045 test_KErrNone(r); |
1044 test(r==KErrNone); |
1046 TRequestStatus stat2; |
1045 TRequestStatus stat2; |
1047 TInt64 freeC=FreeDiskSpace(EDriveC); |
1046 TInt64 freeC=FreeDiskSpace(EDriveC); |
1048 TInt64 freeD=FreeDiskSpace(RemovableDrive); |
1047 TInt64 freeD=FreeDiskSpace(RemovableDrive); |
1049 TheFs.NotifyDiskSpace(freeC-4097,EDriveC,stat1); |
1048 TheFs.NotifyDiskSpace(freeC-4097,EDriveC,stat1); |
1050 TheFs.NotifyDiskSpace(freeD-4097,RemovableDrive,stat2); |
1049 TheFs.NotifyDiskSpace(freeD-4097,RemovableDrive,stat2); |
1051 test(stat1==KRequestPending && stat2==KRequestPending); |
1050 test(stat1==KRequestPending && stat2==KRequestPending); |
1052 // before fix this would result in iTheDrive not being updated in next subsession call |
1051 // before fix this would result in iTheDrive not being updated in next subsession call |
1053 // therefore this could would not result in a disk space notification |
1052 // therefore this could would not result in a disk space notification |
1054 r=f2.SetSize(8192); |
1053 r=f2.SetSize(8192); |
1055 test_KErrNone(r); |
1054 test(r==KErrNone); |
1056 User::After(1000000); |
1055 User::After(1000000); |
1057 User::WaitForRequest(stat2); |
1056 User::WaitForRequest(stat2); |
1058 |
1057 |
1059 if (stat2!=KErrNone) |
1058 if (stat2!=KErrNone) |
1060 test.Printf(_L("stat2=%d\n"),stat2.Int()); |
1059 test.Printf(_L("stat2=%d\n"),stat2.Int()); |
1088 { |
1087 { |
1089 test.Next(_L("test LFFS disk space functions")); |
1088 test.Next(_L("test LFFS disk space functions")); |
1090 // create the filler file |
1089 // create the filler file |
1091 RFile file; |
1090 RFile file; |
1092 TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
1091 TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
1093 test_KErrNone(r); |
1092 test(r==KErrNone); |
1094 TInt64 newSpace = FreeDiskSpace(KDefaultDrive)-8192; |
1093 TInt64 newSpace = FreeDiskSpace(KDefaultDrive)-8192; |
1095 FillDisk(file,newSpace,KDefaultDrive); |
1094 FillDisk(file,newSpace,KDefaultDrive); |
1096 |
1095 |
1097 |
1096 |
1098 // check file create |
1097 // check file create |
1107 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1106 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1108 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1107 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1109 test(stat1==KRequestPending && stat2==KRequestPending); |
1108 test(stat1==KRequestPending && stat2==KRequestPending); |
1110 RThread thread; |
1109 RThread thread; |
1111 r=thread.Create(_L("thread7"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1110 r=thread.Create(_L("thread7"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1112 test_KErrNone(r); |
1111 test(r==KErrNone); |
1113 TRequestStatus deathStat; |
1112 TRequestStatus deathStat; |
1114 thread.Logon( deathStat ); |
1113 thread.Logon( deathStat ); |
1115 thread.Resume(); |
1114 thread.Resume(); |
1116 User::WaitForRequest(stat1); |
1115 User::WaitForRequest(stat1); |
1117 test(stat1==KErrNone); |
1116 test(stat1==KErrNone); |
1142 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1141 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1143 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1142 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1144 TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
1143 TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
1145 test(stat1==KRequestPending && stat2==KRequestPending && stat3==KRequestPending); |
1144 test(stat1==KRequestPending && stat2==KRequestPending && stat3==KRequestPending); |
1146 r=thread.Create(_L("thread8"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1145 r=thread.Create(_L("thread8"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1147 test_KErrNone(r); |
1146 test(r==KErrNone); |
1148 thread.Logon( deathStat ); |
1147 thread.Logon( deathStat ); |
1149 thread.SetPriority( EPriorityLess ); |
1148 thread.SetPriority( EPriorityLess ); |
1150 thread.Resume(); // start spinning, blocks background thread |
1149 thread.Resume(); // start spinning, blocks background thread |
1151 // request background thread to notify a daft value |
1150 // request background thread to notify a daft value |
1152 TPckgBuf<TInt64> cBuf; |
1151 TPckgBuf<TInt64> cBuf; |
1157 #define ECioBackgroundNotifyDiskSize 10016 |
1156 #define ECioBackgroundNotifyDiskSize 10016 |
1158 r = TheFs.ControlIo(GetDriveLFFS(), ECioBackgroundNotifyDiskSize, cBuf); |
1157 r = TheFs.ControlIo(GetDriveLFFS(), ECioBackgroundNotifyDiskSize, cBuf); |
1159 test( KErrNone==r ); |
1158 test( KErrNone==r ); |
1160 // create a file to force some roll-forward |
1159 // create a file to force some roll-forward |
1161 r=file2.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
1160 r=file2.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
1162 test_KErrNone(r); |
1161 test(r==KErrNone); |
1163 User::WaitForRequest(stat1); |
1162 User::WaitForRequest(stat1); |
1164 test(stat1==KErrNone); |
1163 test(stat1==KErrNone); |
1165 test(stat2==KRequestPending); |
1164 test(stat2==KRequestPending); |
1166 test(stat3==KRequestPending); |
1165 test(stat3==KRequestPending); |
1167 // kill the spinner thread to allow the background thread to execute |
1166 // kill the spinner thread to allow the background thread to execute |
1192 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1191 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1193 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1192 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1194 TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
1193 TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
1195 test(stat1==KRequestPending && stat2==KRequestPending && stat3==KRequestPending); |
1194 test(stat1==KRequestPending && stat2==KRequestPending && stat3==KRequestPending); |
1196 r=thread.Create(_L("thread9"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1195 r=thread.Create(_L("thread9"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1197 test_KErrNone(r); |
1196 test(r==KErrNone); |
1198 thread.Logon( deathStat ); |
1197 thread.Logon( deathStat ); |
1199 thread.SetPriority( EPriorityLess ); |
1198 thread.SetPriority( EPriorityLess ); |
1200 thread.Resume(); // start spinning, blocks background thread |
1199 thread.Resume(); // start spinning, blocks background thread |
1201 // create a file to force some roll-forward |
1200 // create a file to force some roll-forward |
1202 r=file2.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
1201 r=file2.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
1203 test_KErrNone(r); |
1202 test(r==KErrNone); |
1204 User::WaitForRequest(stat1); |
1203 User::WaitForRequest(stat1); |
1205 test(stat1==KErrNone); |
1204 test(stat1==KErrNone); |
1206 test(stat2==KRequestPending); |
1205 test(stat2==KRequestPending); |
1207 test(stat3==KRequestPending); |
1206 test(stat3==KRequestPending); |
1208 // kill the spinner thread to allow the background thread to execute |
1207 // kill the spinner thread to allow the background thread to execute |
1235 // |
1234 // |
1236 { |
1235 { |
1237 // create the filler file |
1236 // create the filler file |
1238 RFile file; |
1237 RFile file; |
1239 TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
1238 TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
1240 test_KErrNone(r); |
1239 test(r==KErrNone); |
1241 TInt64 free=FreeDiskSpace(KDefaultDrive); |
1240 TInt64 free=FreeDiskSpace(KDefaultDrive); |
1242 TInt64 freeSpaceLeft = gMinFileSize << 4; // 512 * 2^4 = 512 * 16 = 8K |
1241 TInt64 freeSpaceLeft = gMinFileSize << 4; // 512 * 2^4 = 512 * 16 = 8K |
1243 FillDisk(file,free-freeSpaceLeft,KDefaultDrive); |
1242 FillDisk(file,free-freeSpaceLeft,KDefaultDrive); |
1244 TInt size; |
1243 TInt size; |
1245 r=file.Size(size); |
1244 r=file.Size(size); |
1246 test_KErrNone(r); |
1245 test(r==KErrNone); |
1247 test(size>1024); |
1246 test(size>1024); |
1248 test.Printf(_L("filler file size=0x%x\n"),size); |
1247 test.Printf(_L("filler file size=0x%x\n"),size); |
1249 |
1248 |
1250 // test multiple requests |
1249 // test multiple requests |
1251 test.Next(_L("test multiple requests")); |
1250 test.Next(_L("test multiple requests")); |
1264 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1263 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1265 TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
1264 TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
1266 test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
1265 test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
1267 RThread thread; |
1266 RThread thread; |
1268 r=thread.Create(_L("thread1"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1267 r=thread.Create(_L("thread1"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1269 test_KErrNone(r); |
1268 test(r==KErrNone); |
1270 TRequestStatus deathStat; |
1269 TRequestStatus deathStat; |
1271 thread.Logon( deathStat ); |
1270 thread.Logon( deathStat ); |
1272 thread.Resume(); |
1271 thread.Resume(); |
1273 User::After(1000000); |
1272 User::After(1000000); |
1274 User::WaitForRequest(stat1); |
1273 User::WaitForRequest(stat1); |
1301 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1300 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1302 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1301 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1303 TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
1302 TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
1304 test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
1303 test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
1305 r=thread.Create(_L("thread2"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1304 r=thread.Create(_L("thread2"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1306 test_KErrNone(r); |
1305 test(r==KErrNone); |
1307 thread.Logon( deathStat ); |
1306 thread.Logon( deathStat ); |
1308 thread.Resume(); |
1307 thread.Resume(); |
1309 User::After(10000); |
1308 User::After(10000); |
1310 User::WaitForRequest(stat3); |
1309 User::WaitForRequest(stat3); |
1311 test(stat3==KErrNone && stat1==KRequestPending && stat2==KRequestPending); |
1310 test(stat3==KErrNone && stat1==KRequestPending && stat2==KRequestPending); |
1338 |
1337 |
1339 // test multiple sessions all notified on disk space change |
1338 // test multiple sessions all notified on disk space change |
1340 test.Next(_L("test multiple sessions on same drive")); |
1339 test.Next(_L("test multiple sessions on same drive")); |
1341 RFs ses2,ses3; |
1340 RFs ses2,ses3; |
1342 r=ses2.Connect(); |
1341 r=ses2.Connect(); |
1343 test_KErrNone(r); |
1342 test(r==KErrNone); |
1344 r=ses3.Connect(); |
1343 r=ses3.Connect(); |
1345 test_KErrNone(r); |
1344 test(r==KErrNone); |
1346 r=ses2.SetSessionPath(gSessionPath); |
1345 r=ses2.SetSessionPath(gSessionPath); |
1347 test_KErrNone(r); |
1346 test(r==KErrNone); |
1348 r=ses3.SetSessionPath(gSessionPath); |
1347 r=ses3.SetSessionPath(gSessionPath); |
1349 test_KErrNone(r); |
1348 test(r==KErrNone); |
1350 task=ETaskFileReplace; |
1349 task=ETaskFileReplace; |
1351 InitialiseForThread(task); |
1350 InitialiseForThread(task); |
1352 free=FreeDiskSpace(KDefaultDrive); |
1351 free=FreeDiskSpace(KDefaultDrive); |
1353 test.Printf(_L("free space on default drive = 0x%x\n"),free); |
1352 test.Printf(_L("free space on default drive = 0x%x\n"),free); |
1354 threshold1=free+gMinFileSize; // 512 |
1353 threshold1=free+gMinFileSize; // 512 |
1357 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1356 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1358 ses2.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1357 ses2.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1359 ses3.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
1358 ses3.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
1360 test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
1359 test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
1361 r=thread.Create(_L("thread3"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1360 r=thread.Create(_L("thread3"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1362 test_KErrNone(r); |
1361 test(r==KErrNone); |
1363 thread.Logon( deathStat ); |
1362 thread.Logon( deathStat ); |
1364 thread.Resume(); |
1363 thread.Resume(); |
1365 User::After(1000000); |
1364 User::After(1000000); |
1366 User::WaitForRequest(stat1); |
1365 User::WaitForRequest(stat1); |
1367 User::WaitForRequest(stat2); |
1366 User::WaitForRequest(stat2); |
1389 |
1388 |
1390 if( !LffsDrive ) |
1389 if( !LffsDrive ) |
1391 { |
1390 { |
1392 TInt sessionDrive; |
1391 TInt sessionDrive; |
1393 r=RFs::CharToDrive(gSessionPath[0],sessionDrive); |
1392 r=RFs::CharToDrive(gSessionPath[0],sessionDrive); |
1394 test_KErrNone(r); |
1393 test(r==KErrNone); |
1395 if(sessionDrive!=RemovableDrive) |
1394 if(sessionDrive!=RemovableDrive) |
1396 { |
1395 { |
1397 // first create a file on the removable drive |
1396 // first create a file on the removable drive |
1398 RFile file2; |
1397 RFile file2; |
1399 TFileName file2name=RemovableDriveBuf; |
1398 TFileName file2name=RemovableDriveBuf; |
1400 file2name+=_L("F32-TST\\testfile1"); |
1399 file2name+=_L("F32-TST\\testfile1"); |
1401 TheFs.Delete(file2name); |
1400 TheFs.Delete(file2name); |
1402 r=file2.Create(TheFs,file2name,EFileShareAny|EFileWrite); |
1401 r=file2.Create(TheFs,file2name,EFileShareAny|EFileWrite); |
1403 test_KErrNone(r); |
1402 test(r==KErrNone); |
1404 r=file2.SetSize(KFileSize3); |
1403 r=file2.SetSize(KFileSize3); |
1405 test_KErrNone(r); |
1404 test(r==KErrNone); |
1406 // test multiple sessions not notified on disk space change on wrong drive |
1405 // test multiple sessions not notified on disk space change on wrong drive |
1407 test.Next(_L("test multiple sessions on different drives")); |
1406 test.Next(_L("test multiple sessions on different drives")); |
1408 task=ETaskFileReplace; |
1407 task=ETaskFileReplace; |
1409 InitialiseForThread(task); |
1408 InitialiseForThread(task); |
1410 TInt64 freeDef=FreeDiskSpace(KDefaultDrive); |
1409 TInt64 freeDef=FreeDiskSpace(KDefaultDrive); |
1413 threshold2=freeRem + (gMinFileSize << 1); // 1024; |
1412 threshold2=freeRem + (gMinFileSize << 1); // 1024; |
1414 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1413 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1415 ses2.NotifyDiskSpace(threshold2,RemovableDrive,stat2); |
1414 ses2.NotifyDiskSpace(threshold2,RemovableDrive,stat2); |
1416 test(stat1==KRequestPending&&stat2==KRequestPending); |
1415 test(stat1==KRequestPending&&stat2==KRequestPending); |
1417 r=thread.Create(_L("thread4"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1416 r=thread.Create(_L("thread4"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1418 test_KErrNone(r); |
1417 test(r==KErrNone); |
1419 thread.Logon( deathStat ); |
1418 thread.Logon( deathStat ); |
1420 thread.Resume(); |
1419 thread.Resume(); |
1421 User::After(1000000); |
1420 User::After(1000000); |
1422 User::WaitForRequest(stat1); |
1421 User::WaitForRequest(stat1); |
1423 test(stat1==KErrNone && stat2==KRequestPending); |
1422 test(stat1==KErrNone && stat2==KRequestPending); |
1453 // |
1452 // |
1454 { |
1453 { |
1455 // create the filler file |
1454 // create the filler file |
1456 RFile file; |
1455 RFile file; |
1457 TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
1456 TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
1458 test_KErrNone(r); |
1457 test(r==KErrNone); |
1459 TInt64 free=FreeDiskSpace(KDefaultDrive); |
1458 TInt64 free=FreeDiskSpace(KDefaultDrive); |
1460 FillDisk(file,free-8192,KDefaultDrive); |
1459 FillDisk(file,free-8192,KDefaultDrive); |
1461 TInt size; |
1460 TInt size; |
1462 r=file.Size(size); |
1461 r=file.Size(size); |
1463 test_KErrNone(r); |
1462 test(r==KErrNone); |
1464 test.Printf(_L("filler file size=0x%x\n"),size); |
1463 test.Printf(_L("filler file size=0x%x\n"),size); |
1465 |
1464 |
1466 |
1465 |
1467 // test multiple requests again |
1466 // test multiple requests again |
1468 test.Next(_L("test multiple requests on LFFS") ); |
1467 test.Next(_L("test multiple requests on LFFS") ); |
1479 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1478 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1480 TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
1479 TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
1481 test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
1480 test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
1482 RThread thread; |
1481 RThread thread; |
1483 r=thread.Create(_L("thread10"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1482 r=thread.Create(_L("thread10"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1484 test_KErrNone(r); |
1483 test(r==KErrNone); |
1485 TRequestStatus deathStat; |
1484 TRequestStatus deathStat; |
1486 thread.Logon( deathStat ); |
1485 thread.Logon( deathStat ); |
1487 // test.Printf(_L("Resuming other thread")); |
1486 // test.Printf(_L("Resuming other thread")); |
1488 thread.Resume(); |
1487 thread.Resume(); |
1489 User::After(10000); |
1488 User::After(10000); |
1510 |
1509 |
1511 |
1510 |
1512 |
1511 |
1513 TInt sessionDrive; |
1512 TInt sessionDrive; |
1514 r=RFs::CharToDrive(gSessionPath[0],sessionDrive); |
1513 r=RFs::CharToDrive(gSessionPath[0],sessionDrive); |
1515 test_KErrNone(r); |
1514 test(r==KErrNone); |
1516 if(sessionDrive!=EDriveC) |
1515 if(sessionDrive!=EDriveC) |
1517 { |
1516 { |
1518 // test multiple sessions not notified on disk space change on wrong drive |
1517 // test multiple sessions not notified on disk space change on wrong drive |
1519 test.Next(_L("test multiple sessions on different drives")); |
1518 test.Next(_L("test multiple sessions on different drives")); |
1520 |
1519 |
1521 RFs ses2,ses3; |
1520 RFs ses2,ses3; |
1522 r=ses2.Connect(); |
1521 r=ses2.Connect(); |
1523 test_KErrNone(r); |
1522 test(r==KErrNone); |
1524 r=ses3.Connect(); |
1523 r=ses3.Connect(); |
1525 test_KErrNone(r); |
1524 test(r==KErrNone); |
1526 r=ses2.SetSessionPath(gSessionPath); |
1525 r=ses2.SetSessionPath(gSessionPath); |
1527 test_KErrNone(r); |
1526 test(r==KErrNone); |
1528 r=ses3.SetSessionPath(gSessionPath); |
1527 r=ses3.SetSessionPath(gSessionPath); |
1529 test_KErrNone(r); |
1528 test(r==KErrNone); |
1530 |
1529 |
1531 // first create a file on the C:\ drive |
1530 // first create a file on the C:\ drive |
1532 RFile file2; |
1531 RFile file2; |
1533 TFileName file2name=_L("C:\\"); |
1532 TFileName file2name=_L("C:\\"); |
1534 file2name+=_L("F32-TST\\"); |
1533 file2name+=_L("F32-TST\\"); |
1535 r=TheFs.MkDir(file2name); |
1534 r=TheFs.MkDir(file2name); |
1536 test( KErrNone==r || KErrAlreadyExists==r ); |
1535 test( KErrNone==r || KErrAlreadyExists==r ); |
1537 file2name+=_L("testfile1"); |
1536 file2name+=_L("testfile1"); |
1538 TheFs.Delete(file2name); |
1537 TheFs.Delete(file2name); |
1539 r=file2.Create(TheFs,file2name,EFileShareAny|EFileWrite); |
1538 r=file2.Create(TheFs,file2name,EFileShareAny|EFileWrite); |
1540 test_KErrNone(r); |
1539 test(r==KErrNone); |
1541 WriteToFile( file2, KFileSize3 ); |
1540 WriteToFile( file2, KFileSize3 ); |
1542 |
1541 |
1543 task=ETaskFileReplace; |
1542 task=ETaskFileReplace; |
1544 InitialiseForThread(task); |
1543 InitialiseForThread(task); |
1545 TInt64 freeLffs=FreeDiskSpace(KDefaultDrive); |
1544 TInt64 freeLffs=FreeDiskSpace(KDefaultDrive); |
1548 threshold2=freeD+1024; |
1547 threshold2=freeD+1024; |
1549 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1548 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1550 ses2.NotifyDiskSpace(threshold2,EDriveC,stat2); |
1549 ses2.NotifyDiskSpace(threshold2,EDriveC,stat2); |
1551 test(stat1==KRequestPending&&stat2==KRequestPending); |
1550 test(stat1==KRequestPending&&stat2==KRequestPending); |
1552 r=thread.Create(_L("thread11"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1551 r=thread.Create(_L("thread11"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1553 test_KErrNone(r); |
1552 test(r==KErrNone); |
1554 thread.Logon( deathStat ); |
1553 thread.Logon( deathStat ); |
1555 thread.Resume(); |
1554 thread.Resume(); |
1556 User::After(1000000); |
1555 User::After(1000000); |
1557 User::WaitForRequest(stat1); |
1556 User::WaitForRequest(stat1); |
1558 test(stat1==KErrNone && stat2==KRequestPending); |
1557 test(stat1==KErrNone && stat2==KRequestPending); |
1588 // |
1587 // |
1589 { |
1588 { |
1590 // create a filler file |
1589 // create a filler file |
1591 RFile file; |
1590 RFile file; |
1592 TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
1591 TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
1593 test_KErrNone(r); |
1592 test(r==KErrNone); |
1594 TInt64 free=FreeDiskSpace(KDefaultDrive); |
1593 TInt64 free=FreeDiskSpace(KDefaultDrive); |
1595 // use 8KB in filler file |
1594 // use 8KB in filler file |
1596 FillDisk(file,free-8192,KDefaultDrive); |
1595 FillDisk(file,free-8192,KDefaultDrive); |
1597 |
1596 |
1598 // test change notification when no disk space change |
1597 // test change notification when no disk space change |
1607 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1606 TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
1608 TheFs.NotifyChange(ENotifyAll,stat3); |
1607 TheFs.NotifyChange(ENotifyAll,stat3); |
1609 test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
1608 test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
1610 RThread thread; |
1609 RThread thread; |
1611 r=thread.Create(_L("thread1"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1610 r=thread.Create(_L("thread1"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1612 test_KErrNone(r); |
1611 test(r==KErrNone); |
1613 TRequestStatus deathStat; |
1612 TRequestStatus deathStat; |
1614 thread.Logon( deathStat ); |
1613 thread.Logon( deathStat ); |
1615 thread.Resume(); |
1614 thread.Resume(); |
1616 User::After(1000000); |
1615 User::After(1000000); |
1617 User::WaitForRequest(stat3); |
1616 User::WaitForRequest(stat3); |
1634 // do an operation that will cause the change notification |
1633 // do an operation that will cause the change notification |
1635 // and disk change notification to be signalled |
1634 // and disk change notification to be signalled |
1636 test.Next(_L(" test change notification and disk space notification")); |
1635 test.Next(_L(" test change notification and disk space notification")); |
1637 RFs session2,session3; |
1636 RFs session2,session3; |
1638 r=session2.Connect(); |
1637 r=session2.Connect(); |
1639 test_KErrNone(r); |
1638 test(r==KErrNone); |
1640 r=session3.Connect(); |
1639 r=session3.Connect(); |
1641 test_KErrNone(r); |
1640 test(r==KErrNone); |
1642 r=session2.SetSessionPath(gSessionPath); |
1641 r=session2.SetSessionPath(gSessionPath); |
1643 test_KErrNone(r); |
1642 test(r==KErrNone); |
1644 r=session3.SetSessionPath(gSessionPath); |
1643 r=session3.SetSessionPath(gSessionPath); |
1645 test_KErrNone(r); |
1644 test(r==KErrNone); |
1646 task=ETaskFileWrite; |
1645 task=ETaskFileWrite; |
1647 InitialiseForThread(task); |
1646 InitialiseForThread(task); |
1648 free=FreeDiskSpace(KDefaultDrive); |
1647 free=FreeDiskSpace(KDefaultDrive); |
1649 threshold1=free-400; |
1648 threshold1=free-400; |
1650 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1649 TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
1651 session2.NotifyChange(ENotifyAll,stat2); |
1650 session2.NotifyChange(ENotifyAll,stat2); |
1652 session3.NotifyChange(ENotifyAll,stat3,KTestFile1); |
1651 session3.NotifyChange(ENotifyAll,stat3,KTestFile1); |
1653 test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
1652 test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
1654 r=thread.Create(_L("thread2"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1653 r=thread.Create(_L("thread2"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
1655 test_KErrNone(r); |
1654 test(r==KErrNone); |
1656 thread.Logon( deathStat ); |
1655 thread.Logon( deathStat ); |
1657 thread.Resume(); |
1656 thread.Resume(); |
1658 User::After(1000000); |
1657 User::After(1000000); |
1659 User::WaitForRequest(stat1); |
1658 User::WaitForRequest(stat1); |
1660 User::WaitForRequest(stat2); |
1659 User::WaitForRequest(stat2); |
1707 |
1706 |
1708 _LIT(KPreModifierPluginFileName,"premodifier_plugin"); |
1707 _LIT(KPreModifierPluginFileName,"premodifier_plugin"); |
1709 _LIT(KPreModifierPluginName,"PreModifierPlugin"); |
1708 _LIT(KPreModifierPluginName,"PreModifierPlugin"); |
1710 const TUint KTestFileSize = KKilo * 100; |
1709 const TUint KTestFileSize = KKilo * 100; |
1711 |
1710 |
1712 #define SAFETEST_KErrNone(a) if(a != KErrNone)\ |
1711 #define SAFETEST(a) if(a != KErrNone)\ |
1713 {\ |
1712 {\ |
1714 TheFs.DismountPlugin(KPreModifierPluginName);\ |
1713 TheFs.DismountPlugin(KPreModifierPluginName);\ |
1715 TheFs.RemovePlugin(KPreModifierPluginName);\ |
1714 TheFs.RemovePlugin(KPreModifierPluginName);\ |
1716 test_KErrNone(a);\ |
1715 test(a == KErrNone);\ |
1717 } |
1716 } |
1718 |
1717 |
1719 TInt PluginTestThreadFunction(TAny*) |
1718 TInt PluginTestThreadFunction(TAny*) |
1720 { |
1719 { |
1721 RTest test(_L("PluginTestThreadFunction")); |
1720 RTest test(_L("PluginTestThreadFunction")); |
1722 RFs fs; |
1721 RFs fs; |
1723 fs.Connect(); |
1722 fs.Connect(); |
1724 |
1723 |
1725 TInt r = fs.SetSessionPath(gSessionPath); |
1724 TInt r = fs.SetSessionPath(gSessionPath); |
1726 test_KErrNone(r); |
1725 test(r == KErrNone); |
1727 |
1726 |
1728 RFile file; |
1727 RFile file; |
1729 r = file.Create(fs, KTestFile1, EFileShareAny|EFileWrite); |
1728 r = file.Create(fs, KTestFile1, EFileShareAny|EFileWrite); |
1730 test_KErrNone(r); |
1729 test(r == KErrNone); |
1731 r = file.SetSize(KTestFileSize); |
1730 r = file.SetSize(KTestFileSize); |
1732 test_KErrNone(r); |
1731 test(r == KErrNone); |
1733 file.Close(); |
1732 file.Close(); |
1734 |
1733 |
1735 User::After(5000000); // wait for 5 seconds, to ensure first notification received. |
1734 User::After(5000000); // wait for 5 seconds, to ensure first notification received. |
1736 |
1735 |
1737 r = fs.Delete(KTestFile1); |
1736 r = fs.Delete(KTestFile1); |
1738 test_KErrNone(r); |
1737 test(r == KErrNone); |
1739 |
1738 |
1740 fs.Close(); |
1739 fs.Close(); |
1741 return KErrNone; |
1740 return KErrNone; |
1742 } |
1741 } |
1743 |
1742 |
1745 { |
1744 { |
1746 test.Next(_L("Test Disk Space Notify With Plugin")); |
1745 test.Next(_L("Test Disk Space Notify With Plugin")); |
1747 |
1746 |
1748 TInt drive; |
1747 TInt drive; |
1749 TInt r = RFs::CharToDrive(gSessionPath[0],drive); |
1748 TInt r = RFs::CharToDrive(gSessionPath[0],drive); |
1750 SAFETEST_KErrNone(r); |
1749 SAFETEST(r); |
1751 Format(drive); |
1750 Format(drive); |
1752 |
1751 |
1753 r = TheFs.MkDirAll(gSessionPath); |
1752 r = TheFs.MkDirAll(gSessionPath); |
1754 SAFETEST_KErrNone(r); |
1753 SAFETEST(r); |
1755 |
1754 |
1756 r = TheFs.AddPlugin(KPreModifierPluginFileName); |
1755 r = TheFs.AddPlugin(KPreModifierPluginFileName); |
1757 SAFETEST_KErrNone(r); |
1756 SAFETEST(r); |
1758 |
1757 |
1759 r = TheFs.MountPlugin(KPreModifierPluginName); |
1758 r = TheFs.MountPlugin(KPreModifierPluginName); |
1760 SAFETEST_KErrNone(r); |
1759 SAFETEST(r); |
1761 |
1760 |
1762 TInt64 free = FreeDiskSpace(drive); |
1761 TInt64 free = FreeDiskSpace(drive); |
1763 TInt64 threshold = free - KTestFileSize + 1; |
1762 TInt64 threshold = free - KTestFileSize + 1; |
1764 |
1763 |
1765 TRequestStatus status; |
1764 TRequestStatus status; |
1767 |
1766 |
1768 TheFs.NotifyDiskSpace(threshold, drive, status); |
1767 TheFs.NotifyDiskSpace(threshold, drive, status); |
1769 |
1768 |
1770 RThread thread; |
1769 RThread thread; |
1771 r = thread.Create(_L("PluginTestThread"), PluginTestThreadFunction, KStackSize, KHeapSize, KHeapSize, NULL); |
1770 r = thread.Create(_L("PluginTestThread"), PluginTestThreadFunction, KStackSize, KHeapSize, KHeapSize, NULL); |
1772 SAFETEST_KErrNone(r); |
1771 SAFETEST(r); |
1773 thread.Logon(statusDeath); |
1772 thread.Logon(statusDeath); |
1774 thread.Resume(); |
1773 thread.Resume(); |
1775 |
1774 |
1776 User::WaitForRequest(status); |
1775 User::WaitForRequest(status); |
1777 SAFETEST_KErrNone(status.Int()); |
1776 SAFETEST(status.Int()); |
1778 |
1777 |
1779 TheFs.NotifyDiskSpace(threshold, drive, status); |
1778 TheFs.NotifyDiskSpace(threshold, drive, status); |
1780 User::WaitForRequest(status); |
1779 User::WaitForRequest(status); |
1781 SAFETEST_KErrNone(status.Int()); |
1780 SAFETEST(status.Int()); |
1782 |
1781 |
1783 User::WaitForRequest(statusDeath); |
1782 User::WaitForRequest(statusDeath); |
1784 SAFETEST_KErrNone(statusDeath.Int()); |
1783 SAFETEST(statusDeath.Int()); |
1785 thread.Close(); |
1784 thread.Close(); |
1786 |
1785 |
1787 r = TheFs.DismountPlugin(KPreModifierPluginName); |
1786 r = TheFs.DismountPlugin(KPreModifierPluginName); |
1788 SAFETEST_KErrNone(r); |
1787 SAFETEST(r); |
1789 |
1788 |
1790 r = TheFs.RemovePlugin(KPreModifierPluginName); |
1789 r = TheFs.RemovePlugin(KPreModifierPluginName); |
1791 SAFETEST_KErrNone(r); |
1790 SAFETEST(r); |
1792 |
1791 |
1793 Format(drive); |
1792 Format(drive); |
1794 } |
1793 } |
1795 |
1794 |
1796 GLDEF_C void CallTestsL() |
1795 GLDEF_C void CallTestsL() |