author | hgs |
Mon, 11 Oct 2010 19:11:06 +0100 | |
changeset 287 | ddfd5aa0d58f |
parent 269 | d57b86b1867a |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// f32test\server\t_dspace.cpp |
|
15 |
// |
|
16 |
// |
|
17 |
||
189 | 18 |
#define __E32TEST_EXTENSION__ |
0 | 19 |
#include <f32file.h> |
20 |
#include <e32test.h> |
|
21 |
#include "t_server.h" |
|
22 |
#include "t_chlffs.h" |
|
23 |
||
24 |
||
25 |
/* This tests disk space notification. Using RFs::NotifyDiskSpace a client can request |
|
26 |
to be notified if the free disk space crosses a specified threshold. This test requires |
|
27 |
a card to be present in d: */ |
|
28 |
||
29 |
GLDEF_D RTest test(_L("T_DSPACE")); |
|
30 |
||
31 |
const TInt KMaxBufSize=512; |
|
32 |
#if defined(__WINS__) |
|
33 |
TInt KFileSize1=2048; |
|
34 |
TInt KFileSize2=4096; |
|
35 |
TInt KFileSize3=8192; |
|
36 |
#else |
|
37 |
TInt KFileSize1=512; |
|
38 |
TInt KFileSize2=1024; |
|
39 |
TInt KFileSize3=4096; |
|
40 |
#endif |
|
41 |
||
42 |
const TInt KHeapSize=0x2000; |
|
43 |
const TInt KStackSize=0x4000; |
|
44 |
||
45 |
TInt gMinFileSize; |
|
46 |
||
47 |
TBool LffsDrive = EFalse; |
|
48 |
||
49 |
TBuf8<KMaxBufSize> TheBuffer; |
|
50 |
TInt64 TheDiskSize; |
|
51 |
TInt RemovableDrive; |
|
52 |
TBuf<4> RemovableDriveBuf=_L("?:\\"); |
|
53 |
||
54 |
_LIT(KTestFile1, "\\F32-TST\\testfile1"); |
|
55 |
_LIT(KTestFile2, "\\F32-TST\\testFile2"); |
|
56 |
_LIT(KTestDir1, "\\F32-TST\\testDir1\\"); |
|
57 |
_LIT(KTestDir2, "\\F32-TST\\testDir2\\"); |
|
58 |
_LIT(KFileFiller, "\\F32-TST\\fileFiller"); |
|
59 |
||
60 |
// functions that may cause change in free disk space |
|
61 |
// not all of them of tested since some require knowledge of file system |
|
62 |
// to ensure change in free disk space |
|
63 |
enum TThreadTask |
|
64 |
{ |
|
65 |
ETaskSetVolume, |
|
66 |
ETaskMkDir, |
|
67 |
ETaskRmDir, |
|
68 |
ETaskDelete, // test |
|
69 |
ETaskRename, |
|
70 |
ETaskReplace, // test |
|
71 |
ETaskFileCreate, |
|
72 |
ETaskFileReplace, // test |
|
73 |
ETaskFileTemp, |
|
74 |
ETaskFileWrite, // test |
|
75 |
ETaskFileWrite4KB, |
|
76 |
ETaskFileWrite64KB, |
|
77 |
ETaskFileSetSize, // test |
|
78 |
ETaskFileRename, |
|
79 |
ETaskNoChange1, |
|
80 |
ETaskNoChange2, |
|
81 |
ETaskFileCreateLffs,// test |
|
82 |
ETaskSpin |
|
83 |
}; |
|
84 |
||
85 |
||
86 |
LOCAL_C TBool IsWinsCDrive(TInt aDrive) |
|
87 |
// |
|
88 |
// |
|
89 |
// |
|
90 |
{ |
|
91 |
#if defined(__WINS__) |
|
92 |
if(aDrive==KDefaultDrive) |
|
93 |
return(gSessionPath[0]==(TText)'C'); |
|
94 |
else |
|
95 |
return(aDrive==EDriveC); |
|
96 |
#else |
|
97 |
return(EFalse); |
|
98 |
#endif |
|
99 |
} |
|
100 |
||
101 |
LOCAL_C TInt64 FreeDiskSpace(TInt aDrive) |
|
102 |
// |
|
103 |
// |
|
104 |
// |
|
105 |
{ |
|
106 |
TVolumeInfo v; |
|
107 |
TInt r=TheFs.Volume(v,aDrive); |
|
189 | 108 |
test_KErrNone(r); |
0 | 109 |
return(v.iFree); |
110 |
} |
|
111 |
||
112 |
LOCAL_C TInt64 DiskSize(TInt aDrive) |
|
113 |
// |
|
114 |
// |
|
115 |
// |
|
116 |
{ |
|
117 |
TVolumeInfo v; |
|
118 |
TInt r=TheFs.Volume(v,aDrive); |
|
189 | 119 |
test_KErrNone(r); |
0 | 120 |
return(v.iSize); |
121 |
} |
|
122 |
||
123 |
// MinimumFileSize() - |
|
124 |
// 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. |
|
126 |
// |
|
127 |
LOCAL_C TInt MinimumFileSize(TInt aDrive) |
|
128 |
{ |
|
129 |
TInt r = TheFs.Delete(KTestFile1); |
|
189 | 130 |
test_Value(r, r == KErrNone || r==KErrNotFound); |
0 | 131 |
|
132 |
TInt64 freeSpace = FreeDiskSpace(aDrive); |
|
133 |
||
134 |
RFile file; |
|
135 |
||
136 |
||
137 |
r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 138 |
test_KErrNone(r); |
0 | 139 |
|
140 |
r = file.Write(TheBuffer,1); |
|
189 | 141 |
test_KErrNone(r); |
0 | 142 |
file.Close(); |
143 |
TInt64 newSpace = FreeDiskSpace(aDrive); |
|
144 |
||
145 |
r = TheFs.Delete(KTestFile1); |
|
189 | 146 |
test_KErrNone(r); |
0 | 147 |
|
148 |
||
149 |
TInt64 minFileSize = freeSpace - newSpace; |
|
150 |
test (minFileSize >= 0); |
|
151 |
minFileSize = Max(minFileSize, 512); |
|
152 |
test (minFileSize < KMaxTInt); |
|
153 |
||
154 |
TInt minFileSizeLow = I64LOW(minFileSize); |
|
155 |
||
156 |
RDebug::Print(_L("minFileSize %u"), minFileSizeLow); |
|
157 |
||
158 |
#if defined(__WINS__) |
|
159 |
KFileSize1 = minFileSizeLow << 2; // 512 * 2^2 = 512 * 4 = 2048; |
|
160 |
KFileSize2 = minFileSizeLow << 3; // 512 * 2^3 = 512 * 8 = 4096; |
|
161 |
KFileSize3 = minFileSizeLow << 4; // 512 * 2^4 = 512 * 16 = 8192; |
|
162 |
#else |
|
163 |
KFileSize1 = minFileSizeLow; // 512; |
|
164 |
KFileSize2 = minFileSizeLow << 1; // 512 * 2^1 = 512 * 2 = 1024; |
|
165 |
KFileSize3 = minFileSizeLow << 3; // 512 * 2^3 = 512 * 8 = 4096; |
|
166 |
#endif |
|
167 |
||
168 |
||
169 |
return (TInt) minFileSizeLow; |
|
170 |
} |
|
171 |
||
172 |
LOCAL_C void Initialise() |
|
173 |
// |
|
174 |
// do any initialisation before starting tests |
|
175 |
// |
|
176 |
{ |
|
177 |
if(TheBuffer.Length()!=KMaxBufSize) |
|
178 |
{ |
|
179 |
TheBuffer.SetLength(KMaxBufSize); |
|
180 |
Mem::Fill((void*)TheBuffer.Ptr(),KMaxBufSize,0xab); |
|
181 |
} |
|
182 |
#if defined(__WINS__) |
|
183 |
RemovableDrive=EDriveX; |
|
184 |
#else |
|
185 |
TDriveList drvList; |
|
186 |
if(KErrNone == TheFs.DriveList(drvList)) |
|
187 |
{ |
|
188 |
TInt i; |
|
189 |
//should be successful, otherwise it means a system w/o any drive!!! |
|
190 |
for(i=0;i<KMaxDrives;i++) |
|
191 |
{ |
|
192 |
TDriveInfo driveInfo; |
|
193 |
if((drvList[i] != 0) |
|
194 |
&& (KErrNone == TheFs.Drive(driveInfo, i)) |
|
195 |
&& (driveInfo.iType == EMediaHardDisk)) |
|
196 |
{ |
|
197 |
RemovableDrive = i; |
|
198 |
test.Printf(_L("RemovableDrive = %d\n"),RemovableDrive); |
|
199 |
break; |
|
200 |
} |
|
201 |
} |
|
202 |
if(i == KMaxDrives) |
|
203 |
{ |
|
204 |
test.Printf(_L("No Removable media found! Testing discontinued.\n")); |
|
205 |
User::Exit(KErrNone); |
|
206 |
} |
|
207 |
} |
|
208 |
else |
|
209 |
{ |
|
210 |
test.Printf(_L("No Drive found! Testing discontinued.\n")); |
|
211 |
User::Exit(KErrNone); |
|
212 |
} |
|
213 |
#endif |
|
214 |
||
215 |
test.Printf(_L("inside init++++++++++++++++++++++++++>\n\n\n")); |
|
216 |
test.Printf(_L("RemovableDrive = %d\n"),RemovableDrive); |
|
217 |
// initialise removable drive descriptor |
|
218 |
TChar c; |
|
219 |
TInt r=RFs::DriveToChar(RemovableDrive,c); |
|
189 | 220 |
test_KErrNone(r); |
0 | 221 |
RemovableDriveBuf[0]=(TText)c; |
222 |
||
223 |
if( !LffsDrive ) |
|
224 |
{ |
|
225 |
// and create the default directory |
|
226 |
TFileName d=gSessionPath; |
|
227 |
d[0]=RemovableDriveBuf[0]; |
|
228 |
MakeDir(d); |
|
229 |
} |
|
230 |
||
231 |
// better format the default drive as long as not WINS c drive |
|
232 |
TInt drive; |
|
233 |
r= RFs::CharToDrive(gSessionPath[0],drive); |
|
189 | 234 |
test_KErrNone(r); |
0 | 235 |
#if defined(__WINS__) |
236 |
if(drive!=EDriveC) |
|
237 |
Format(drive); |
|
238 |
#else |
|
239 |
Format(drive); |
|
240 |
// test not run on c: drive but does use it |
|
241 |
Format(EDriveC); |
|
242 |
#endif |
|
33
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
243 |
TheDiskSize=DiskSize(KDefaultDrive); |
0 | 244 |
// and set the default directory |
245 |
r=TheFs.MkDirAll(gSessionPath); |
|
189 | 246 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 247 |
|
248 |
r=TheFs.Delete(KFileFiller); |
|
189 | 249 |
test_Value(r, r == KErrNone || r==KErrNotFound); |
0 | 250 |
r=TheFs.Delete(KTestFile1); |
189 | 251 |
test_Value(r, r == KErrNone || r==KErrNotFound); |
0 | 252 |
r=TheFs.Delete(KTestFile2); |
189 | 253 |
test_Value(r, r == KErrNone || r==KErrNotFound); |
0 | 254 |
r=TheFs.RmDir(KTestDir1); |
189 | 255 |
test_Value(r, r == KErrNone || r==KErrNotFound); |
0 | 256 |
r=TheFs.RmDir(KTestDir2); |
189 | 257 |
test_Value(r, r == KErrNone || r==KErrNotFound); |
0 | 258 |
|
259 |
gMinFileSize = MinimumFileSize(drive); |
|
260 |
} |
|
261 |
||
262 |
LOCAL_C TInt64 FillDisk(RFile& aFile,TInt64 aNewSpace,TInt aDrive) |
|
263 |
// |
|
264 |
// fill a file until free disk space equals aFreeSpace |
|
265 |
// |
|
266 |
{ |
|
267 |
TInt64 space=FreeDiskSpace(aDrive); |
|
269 | 268 |
RDebug::Print(_L("Filling drive till %lu bytes left, current freespace is %lu."), aNewSpace, space); |
269 |
||
0 | 270 |
test(space>aNewSpace); |
271 |
while(space>aNewSpace) |
|
272 |
{ |
|
273 |
TInt s=Min(KMaxBufSize, I64INT(space-aNewSpace)); |
|
274 |
TInt r=aFile.Write(TheBuffer,s); |
|
275 |
if( !LffsDrive ) |
|
276 |
{ |
|
189 | 277 |
test_KErrNone(r); |
0 | 278 |
} |
279 |
else |
|
280 |
{ |
|
281 |
// |
|
282 |
// LFFS is less predictable than a normal drive because of the logging |
|
283 |
// and metadata arrangement |
|
284 |
// |
|
285 |
test( (KErrNone==r) || (KErrDiskFull==r) ); |
|
286 |
if( KErrDiskFull == r ) |
|
287 |
{ |
|
288 |
// shrink the file back down again to give the requested free space |
|
289 |
TInt fileSize; |
|
290 |
r=aFile.Size( fileSize ); |
|
291 |
test( KErrNone == r ); |
|
292 |
test( TInt64(fileSize) > aNewSpace ); |
|
293 |
fileSize -= I64LOW(aNewSpace); |
|
294 |
r=aFile.SetSize( fileSize ); |
|
295 |
test( KErrNone == r ); |
|
296 |
||
297 |
space=FreeDiskSpace(aDrive); |
|
298 |
while( space < aNewSpace ) |
|
299 |
{ |
|
300 |
fileSize -= I64LOW(aNewSpace - space); |
|
301 |
test( fileSize > 0 ); |
|
302 |
r=aFile.SetSize( fileSize ); |
|
303 |
test( KErrNone == r ); |
|
304 |
space=FreeDiskSpace(aDrive); |
|
305 |
} |
|
306 |
break; |
|
307 |
} |
|
308 |
} |
|
309 |
||
310 |
space=FreeDiskSpace(aDrive); |
|
311 |
} |
|
312 |
return(space); |
|
313 |
} |
|
314 |
||
315 |
LOCAL_C void WriteToFile(RFile& aFile,TInt aSize) |
|
316 |
// |
|
317 |
// |
|
318 |
// |
|
319 |
{ |
|
320 |
while(aSize>0) |
|
321 |
{ |
|
322 |
TInt s=Min(KMaxBufSize,aSize); |
|
323 |
TInt r=aFile.Write(TheBuffer,s); |
|
324 |
aSize-=s; |
|
325 |
||
326 |
// Flush if write caching enabled to ensure we get disk space notifications |
|
327 |
if ((gDriveCacheFlags & EFileCacheWriteOn) && (r == KErrNone)) |
|
328 |
r = aFile.Flush(); |
|
329 |
||
330 |
if( !LffsDrive ) |
|
331 |
{ |
|
189 | 332 |
test_KErrNone(r); |
0 | 333 |
} |
334 |
else |
|
335 |
{ |
|
336 |
// we can't accurately predict the amount of data we can actually get |
|
337 |
// on an LFFS drive, so it's posible we could exceed the available |
|
338 |
// space even though we are writing less that the reported free space |
|
339 |
test( (KErrNone==r) || (KErrDiskFull==r) ); |
|
340 |
if( KErrDiskFull == r ) |
|
341 |
{ |
|
342 |
break; // just stop |
|
343 |
} |
|
344 |
} |
|
345 |
} |
|
346 |
} |
|
347 |
||
348 |
||
349 |
LOCAL_C void CleanupForThread(TInt aTask) |
|
350 |
// |
|
351 |
// |
|
352 |
// |
|
353 |
{ |
|
354 |
TInt r; |
|
355 |
switch(aTask) |
|
356 |
{ |
|
357 |
case ETaskMkDir: |
|
358 |
r=TheFs.RmDir(KTestDir1); |
|
189 | 359 |
test_KErrNone(r); |
0 | 360 |
break; |
361 |
case ETaskRmDir: break; |
|
362 |
case ETaskDelete: break; |
|
363 |
case ETaskReplace: |
|
364 |
r=TheFs.Delete(KTestFile2); |
|
189 | 365 |
test_KErrNone(r); |
0 | 366 |
break; |
367 |
case ETaskFileReplace: |
|
368 |
r=TheFs.Delete(KTestFile1); |
|
189 | 369 |
test_KErrNone(r); |
0 | 370 |
break; |
371 |
case ETaskFileWrite: |
|
372 |
case ETaskFileWrite4KB: |
|
373 |
case ETaskFileWrite64KB: |
|
374 |
case ETaskFileSetSize: |
|
375 |
case ETaskFileCreateLffs: |
|
376 |
case ETaskNoChange1: |
|
377 |
case ETaskNoChange2: |
|
378 |
r=TheFs.Delete(KTestFile1); |
|
379 |
if(r!=KErrNone) |
|
380 |
{ |
|
381 |
test.Printf(_L("r=%d"),r); |
|
382 |
test(EFalse); |
|
383 |
} |
|
384 |
break; |
|
385 |
case ETaskSpin: |
|
386 |
default:break; |
|
387 |
} |
|
388 |
} |
|
389 |
||
390 |
LOCAL_C void InitialiseForThread(TInt aTask) |
|
391 |
// |
|
392 |
// |
|
393 |
// |
|
394 |
{ |
|
395 |
TInt r; |
|
396 |
RFile file,file2; |
|
397 |
switch(aTask) |
|
398 |
{ |
|
399 |
case ETaskMkDir: break; |
|
400 |
case ETaskRmDir: |
|
401 |
r=TheFs.MkDir(KTestDir1); |
|
189 | 402 |
test_KErrNone(r); |
0 | 403 |
break; |
404 |
case ETaskDelete: |
|
405 |
r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 406 |
test_KErrNone(r); |
0 | 407 |
if( !LffsDrive ) |
408 |
{ |
|
409 |
r=file.SetSize(KFileSize1); |
|
189 | 410 |
test_KErrNone(r); |
0 | 411 |
} |
412 |
else |
|
413 |
{ |
|
414 |
// LFFS supports sparse files, so we have to write real data |
|
415 |
// into the file to ensure that it uses up disk space |
|
416 |
WriteToFile( file, KFileSize1 ); |
|
417 |
} |
|
418 |
file.Close(); |
|
419 |
break; |
|
420 |
case ETaskReplace: |
|
421 |
r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 422 |
test_KErrNone(r); |
0 | 423 |
if( !LffsDrive ) |
424 |
{ |
|
425 |
r=file.SetSize(KFileSize1); |
|
189 | 426 |
test_KErrNone(r); |
0 | 427 |
} |
428 |
else |
|
429 |
{ |
|
430 |
WriteToFile( file, KFileSize2 ); |
|
431 |
} |
|
432 |
file.Close(); |
|
433 |
r=file2.Create(TheFs,KTestFile2,EFileShareAny|EFileWrite); |
|
189 | 434 |
test_KErrNone(r); |
0 | 435 |
if( !LffsDrive ) |
436 |
{ |
|
437 |
r=file2.SetSize(KFileSize3); |
|
189 | 438 |
test_KErrNone(r); |
0 | 439 |
} |
440 |
else |
|
441 |
{ |
|
442 |
WriteToFile( file2, gMinFileSize << 4); // 512 * 16 = 8K |
|
443 |
} |
|
444 |
file2.Close(); |
|
445 |
break; |
|
446 |
case ETaskFileReplace: |
|
447 |
r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 448 |
test_KErrNone(r); |
0 | 449 |
if( !LffsDrive ) |
450 |
{ |
|
451 |
r=file.SetSize(KFileSize3*2); |
|
452 |
} |
|
453 |
else |
|
454 |
{ |
|
455 |
WriteToFile( file, KFileSize3 ); |
|
456 |
} |
|
189 | 457 |
test_KErrNone(r); |
0 | 458 |
file.Close(); |
459 |
break; |
|
460 |
case ETaskFileWrite: |
|
461 |
case ETaskFileWrite4KB: |
|
462 |
case ETaskFileWrite64KB: |
|
463 |
case ETaskFileSetSize: |
|
464 |
r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 465 |
test_KErrNone(r); |
0 | 466 |
file.Close(); |
467 |
break; |
|
468 |
case ETaskNoChange1: |
|
469 |
r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 470 |
test_KErrNone(r); |
0 | 471 |
if( !LffsDrive ) |
472 |
{ |
|
473 |
r=file.SetSize(KFileSize1); |
|
189 | 474 |
test_KErrNone(r); |
0 | 475 |
} |
476 |
else |
|
477 |
{ |
|
478 |
WriteToFile( file, KFileSize1 ); |
|
479 |
} |
|
480 |
file.Close(); |
|
481 |
break; |
|
482 |
case ETaskNoChange2: |
|
483 |
r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 484 |
test_KErrNone(r); |
0 | 485 |
file.Close(); |
486 |
break; |
|
487 |
case ETaskFileCreateLffs: |
|
488 |
r = TheFs.Delete(KTestFile1); |
|
489 |
break; |
|
490 |
case ETaskSpin: |
|
491 |
default:break; |
|
492 |
} |
|
493 |
} |
|
494 |
||
495 |
LOCAL_C TInt ThreadFunction(TAny* aThreadTask) |
|
496 |
// |
|
497 |
// |
|
498 |
// |
|
499 |
{ |
|
500 |
RTest test(_L("T_DSPACE_ThreadFunction")); |
|
501 |
RFs fs; |
|
502 |
TInt r=fs.Connect(); |
|
189 | 503 |
test_KErrNone(r); |
0 | 504 |
r=fs.SetSessionPath(gSessionPath); |
189 | 505 |
test_KErrNone(r); |
0 | 506 |
TThreadTask task=*(TThreadTask*)&aThreadTask; |
507 |
RFile file; |
|
508 |
switch(task) |
|
509 |
{ |
|
510 |
case ETaskMkDir: |
|
511 |
r=fs.MkDir(KTestDir1); |
|
189 | 512 |
test_KErrNone(r); |
0 | 513 |
break; |
514 |
case ETaskRmDir: |
|
515 |
r=fs.RmDir(KTestDir1); |
|
189 | 516 |
test_KErrNone(r); |
0 | 517 |
break; |
518 |
case ETaskDelete: |
|
519 |
r=fs.Delete(KTestFile1); |
|
189 | 520 |
test_KErrNone(r); |
0 | 521 |
break; |
522 |
case ETaskReplace: |
|
523 |
r=fs.Replace(KTestFile1,KTestFile2); |
|
189 | 524 |
test_KErrNone(r); |
0 | 525 |
break; |
526 |
case ETaskFileReplace: |
|
527 |
r=file.Replace(fs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 528 |
test_KErrNone(r); |
0 | 529 |
file.Close(); |
530 |
break; |
|
531 |
case ETaskFileWrite: |
|
532 |
r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 533 |
test_KErrNone(r); |
0 | 534 |
#if defined(__WINS__) |
535 |
WriteToFile( file, gMinFileSize << 4); // 512 * 16 = 8K |
|
536 |
#else |
|
537 |
WriteToFile( file, gMinFileSize << 1); // 512 * 2 = 1K |
|
538 |
#endif |
|
539 |
file.Close(); |
|
540 |
break; |
|
541 |
case ETaskFileWrite4KB: |
|
542 |
r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 543 |
test_KErrNone(r); |
0 | 544 |
WriteToFile(file,gMinFileSize << 3); // 512 * 2^3 = 512 * 8 = 4K |
545 |
file.Close(); |
|
546 |
break; |
|
547 |
case ETaskFileWrite64KB: |
|
548 |
r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 549 |
test_KErrNone(r); |
0 | 550 |
WriteToFile(file,gMinFileSize<<7); // 512 * 2^7 = 512 * 128 = 64K |
551 |
file.Close(); |
|
552 |
break; |
|
553 |
case ETaskFileSetSize: |
|
554 |
r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 555 |
test_KErrNone(r); |
0 | 556 |
r=file.SetSize(KFileSize3); |
557 |
file.Close(); |
|
558 |
break; |
|
559 |
case ETaskFileCreateLffs: |
|
560 |
r=file.Create(fs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 561 |
test_KErrNone(r); |
0 | 562 |
file.Close(); |
563 |
break; |
|
564 |
case ETaskNoChange1: |
|
565 |
{ |
|
566 |
r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 567 |
test_KErrNone(r); |
0 | 568 |
TTime time; |
569 |
time.HomeTime(); |
|
570 |
r=file.SetModified(time); |
|
189 | 571 |
test_KErrNone(r); |
0 | 572 |
file.Close(); |
573 |
break; |
|
574 |
} |
|
575 |
case ETaskNoChange2: |
|
576 |
{ |
|
577 |
TEntry e; |
|
578 |
r=fs.Entry(KTestFile1,e); |
|
189 | 579 |
test_KErrNone(r); |
0 | 580 |
break; |
581 |
} |
|
582 |
case ETaskSpin: |
|
583 |
for(;;) {}; |
|
584 |
||
585 |
default:break; |
|
586 |
} |
|
587 |
fs.Close(); |
|
588 |
return(KErrNone); |
|
589 |
} |
|
590 |
||
591 |
||
592 |
void TestCancellation() |
|
593 |
// |
|
594 |
// test error disk space notification requests can be cancelled |
|
595 |
// |
|
596 |
{ |
|
597 |
test.Next(_L("test disk space cancellation")); |
|
598 |
const TInt ThresholdSize=500; |
|
599 |
// test a cancellation |
|
600 |
// Up the priority of this thread so that we can cancel the request before the drive thread |
|
601 |
// runs, to test whether cancelling still works. |
|
602 |
RThread().SetPriority(EPriorityRealTime); |
|
603 |
TRequestStatus stat1; |
|
604 |
TheFs.NotifyDiskSpace(ThresholdSize,KDefaultDrive,stat1); |
|
605 |
test(stat1==KRequestPending); |
|
606 |
TheFs.NotifyDiskSpaceCancel(stat1); |
|
607 |
test(stat1==KErrCancel); |
|
608 |
RThread().SetPriority(EPriorityNormal); |
|
609 |
// test no affect if already cancelled |
|
610 |
stat1=KErrNone; |
|
611 |
TheFs.NotifyDiskSpaceCancel(stat1); |
|
612 |
test(stat1==KErrNone); |
|
613 |
// set up two requests, cancel 1 |
|
614 |
TRequestStatus stat2; |
|
615 |
TheFs.NotifyDiskSpace(ThresholdSize,KDefaultDrive,stat1); |
|
616 |
TheFs.NotifyDiskSpace(ThresholdSize,KDefaultDrive,stat2); |
|
617 |
test(stat1==KRequestPending && stat2==KRequestPending); |
|
618 |
TheFs.NotifyDiskSpaceCancel(stat2); |
|
619 |
test(stat1==KRequestPending && stat2==KErrCancel); |
|
620 |
TheFs.NotifyDiskSpaceCancel(stat1); |
|
621 |
test(stat1==KErrCancel); |
|
622 |
||
623 |
if( !LffsDrive) |
|
624 |
{ |
|
625 |
// now repeat with c: and removable drive |
|
626 |
TheFs.NotifyDiskSpace(ThresholdSize,EDriveC,stat1); |
|
627 |
TheFs.NotifyDiskSpace(ThresholdSize,RemovableDrive,stat2); |
|
628 |
test(stat1==KRequestPending && stat2==KRequestPending); |
|
629 |
TheFs.NotifyDiskSpaceCancel(stat1); |
|
630 |
test(stat2==KRequestPending && stat1==KErrCancel); |
|
631 |
TheFs.NotifyDiskSpaceCancel(stat2); |
|
632 |
test(stat2==KErrCancel); |
|
633 |
} |
|
634 |
} |
|
635 |
||
636 |
void TestErrorConditions() |
|
637 |
// |
|
638 |
// test disk space notification requests return correct error value |
|
639 |
// |
|
640 |
{ |
|
641 |
test.Next(_L("test error conditions")); |
|
642 |
// attempt to set up disk space notification with a threshold of zero |
|
643 |
TRequestStatus status; |
|
644 |
TheFs.NotifyDiskSpace(0,KDefaultDrive,status); |
|
645 |
test(status==KErrArgument); |
|
646 |
// test on an empty drive |
|
647 |
TheFs.NotifyDiskSpace(100,EDriveO,status); |
|
648 |
test(status==KErrNotReady); |
|
649 |
// test on a drive out of rance |
|
650 |
TheFs.NotifyDiskSpace(100,27,status); |
|
651 |
test(status==KErrBadName); |
|
652 |
// new setup with threshold of one |
|
653 |
TheFs.NotifyDiskSpace(1,KDefaultDrive,status); |
|
654 |
test(status==KRequestPending); |
|
655 |
TheFs.NotifyDiskSpaceCancel(status); |
|
656 |
test(status==KErrCancel); |
|
657 |
// and with a threshold > disk size |
|
658 |
TheFs.NotifyDiskSpace(TheDiskSize+10,KDefaultDrive,status); |
|
659 |
test(status==KErrArgument); |
|
660 |
// now with a size of max size -1 |
|
661 |
TheFs.NotifyDiskSpace(TheDiskSize-1,KDefaultDrive,status); |
|
662 |
test(status==KRequestPending); |
|
663 |
TheFs.NotifyDiskSpaceCancel(status); |
|
664 |
test(status==KErrCancel); |
|
665 |
// set up mutiple requests and cancel one |
|
666 |
TRequestStatus status2,status3; |
|
667 |
TheFs.NotifyDiskSpace(TheDiskSize-10,KDefaultDrive,status); |
|
668 |
TheFs.NotifyDiskSpace(TheDiskSize-10,KDefaultDrive,status2); |
|
669 |
TheFs.NotifyDiskSpace(TheDiskSize-10,KDefaultDrive,status3); |
|
670 |
test(status==KRequestPending&&status2==KRequestPending&&status3==KRequestPending); |
|
671 |
TheFs.NotifyDiskSpaceCancel(status3); |
|
672 |
test(status==KRequestPending&&status2==KRequestPending&&status3==KErrCancel); |
|
673 |
// cancel the remaining ones |
|
674 |
TheFs.NotifyDiskSpaceCancel(); |
|
675 |
test(status==KErrCancel&&status2==KErrCancel&&status3==KErrCancel); |
|
676 |
} |
|
677 |
||
678 |
TInt GenerateMediaChange() |
|
679 |
{ |
|
680 |
RLocalDrive d; |
|
681 |
TBool flag=EFalse; |
|
682 |
//Find the local drive number corresponding to removabledrive |
|
683 |
TMediaSerialNumber serialNum; |
|
684 |
TInt r = TheFs.GetMediaSerialNumber(serialNum, RemovableDrive); |
|
685 |
if(r!= KErrNone) |
|
686 |
return r; |
|
687 |
||
688 |
TInt len = serialNum.Length(); |
|
689 |
test.Printf(_L("Serial number (len %d) :"), len); |
|
690 |
||
691 |
TInt localDriveNum = -1; |
|
692 |
for (TInt n=0; n<KMaxLocalDrives; n++) |
|
693 |
{ |
|
694 |
r = d.Connect(n, flag); |
|
695 |
if(r != KErrNone) |
|
696 |
{ |
|
697 |
test.Printf(_L("drive %d: TBusLocalDrive::Connect() failed %d\n"), n, r); |
|
698 |
continue; |
|
699 |
} |
|
700 |
||
701 |
TLocalDriveCapsV5Buf capsBuf; |
|
702 |
TLocalDriveCapsV5& caps = capsBuf(); |
|
703 |
r = d.Caps(capsBuf); |
|
704 |
if(r != KErrNone) |
|
705 |
{ |
|
706 |
test.Printf(_L("drive %d: TBusLocalDrive::Caps() failed %d\n"), n, r); |
|
707 |
continue; |
|
708 |
} |
|
709 |
||
710 |
||
711 |
TPtrC8 localSerialNum(caps.iSerialNum, caps.iSerialNumLength); |
|
712 |
if (serialNum.Compare(localSerialNum) == 0) |
|
713 |
{ |
|
714 |
localDriveNum = n; |
|
715 |
d.Close(); |
|
716 |
break; |
|
717 |
} |
|
718 |
||
719 |
d.Close(); |
|
720 |
} |
|
721 |
r =d.Connect(localDriveNum,flag); |
|
722 |
if (r!=KErrNone) |
|
723 |
return r; |
|
724 |
d.ForceMediaChange(); |
|
725 |
d.Close(); |
|
726 |
return KErrNone; |
|
727 |
} |
|
728 |
||
729 |
void TestDiskNotify() |
|
730 |
// |
|
731 |
// test functions that can result in disk change notification |
|
732 |
// format,scandrive, media change |
|
733 |
// |
|
734 |
{ |
|
269 | 735 |
test.Next(_L("test Disk Notify")); |
0 | 736 |
// make default directory |
737 |
_LIT(defaultDir,"C:\\F32-TST\\"); |
|
738 |
TInt r=TheFs.MkDirAll(defaultDir); |
|
189 | 739 |
test_Value(r, r == KErrNone||r==KErrAlreadyExists); |
0 | 740 |
// create the filler file |
741 |
RFile file; |
|
742 |
TFileName fileName=_L("C:"); |
|
743 |
fileName+=KFileFiller; |
|
744 |
r=file.Create(TheFs,fileName,EFileShareAny|EFileWrite); |
|
189 | 745 |
test_KErrNone(r); |
0 | 746 |
TInt64 free=FreeDiskSpace(EDriveC); |
747 |
// use up 16KB |
|
748 |
FillDisk(file,free-16384,EDriveC); |
|
749 |
||
750 |
// test formatting notifies clients on only specific drive |
|
751 |
test.Next(_L("test formatting")); |
|
752 |
TRequestStatus stat1, stat2; |
|
753 |
TInt64 freeC=FreeDiskSpace(EDriveC); |
|
754 |
TInt64 freeD=FreeDiskSpace(RemovableDrive); |
|
755 |
TheFs.NotifyDiskSpace(freeC+1024,EDriveC,stat1); |
|
756 |
TheFs.NotifyDiskSpace(freeD-1024,RemovableDrive,stat2); |
|
757 |
test(stat1==KRequestPending && stat2==KRequestPending); |
|
758 |
RFormat f; |
|
759 |
TInt count; |
|
760 |
r=f.Open(TheFs,RemovableDriveBuf,EQuickFormat,count); |
|
189 | 761 |
test_KErrNone(r); |
0 | 762 |
while(count) |
763 |
{ |
|
764 |
r=f.Next(count); |
|
189 | 765 |
test_KErrNone(r); |
0 | 766 |
} |
767 |
f.Close(); |
|
768 |
User::After(1000000); |
|
769 |
User::WaitForRequest(stat2); |
|
770 |
test(stat1==KRequestPending && stat2==KErrNone); |
|
771 |
TheFs.NotifyDiskSpaceCancel(stat1); |
|
772 |
test(stat1==KErrCancel); |
|
773 |
||
774 |
// and create the test directory for the removable drive |
|
775 |
TFileName fName=_L(""); |
|
776 |
fName+=RemovableDriveBuf; |
|
777 |
fName+=_L("F32-TST\\"); |
|
778 |
r=TheFs.MkDirAll(fName); |
|
189 | 779 |
test_KErrNone(r); |
0 | 780 |
|
781 |
// test that a media change notifies clients on all drives |
|
782 |
test.Next(_L("media change")); |
|
783 |
freeC=FreeDiskSpace(EDriveC); |
|
784 |
freeD=FreeDiskSpace(RemovableDrive); |
|
785 |
test.Printf(_L("free space on drive %d = 0x%x\n"),EDriveC,freeC); |
|
786 |
test.Printf(_L("free space on drive %d = 0x%x\n"),RemovableDrive,freeD); |
|
787 |
TheFs.NotifyDiskSpace(freeC+1024,EDriveC,stat1); |
|
788 |
TheFs.NotifyDiskSpace(freeD-1024,RemovableDrive,stat2); |
|
789 |
test(stat1==KRequestPending && stat2==KRequestPending); |
|
790 |
// UserSvr::ForceRemountMedia(ERemovableMedia0); |
|
791 |
r = GenerateMediaChange(); |
|
792 |
if(r == KErrNone) |
|
793 |
{ |
|
794 |
User::After(1000000); |
|
795 |
User::WaitForRequest(stat2); |
|
796 |
test(stat1==KRequestPending && stat2==KErrNone); |
|
797 |
TheFs.NotifyDiskSpaceCancel(stat1); |
|
798 |
test(stat1==KErrCancel); |
|
799 |
} |
|
800 |
else |
|
801 |
{ |
|
802 |
test.Printf(_L("media change not supported, skipping this step\n")); |
|
803 |
TheFs.NotifyDiskSpaceCancel(stat1); |
|
804 |
test(stat1 == KErrCancel); |
|
805 |
TheFs.NotifyDiskSpaceCancel(stat2); |
|
806 |
test(stat2 == KErrCancel); |
|
807 |
} |
|
808 |
||
809 |
// test that scandrive notifies clients on only specific drives |
|
810 |
test.Next(_L("scandrive")); |
|
811 |
// first test that scandrive does not find any problems on the removable media |
|
812 |
r=TheFs.ScanDrive(RemovableDriveBuf); |
|
189 | 813 |
test_KErrNone(r); |
0 | 814 |
// now set up disk space notification |
815 |
freeC=FreeDiskSpace(EDriveC); |
|
816 |
freeD=FreeDiskSpace(RemovableDrive); |
|
817 |
test.Printf(_L("free space on drive %d = 0x%x\n"),EDriveC,freeC); |
|
818 |
test.Printf(_L("free space on drive %d = 0x%x\n"),RemovableDrive,freeD); |
|
819 |
TheFs.NotifyDiskSpace(freeC+8192,EDriveC,stat1); |
|
820 |
TheFs.NotifyDiskSpace(freeD-8192,RemovableDrive,stat2); |
|
821 |
test(stat1==KRequestPending && stat2==KRequestPending); |
|
822 |
r=TheFs.ScanDrive(RemovableDriveBuf); |
|
189 | 823 |
test_KErrNone(r); |
0 | 824 |
User::After(1000000); |
825 |
User::WaitForRequest(stat2); |
|
826 |
test(stat1==KRequestPending && stat2==KErrNone); |
|
827 |
TheFs.NotifyDiskSpaceCancel(stat1); |
|
828 |
test(stat1==KErrCancel); |
|
829 |
||
830 |
file.Close(); |
|
831 |
r=TheFs.Delete(fileName); |
|
189 | 832 |
test_KErrNone(r); |
0 | 833 |
if(gSessionPath[0]!=(TText)'C') |
834 |
{ |
|
835 |
r=TheFs.RmDir(defaultDir); |
|
189 | 836 |
test_Value(r, r == KErrNone||r==KErrInUse); |
0 | 837 |
} |
838 |
||
839 |
} |
|
840 |
||
841 |
void TestFunctions() |
|
842 |
// |
|
843 |
// test some of the functions that may result in a change in free disk space |
|
844 |
// not testing all functions that may result in free disk space change since |
|
845 |
// change is dependent on the file system |
|
846 |
// |
|
847 |
{ |
|
848 |
test.Next(_L("test disk space functions")); |
|
849 |
// create the filler file |
|
850 |
RFile file; |
|
851 |
TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
|
189 | 852 |
test_KErrNone(r); |
0 | 853 |
TInt64 newSpace = FreeDiskSpace(KDefaultDrive)-8192; |
854 |
FillDisk(file,newSpace,KDefaultDrive); |
|
855 |
||
856 |
// check file write |
|
857 |
test.Next(_L("check RFile:Write")); |
|
858 |
TThreadTask task=ETaskFileWrite; |
|
859 |
InitialiseForThread(task); |
|
860 |
TInt64 free=FreeDiskSpace(KDefaultDrive); |
|
861 |
TRequestStatus stat1; |
|
862 |
TInt64 threshold=free-200; |
|
863 |
TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
|
864 |
test(stat1==KRequestPending); |
|
865 |
RThread thread; |
|
866 |
r=thread.Create(_L("thread1"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 867 |
test_KErrNone(r); |
0 | 868 |
thread.Resume(); |
869 |
User::WaitForRequest(stat1); |
|
870 |
test(stat1==KErrNone); |
|
871 |
free=FreeDiskSpace(KDefaultDrive); |
|
872 |
test(free<threshold); |
|
873 |
TRequestStatus deathStat; |
|
874 |
thread.Logon( deathStat ); |
|
875 |
User::WaitForRequest( deathStat ); |
|
876 |
thread.Close(); |
|
877 |
CleanupForThread(task); |
|
878 |
||
879 |
// check file set size |
|
880 |
// setting file size on LFFS only uses a small amount of disk space for metadata |
|
881 |
// so we skip this test for an LFFS drive |
|
882 |
if( !LffsDrive ) |
|
883 |
{ |
|
884 |
test.Next(_L("check RFile:SetSize")); |
|
885 |
task=ETaskFileSetSize; |
|
886 |
InitialiseForThread(task); |
|
887 |
free=FreeDiskSpace(KDefaultDrive); |
|
888 |
threshold=free-100; |
|
889 |
TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
|
890 |
test(stat1==KRequestPending); |
|
891 |
r=thread.Create(_L("thread2"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 892 |
test_KErrNone(r); |
0 | 893 |
TRequestStatus deathStat; |
894 |
thread.Logon( deathStat ); |
|
895 |
thread.Resume(); |
|
896 |
User::WaitForRequest(stat1); |
|
897 |
test(stat1==KErrNone); |
|
898 |
free=FreeDiskSpace(KDefaultDrive); |
|
899 |
test(free<threshold); |
|
900 |
User::WaitForRequest( deathStat ); |
|
901 |
thread.Close(); |
|
902 |
CleanupForThread(task); |
|
903 |
} |
|
904 |
||
905 |
// check disk space notification does not occur when threshold not crossed |
|
906 |
TInt64 newFree; |
|
907 |
test.Next(_L("check RFile:SetSize with wrong threshold")); |
|
908 |
||
909 |
User::After(1000000); //put in due to thread latency |
|
910 |
||
911 |
task=ETaskFileSetSize; |
|
912 |
InitialiseForThread(task); |
|
913 |
free=FreeDiskSpace(KDefaultDrive); |
|
914 |
threshold=free+100; |
|
915 |
TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
|
916 |
test(stat1==KRequestPending); |
|
917 |
r=thread.Create(_L("thread3"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 918 |
test_KErrNone(r); |
0 | 919 |
thread.Logon( deathStat ); |
920 |
thread.Resume(); |
|
921 |
||
922 |
User::After(1000000); |
|
923 |
||
924 |
test(stat1==KRequestPending); |
|
925 |
newFree=FreeDiskSpace(KDefaultDrive); |
|
926 |
/* |
|
927 |
test.Printf(_L("threshold = %d and %d"),threshold.High(), threshold.Low()); |
|
928 |
test.Printf(_L("free = %d and %d"),free.High(), free.Low()); |
|
929 |
test.Printf(_L("newFree = %d and %d"),newFree.High(), newFree.Low()); |
|
930 |
*/ |
|
931 |
if(!LffsDrive) |
|
932 |
test(free<threshold && newFree<free); |
|
933 |
else |
|
934 |
test(free<threshold); //changing file size on lffs does not do anything |
|
935 |
||
936 |
User::WaitForRequest( deathStat ); |
|
937 |
thread.Close(); |
|
938 |
CleanupForThread(task); |
|
939 |
TheFs.NotifyDiskSpaceCancel(stat1); |
|
940 |
test(stat1==KErrCancel); |
|
941 |
||
942 |
// check for file delete |
|
943 |
test.Next(_L("check RFs::Delete")); |
|
944 |
task=ETaskDelete; |
|
945 |
InitialiseForThread(task); |
|
946 |
free=FreeDiskSpace(KDefaultDrive); |
|
947 |
threshold=free+300; |
|
948 |
TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
|
949 |
test(stat1==KRequestPending); |
|
950 |
r=thread.Create(_L("thread4"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 951 |
test_KErrNone(r); |
0 | 952 |
thread.Logon( deathStat ); |
953 |
thread.Resume(); |
|
954 |
User::WaitForRequest(stat1); |
|
955 |
test(stat1==KErrNone); |
|
956 |
free=FreeDiskSpace(KDefaultDrive); |
|
957 |
test(free>threshold); |
|
958 |
User::WaitForRequest( deathStat ); |
|
959 |
thread.Close(); |
|
960 |
CleanupForThread(task); |
|
961 |
||
962 |
// check for replace with threshold too high |
|
963 |
test.Next(_L("check RFs::Replace with threshold too high")); |
|
964 |
||
965 |
if( LffsDrive ) |
|
966 |
{ |
|
967 |
test.Printf( _L("Skipped.... test isn't consistent on LFFS drive\n") ); |
|
968 |
} |
|
969 |
else |
|
970 |
{ |
|
971 |
task=ETaskReplace; |
|
972 |
InitialiseForThread(task); |
|
973 |
free=FreeDiskSpace(KDefaultDrive); |
|
974 |
#if defined(__WINS__) |
|
975 |
threshold=free + gMinFileSize * 16 + 2048; // 512 * 16 + 2K = 10K |
|
976 |
#else |
|
977 |
if(LffsDrive ) |
|
978 |
threshold=free + (gMinFileSize << 4) + 2048; // 512 * 16 + 2K = 10K |
|
979 |
else |
|
980 |
threshold=free + gMinFileSize * 9 + 392; // 512 * 9 + 392 = 5000; |
|
981 |
#endif |
|
982 |
||
983 |
TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
|
984 |
test(stat1==KRequestPending); |
|
985 |
||
986 |
r=thread.Create(_L("thread5"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 987 |
test_KErrNone(r); |
0 | 988 |
thread.Logon( deathStat ); |
989 |
thread.Resume(); |
|
990 |
||
991 |
User::After(1000000); |
|
992 |
test(stat1==KRequestPending); |
|
993 |
newFree=FreeDiskSpace(KDefaultDrive); |
|
994 |
test(newFree<threshold && free<newFree); |
|
995 |
TheFs.NotifyDiskSpaceCancel(); |
|
996 |
test(stat1==KErrCancel); |
|
997 |
User::WaitForRequest( deathStat ); |
|
998 |
thread.Close(); |
|
999 |
CleanupForThread(task); |
|
1000 |
||
1001 |
||
1002 |
// check for replace |
|
1003 |
test.Next(_L("check RFs:Replace")); |
|
1004 |
task=ETaskReplace; |
|
1005 |
InitialiseForThread(task); |
|
1006 |
free=FreeDiskSpace(KDefaultDrive); |
|
1007 |
threshold=free+200; |
|
1008 |
TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1); |
|
1009 |
test(stat1==KRequestPending); |
|
1010 |
r=thread.Create(_L("thread6"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 1011 |
test_KErrNone(r); |
0 | 1012 |
thread.Logon( deathStat ); |
1013 |
thread.Resume(); |
|
1014 |
User::WaitForRequest(stat1); |
|
1015 |
//User::After(1000000); |
|
1016 |
test(stat1==KErrNone); |
|
1017 |
User::WaitForRequest( deathStat ); |
|
1018 |
test(deathStat==KErrNone); |
|
1019 |
thread.Close(); |
|
1020 |
CleanupForThread(task); |
|
1021 |
free=FreeDiskSpace(KDefaultDrive); |
|
1022 |
test(free>threshold); |
|
1023 |
} |
|
1024 |
||
1025 |
// check that CSessionFS::iTheDrive is set in subsession calls |
|
1026 |
test.Next(_L("Check iTheDrive and subsessions")); |
|
1027 |
if( LffsDrive ) |
|
1028 |
{ |
|
1029 |
test.Printf( _L("Skipped.... test not done on LFFS drive\n") ); |
|
1030 |
} |
|
1031 |
else |
|
1032 |
{ |
|
1033 |
RFile f2; |
|
1034 |
#if defined(__WINS__) |
|
1035 |
_LIT(someFile,"X:\\abcdef"); |
|
1036 |
#else |
|
1037 |
TBuf<10> someFile=_L("?:\\abcdef"); |
|
1038 |
TChar c; |
|
1039 |
TInt r=RFs::DriveToChar(RemovableDrive,c); |
|
189 | 1040 |
test_KErrNone(r); |
0 | 1041 |
someFile[0]=(TText)c; |
1042 |
#endif |
|
1043 |
_LIT(someDir,"C:\\1234\\"); |
|
1044 |
||
1045 |
r=f2.Create(TheFs,someFile,EFileShareAny|EFileWrite); |
|
189 | 1046 |
test_KErrNone(r); |
0 | 1047 |
r=TheFs.MkDir(someDir); |
189 | 1048 |
test_KErrNone(r); |
0 | 1049 |
TRequestStatus stat2; |
1050 |
TInt64 freeC=FreeDiskSpace(EDriveC); |
|
1051 |
TInt64 freeD=FreeDiskSpace(RemovableDrive); |
|
1052 |
TheFs.NotifyDiskSpace(freeC-4097,EDriveC,stat1); |
|
1053 |
TheFs.NotifyDiskSpace(freeD-4097,RemovableDrive,stat2); |
|
1054 |
test(stat1==KRequestPending && stat2==KRequestPending); |
|
1055 |
// before fix this would result in iTheDrive not being updated in next subsession call |
|
1056 |
// therefore this could would not result in a disk space notification |
|
1057 |
r=f2.SetSize(8192); |
|
189 | 1058 |
test_KErrNone(r); |
0 | 1059 |
User::After(1000000); |
1060 |
User::WaitForRequest(stat2); |
|
1061 |
||
1062 |
if (stat2!=KErrNone) |
|
1063 |
test.Printf(_L("stat2=%d\n"),stat2.Int()); |
|
1064 |
test(stat2==KErrNone); |
|
1065 |
if (stat1!=KRequestPending) |
|
1066 |
test.Printf(_L("stat1=%d\n"),stat1.Int()); |
|
1067 |
test(stat1==KRequestPending); |
|
1068 |
||
1069 |
f2.Close(); |
|
1070 |
TheFs.NotifyDiskSpaceCancel(); |
|
1071 |
test(stat1==KErrCancel); |
|
1072 |
r=TheFs.Delete(someFile); |
|
189 | 1073 |
test_KErrNone(r); |
0 | 1074 |
r=TheFs.RmDir(someDir); |
189 | 1075 |
test_KErrNone(r); |
0 | 1076 |
} |
1077 |
||
1078 |
file.Close(); |
|
1079 |
r=TheFs.Delete(KFileFiller); |
|
189 | 1080 |
test_KErrNone(r); |
0 | 1081 |
} |
1082 |
||
1083 |
||
1084 |
||
1085 |
void TestLffsFunctions() |
|
1086 |
// |
|
1087 |
// LFFS-specific tests for some functions which may cause a disk |
|
1088 |
// space change |
|
1089 |
// |
|
1090 |
// |
|
1091 |
{ |
|
1092 |
test.Next(_L("test LFFS disk space functions")); |
|
1093 |
// create the filler file |
|
1094 |
RFile file; |
|
1095 |
TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
|
189 | 1096 |
test_KErrNone(r); |
0 | 1097 |
TInt64 newSpace = FreeDiskSpace(KDefaultDrive)-8192; |
1098 |
FillDisk(file,newSpace,KDefaultDrive); |
|
1099 |
||
1100 |
||
1101 |
// check file create |
|
1102 |
// Creating a file will always allocate space for the inode |
|
1103 |
test.Next(_L("check RFile:Create")); |
|
1104 |
TThreadTask task=ETaskFileCreateLffs; |
|
1105 |
InitialiseForThread(task); |
|
1106 |
TInt64 free=FreeDiskSpace(KDefaultDrive); |
|
1107 |
TInt64 threshold1=free-64; |
|
1108 |
TInt64 threshold2=free-KFileSize3; |
|
1109 |
TRequestStatus stat1, stat2; |
|
1110 |
TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
|
1111 |
TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
|
1112 |
test(stat1==KRequestPending && stat2==KRequestPending); |
|
1113 |
RThread thread; |
|
1114 |
r=thread.Create(_L("thread7"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 1115 |
test_KErrNone(r); |
0 | 1116 |
TRequestStatus deathStat; |
1117 |
thread.Logon( deathStat ); |
|
1118 |
thread.Resume(); |
|
1119 |
User::WaitForRequest(stat1); |
|
1120 |
test(stat1==KErrNone); |
|
1121 |
free=FreeDiskSpace(KDefaultDrive); |
|
1122 |
test(free<threshold1); |
|
1123 |
test(stat2==KRequestPending); |
|
1124 |
test(free>threshold2); |
|
1125 |
TheFs.NotifyDiskSpaceCancel(stat2); |
|
1126 |
User::WaitForRequest(stat2); |
|
1127 |
test(stat2==KErrCancel); |
|
1128 |
User::WaitForRequest( deathStat ); |
|
1129 |
thread.Close(); |
|
1130 |
CleanupForThread(task); |
|
1131 |
||
1132 |
TInt64 threshold3; |
|
1133 |
TRequestStatus stat3; |
|
1134 |
RFile file2; |
|
1135 |
// don't test for wins urel since cant use RFs::ControlIo |
|
1136 |
#if defined(_DEBUG) |
|
1137 |
// check background thread notification |
|
1138 |
test.Next(_L("check Background thread notification")); |
|
1139 |
task=ETaskSpin; // create thread to block background thread |
|
1140 |
InitialiseForThread(task); |
|
1141 |
free=FreeDiskSpace(KDefaultDrive); |
|
1142 |
threshold1=free-64; // this should occur when we create test file |
|
1143 |
threshold2=free+9750; // some impossible value |
|
1144 |
threshold3=free+10000; // some other impossible value that will never happen |
|
1145 |
TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
|
1146 |
TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
|
1147 |
TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
|
1148 |
test(stat1==KRequestPending && stat2==KRequestPending && stat3==KRequestPending); |
|
1149 |
r=thread.Create(_L("thread8"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 1150 |
test_KErrNone(r); |
0 | 1151 |
thread.Logon( deathStat ); |
1152 |
thread.SetPriority( EPriorityLess ); |
|
1153 |
thread.Resume(); // start spinning, blocks background thread |
|
1154 |
// request background thread to notify a daft value |
|
1155 |
TPckgBuf<TInt64> cBuf; |
|
1156 |
cBuf() = threshold2; |
|
1157 |
// Hard code the value of ECioBackgroundNotifyDiskSize. |
|
1158 |
// Although the value is enumerated in f32\slffs\lffs_controlio.h this header file is being |
|
1159 |
// removed from the release codeline but retained in the base team development codeline. |
|
1160 |
#define ECioBackgroundNotifyDiskSize 10016 |
|
1161 |
r = TheFs.ControlIo(GetDriveLFFS(), ECioBackgroundNotifyDiskSize, cBuf); |
|
1162 |
test( KErrNone==r ); |
|
1163 |
// create a file to force some roll-forward |
|
1164 |
r=file2.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 1165 |
test_KErrNone(r); |
0 | 1166 |
User::WaitForRequest(stat1); |
1167 |
test(stat1==KErrNone); |
|
1168 |
test(stat2==KRequestPending); |
|
1169 |
test(stat3==KRequestPending); |
|
1170 |
// kill the spinner thread to allow the background thread to execute |
|
1171 |
thread.Kill(KErrNone); |
|
1172 |
User::WaitForRequest( deathStat ); |
|
1173 |
thread.Close(); |
|
1174 |
// wait for the notifier |
|
1175 |
User::WaitForRequest(stat2); |
|
1176 |
test( stat2==KErrNone ); |
|
1177 |
test( stat3==KRequestPending); |
|
1178 |
TheFs.NotifyDiskSpaceCancel(stat3); |
|
1179 |
User::WaitForRequest(stat3); |
|
1180 |
test(stat3==KErrCancel); |
|
1181 |
CleanupForThread(task); |
|
1182 |
file2.Close(); |
|
1183 |
TheFs.Delete( KTestFile1 ); |
|
1184 |
#endif |
|
1185 |
||
1186 |
// check background thread notification again, this time we won't request |
|
1187 |
// a special value - check that it notifies normally |
|
1188 |
test.Next(_L("check Background thread notification again")); |
|
1189 |
task=ETaskSpin; // create thread to block background thread |
|
1190 |
InitialiseForThread(task); |
|
1191 |
free=FreeDiskSpace(KDefaultDrive); |
|
1192 |
threshold1=free-64; // this should occur when we create test file |
|
1193 |
threshold2=free+9750; // some impossible value |
|
1194 |
threshold3=free+10000; // some other impossible value that will never happen |
|
1195 |
TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
|
1196 |
TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
|
1197 |
TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
|
1198 |
test(stat1==KRequestPending && stat2==KRequestPending && stat3==KRequestPending); |
|
1199 |
r=thread.Create(_L("thread9"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 1200 |
test_KErrNone(r); |
0 | 1201 |
thread.Logon( deathStat ); |
1202 |
thread.SetPriority( EPriorityLess ); |
|
1203 |
thread.Resume(); // start spinning, blocks background thread |
|
1204 |
// create a file to force some roll-forward |
|
1205 |
r=file2.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite); |
|
189 | 1206 |
test_KErrNone(r); |
0 | 1207 |
User::WaitForRequest(stat1); |
1208 |
test(stat1==KErrNone); |
|
1209 |
test(stat2==KRequestPending); |
|
1210 |
test(stat3==KRequestPending); |
|
1211 |
// kill the spinner thread to allow the background thread to execute |
|
1212 |
thread.Kill(KErrNone); |
|
1213 |
User::WaitForRequest( deathStat ); |
|
1214 |
thread.Close(); |
|
1215 |
// wait for the notifier |
|
1216 |
test( stat2==KRequestPending ); |
|
1217 |
test( stat3==KRequestPending); |
|
1218 |
TheFs.NotifyDiskSpaceCancel(stat2); |
|
1219 |
User::WaitForRequest(stat2); |
|
1220 |
test(stat2==KErrCancel); |
|
1221 |
TheFs.NotifyDiskSpaceCancel(stat3); |
|
1222 |
User::WaitForRequest(stat3); |
|
1223 |
test(stat3==KErrCancel); |
|
1224 |
CleanupForThread(task); |
|
1225 |
file2.Close(); |
|
1226 |
TheFs.Delete( KTestFile1 ); |
|
1227 |
||
1228 |
||
1229 |
file.Close(); |
|
1230 |
r=TheFs.Delete(KFileFiller); |
|
189 | 1231 |
test_KErrNone(r); |
0 | 1232 |
} |
1233 |
||
1234 |
||
1235 |
void TestMultiple() |
|
1236 |
// |
|
1237 |
// test muliple requests and multiple sessions |
|
1238 |
// |
|
1239 |
{ |
|
1240 |
// create the filler file |
|
1241 |
RFile file; |
|
1242 |
TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
|
189 | 1243 |
test_KErrNone(r); |
0 | 1244 |
TInt64 free=FreeDiskSpace(KDefaultDrive); |
1245 |
TInt64 freeSpaceLeft = gMinFileSize << 4; // 512 * 2^4 = 512 * 16 = 8K |
|
1246 |
FillDisk(file,free-freeSpaceLeft,KDefaultDrive); |
|
1247 |
TInt size; |
|
1248 |
r=file.Size(size); |
|
189 | 1249 |
test_KErrNone(r); |
0 | 1250 |
test(size>1024); |
1251 |
test.Printf(_L("filler file size=0x%x\n"),size); |
|
1252 |
||
1253 |
// test multiple requests |
|
1254 |
test.Next(_L("test multiple requests")); |
|
1255 |
TThreadTask task = ETaskFileWrite4KB; |
|
1256 |
InitialiseForThread(task); |
|
1257 |
free=FreeDiskSpace(KDefaultDrive); |
|
1258 |
TInt64 threshold1=free-gMinFileSize; // 512; |
|
1259 |
TInt64 threshold2=free - (gMinFileSize << 2); // 512 * 4 = 2048; |
|
1260 |
#if defined(__WINS__) |
|
1261 |
TInt64 threshold3=free-70000; //NTFS over-allocates then reduces when file closed |
|
1262 |
#else |
|
1263 |
TInt64 threshold3=free - (gMinFileSize << 5); // 512 * 2^5 = 512 * 32 = 16K |
|
1264 |
#endif |
|
1265 |
TRequestStatus stat1,stat2,stat3; |
|
1266 |
TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
|
1267 |
TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
|
1268 |
TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
|
1269 |
test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
|
1270 |
RThread thread; |
|
1271 |
r=thread.Create(_L("thread1"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 1272 |
test_KErrNone(r); |
0 | 1273 |
TRequestStatus deathStat; |
1274 |
thread.Logon( deathStat ); |
|
1275 |
thread.Resume(); |
|
1276 |
User::After(1000000); |
|
1277 |
User::WaitForRequest(stat1); |
|
1278 |
User::WaitForRequest(stat2); |
|
1279 |
test(stat1==KErrNone && stat2==KErrNone); |
|
1280 |
test(stat3==KRequestPending); |
|
1281 |
free=FreeDiskSpace(KDefaultDrive); |
|
1282 |
test(free<threshold1 && free<threshold2 && free>threshold3); |
|
1283 |
TheFs.NotifyDiskSpaceCancel(stat3); |
|
1284 |
test(stat3==KErrCancel); |
|
1285 |
User::WaitForRequest( deathStat ); |
|
1286 |
thread.Close(); |
|
1287 |
CleanupForThread(task); |
|
1288 |
||
1289 |
// test multiple requests again |
|
1290 |
test.Next(_L("test multiple requests again")); |
|
1291 |
if( LffsDrive ) |
|
1292 |
{ |
|
1293 |
// SetSize doesn't use disk space on LFFS |
|
1294 |
test.Printf( _L("test skipped on LFFS drive\n") ); |
|
1295 |
} |
|
1296 |
else |
|
1297 |
{ |
|
1298 |
task=ETaskFileSetSize; |
|
1299 |
InitialiseForThread(task); // this also does initialisation for task2 |
|
1300 |
free=FreeDiskSpace(KDefaultDrive); |
|
1301 |
threshold1 = free + (gMinFileSize << 1); // 512 * 2 = 1024 |
|
1302 |
threshold2 = free + (gMinFileSize * 12); // 512 * 12 = 6144 |
|
1303 |
threshold3 = free - (gMinFileSize << 1); // 512 * 2 = 1024; |
|
1304 |
TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
|
1305 |
TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
|
1306 |
TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
|
1307 |
test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
|
1308 |
r=thread.Create(_L("thread2"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 1309 |
test_KErrNone(r); |
0 | 1310 |
thread.Logon( deathStat ); |
1311 |
thread.Resume(); |
|
1312 |
User::After(10000); |
|
1313 |
User::WaitForRequest(stat3); |
|
1314 |
test(stat3==KErrNone && stat1==KRequestPending && stat2==KRequestPending); |
|
1315 |
free=FreeDiskSpace(KDefaultDrive); |
|
1316 |
test(free<threshold1); |
|
1317 |
User::WaitForRequest( deathStat ); |
|
1318 |
thread.Close(); |
|
1319 |
CleanupForThread(task); |
|
1320 |
if(!IsWinsCDrive(KDefaultDrive)) |
|
1321 |
{ |
|
1322 |
free=FreeDiskSpace(KDefaultDrive); |
|
1323 |
test(stat1==KRequestPending && stat2==KRequestPending); |
|
1324 |
file.SetSize(size - (gMinFileSize << 2)); // 512 * 4 = 2048 |
|
1325 |
free=FreeDiskSpace(KDefaultDrive); |
|
1326 |
User::After(1000000); |
|
1327 |
User::WaitForRequest(stat1); |
|
1328 |
//User::WaitForRequest(stat2); |
|
1329 |
test(stat1==KErrNone && stat2==KRequestPending); |
|
1330 |
free=FreeDiskSpace(KDefaultDrive); |
|
1331 |
test(free>threshold1 && free<threshold2); |
|
1332 |
TheFs.NotifyDiskSpaceCancel(); |
|
1333 |
test(stat2==KErrCancel); |
|
1334 |
} |
|
1335 |
else |
|
1336 |
{ |
|
1337 |
TheFs.NotifyDiskSpaceCancel(); |
|
1338 |
test(stat1==KErrCancel&&stat2==KErrCancel&&stat3==KErrNone); |
|
1339 |
} |
|
1340 |
} |
|
1341 |
||
1342 |
// test multiple sessions all notified on disk space change |
|
1343 |
test.Next(_L("test multiple sessions on same drive")); |
|
1344 |
RFs ses2,ses3; |
|
1345 |
r=ses2.Connect(); |
|
189 | 1346 |
test_KErrNone(r); |
0 | 1347 |
r=ses3.Connect(); |
189 | 1348 |
test_KErrNone(r); |
0 | 1349 |
r=ses2.SetSessionPath(gSessionPath); |
189 | 1350 |
test_KErrNone(r); |
0 | 1351 |
r=ses3.SetSessionPath(gSessionPath); |
189 | 1352 |
test_KErrNone(r); |
0 | 1353 |
task=ETaskFileReplace; |
1354 |
InitialiseForThread(task); |
|
1355 |
free=FreeDiskSpace(KDefaultDrive); |
|
1356 |
test.Printf(_L("free space on default drive = 0x%x\n"),free); |
|
1357 |
threshold1=free+gMinFileSize; // 512 |
|
1358 |
threshold2=free+(gMinFileSize << 1); // 1024; |
|
1359 |
threshold3=free+(gMinFileSize << 2); // 2048; |
|
1360 |
TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
|
1361 |
ses2.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
|
1362 |
ses3.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
|
1363 |
test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
|
1364 |
r=thread.Create(_L("thread3"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 1365 |
test_KErrNone(r); |
0 | 1366 |
thread.Logon( deathStat ); |
1367 |
thread.Resume(); |
|
1368 |
User::After(1000000); |
|
1369 |
User::WaitForRequest(stat1); |
|
1370 |
User::WaitForRequest(stat2); |
|
1371 |
User::WaitForRequest(stat3); |
|
1372 |
test(stat1==KErrNone && stat2==KErrNone && stat3==KErrNone); |
|
1373 |
free=FreeDiskSpace(KDefaultDrive); |
|
1374 |
test(free>threshold1 && free>threshold2 && free>threshold3); |
|
1375 |
User::WaitForRequest( deathStat ); |
|
1376 |
thread.Close(); |
|
1377 |
CleanupForThread(task); |
|
1378 |
||
1379 |
// test NotifyDiskSpaceCancel() |
|
1380 |
test.Next(_L("test RFs:NotifyDiskSpaceCancel")); |
|
1381 |
free=FreeDiskSpace(KDefaultDrive); |
|
1382 |
TheFs.NotifyDiskSpace(free-100,KDefaultDrive,stat1); |
|
1383 |
ses2.NotifyDiskSpace(free-100,KDefaultDrive,stat2); |
|
1384 |
ses3.NotifyDiskSpace(free-100,KDefaultDrive,stat3); |
|
1385 |
test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
|
1386 |
TheFs.NotifyDiskSpaceCancel(); |
|
1387 |
test(stat1==KErrCancel&&stat2==KRequestPending&&stat3==KRequestPending); |
|
1388 |
ses2.NotifyDiskSpaceCancel(stat2); |
|
1389 |
test(stat2==KErrCancel&&stat3==KRequestPending); |
|
1390 |
ses3.NotifyDiskSpaceCancel(); |
|
1391 |
test(stat3==KErrCancel); |
|
1392 |
||
1393 |
if( !LffsDrive ) |
|
1394 |
{ |
|
1395 |
TInt sessionDrive; |
|
1396 |
r=RFs::CharToDrive(gSessionPath[0],sessionDrive); |
|
189 | 1397 |
test_KErrNone(r); |
0 | 1398 |
if(sessionDrive!=RemovableDrive) |
1399 |
{ |
|
1400 |
// first create a file on the removable drive |
|
1401 |
RFile file2; |
|
1402 |
TFileName file2name=RemovableDriveBuf; |
|
1403 |
file2name+=_L("F32-TST\\testfile1"); |
|
1404 |
TheFs.Delete(file2name); |
|
1405 |
r=file2.Create(TheFs,file2name,EFileShareAny|EFileWrite); |
|
189 | 1406 |
test_KErrNone(r); |
0 | 1407 |
r=file2.SetSize(KFileSize3); |
189 | 1408 |
test_KErrNone(r); |
0 | 1409 |
// test multiple sessions not notified on disk space change on wrong drive |
1410 |
test.Next(_L("test multiple sessions on different drives")); |
|
1411 |
task=ETaskFileReplace; |
|
1412 |
InitialiseForThread(task); |
|
1413 |
TInt64 freeDef=FreeDiskSpace(KDefaultDrive); |
|
1414 |
TInt64 freeRem=FreeDiskSpace(RemovableDrive); |
|
1415 |
threshold1=freeDef + (gMinFileSize << 1); // 1024; |
|
1416 |
threshold2=freeRem + (gMinFileSize << 1); // 1024; |
|
1417 |
TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
|
1418 |
ses2.NotifyDiskSpace(threshold2,RemovableDrive,stat2); |
|
1419 |
test(stat1==KRequestPending&&stat2==KRequestPending); |
|
1420 |
r=thread.Create(_L("thread4"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 1421 |
test_KErrNone(r); |
0 | 1422 |
thread.Logon( deathStat ); |
1423 |
thread.Resume(); |
|
1424 |
User::After(1000000); |
|
1425 |
User::WaitForRequest(stat1); |
|
1426 |
test(stat1==KErrNone && stat2==KRequestPending); |
|
1427 |
free=FreeDiskSpace(KDefaultDrive); |
|
1428 |
test(free>threshold1); |
|
1429 |
User::WaitForRequest( deathStat ); |
|
1430 |
thread.Close(); |
|
1431 |
CleanupForThread(task); |
|
1432 |
TheFs.NotifyDiskSpaceCancel(stat2); |
|
1433 |
test(stat2==KRequestPending); |
|
1434 |
ses2.NotifyDiskSpaceCancel(stat2); |
|
1435 |
test(stat2==KErrCancel); |
|
1436 |
file2.Close(); |
|
1437 |
r=TheFs.Delete(file2name); |
|
189 | 1438 |
test_KErrNone(r); |
0 | 1439 |
} |
1440 |
} |
|
1441 |
||
1442 |
ses2.Close(); |
|
1443 |
ses3.Close(); |
|
1444 |
||
1445 |
||
1446 |
file.Close(); |
|
1447 |
r=TheFs.Delete(KFileFiller); |
|
189 | 1448 |
test_KErrNone(r); |
0 | 1449 |
|
1450 |
} |
|
1451 |
||
1452 |
||
1453 |
void TestLffsMultiple() |
|
1454 |
// |
|
1455 |
// test muliple requests and multiple sessions speicifcally for LFFS drive |
|
1456 |
// |
|
1457 |
{ |
|
1458 |
// create the filler file |
|
1459 |
RFile file; |
|
1460 |
TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
|
189 | 1461 |
test_KErrNone(r); |
0 | 1462 |
TInt64 free=FreeDiskSpace(KDefaultDrive); |
1463 |
FillDisk(file,free-8192,KDefaultDrive); |
|
1464 |
TInt size; |
|
1465 |
r=file.Size(size); |
|
189 | 1466 |
test_KErrNone(r); |
0 | 1467 |
test.Printf(_L("filler file size=0x%x\n"),size); |
1468 |
||
1469 |
||
1470 |
// test multiple requests again |
|
1471 |
test.Next(_L("test multiple requests on LFFS") ); |
|
1472 |
||
1473 |
TThreadTask task=ETaskFileCreateLffs; |
|
1474 |
InitialiseForThread(task); // this also does initialisation for task2 |
|
1475 |
free=FreeDiskSpace(KDefaultDrive); |
|
1476 |
TInt64 threshold1=free+8192; |
|
1477 |
TInt64 threshold2=free+700; //increased threshold as LFFS, unpredicatably, can release drive space |
|
1478 |
TInt64 threshold3=free-64; |
|
1479 |
TRequestStatus stat1, stat2, stat3; |
|
1480 |
//test.Printf(_L("set up notifiers")); |
|
1481 |
TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
|
1482 |
TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
|
1483 |
TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3); |
|
1484 |
test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
|
1485 |
RThread thread; |
|
1486 |
r=thread.Create(_L("thread10"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 1487 |
test_KErrNone(r); |
0 | 1488 |
TRequestStatus deathStat; |
1489 |
thread.Logon( deathStat ); |
|
1490 |
// test.Printf(_L("Resuming other thread")); |
|
1491 |
thread.Resume(); |
|
1492 |
User::After(10000); |
|
1493 |
User::WaitForRequest(stat3); |
|
1494 |
test(stat3==KErrNone && stat1==KRequestPending && stat2==KRequestPending); |
|
1495 |
free=FreeDiskSpace(KDefaultDrive); |
|
1496 |
test(free<threshold1); |
|
1497 |
User::WaitForRequest( deathStat ); |
|
1498 |
thread.Close(); |
|
1499 |
CleanupForThread(task); |
|
1500 |
free=FreeDiskSpace(KDefaultDrive); |
|
1501 |
// test.Printf(_L("free =%d and %d"),free.Low(), free.High()); |
|
1502 |
// test.Printf(_L("stat1=%d, stat2=%d"),stat1,stat2); |
|
1503 |
test(stat1==KRequestPending && stat2==KRequestPending); |
|
1504 |
file.SetSize(6144); |
|
1505 |
User::After(1000000); |
|
1506 |
User::WaitForRequest(stat2); |
|
1507 |
test(stat1==KRequestPending && stat2==KErrNone); |
|
1508 |
free=FreeDiskSpace(KDefaultDrive); |
|
1509 |
test(free<threshold1 && free>threshold2); |
|
1510 |
TheFs.NotifyDiskSpaceCancel(); |
|
1511 |
User::WaitForRequest( stat1 ); |
|
1512 |
test(stat1==KErrCancel); |
|
1513 |
||
1514 |
||
1515 |
||
1516 |
TInt sessionDrive; |
|
1517 |
r=RFs::CharToDrive(gSessionPath[0],sessionDrive); |
|
189 | 1518 |
test_KErrNone(r); |
0 | 1519 |
if(sessionDrive!=EDriveC) |
1520 |
{ |
|
1521 |
// test multiple sessions not notified on disk space change on wrong drive |
|
1522 |
test.Next(_L("test multiple sessions on different drives")); |
|
1523 |
||
1524 |
RFs ses2,ses3; |
|
1525 |
r=ses2.Connect(); |
|
189 | 1526 |
test_KErrNone(r); |
0 | 1527 |
r=ses3.Connect(); |
189 | 1528 |
test_KErrNone(r); |
0 | 1529 |
r=ses2.SetSessionPath(gSessionPath); |
189 | 1530 |
test_KErrNone(r); |
0 | 1531 |
r=ses3.SetSessionPath(gSessionPath); |
189 | 1532 |
test_KErrNone(r); |
0 | 1533 |
|
1534 |
// first create a file on the C:\ drive |
|
1535 |
RFile file2; |
|
1536 |
TFileName file2name=_L("C:\\"); |
|
1537 |
file2name+=_L("F32-TST\\"); |
|
1538 |
r=TheFs.MkDir(file2name); |
|
1539 |
test( KErrNone==r || KErrAlreadyExists==r ); |
|
1540 |
file2name+=_L("testfile1"); |
|
1541 |
TheFs.Delete(file2name); |
|
1542 |
r=file2.Create(TheFs,file2name,EFileShareAny|EFileWrite); |
|
189 | 1543 |
test_KErrNone(r); |
0 | 1544 |
WriteToFile( file2, KFileSize3 ); |
1545 |
||
1546 |
task=ETaskFileReplace; |
|
1547 |
InitialiseForThread(task); |
|
1548 |
TInt64 freeLffs=FreeDiskSpace(KDefaultDrive); |
|
1549 |
TInt64 freeD=FreeDiskSpace(EDriveC); |
|
1550 |
threshold1=freeLffs+1024; |
|
1551 |
threshold2=freeD+1024; |
|
1552 |
TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
|
1553 |
ses2.NotifyDiskSpace(threshold2,EDriveC,stat2); |
|
1554 |
test(stat1==KRequestPending&&stat2==KRequestPending); |
|
1555 |
r=thread.Create(_L("thread11"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 1556 |
test_KErrNone(r); |
0 | 1557 |
thread.Logon( deathStat ); |
1558 |
thread.Resume(); |
|
1559 |
User::After(1000000); |
|
1560 |
User::WaitForRequest(stat1); |
|
1561 |
test(stat1==KErrNone && stat2==KRequestPending); |
|
1562 |
free=FreeDiskSpace(KDefaultDrive); |
|
1563 |
test(free>threshold1); |
|
1564 |
User::WaitForRequest( deathStat ); |
|
1565 |
thread.Close(); |
|
1566 |
CleanupForThread(task); |
|
1567 |
TheFs.NotifyDiskSpaceCancel(stat2); |
|
1568 |
test(stat2==KRequestPending); |
|
1569 |
ses2.NotifyDiskSpaceCancel(stat2); |
|
1570 |
User::WaitForRequest( stat2 ); |
|
1571 |
test(stat2==KErrCancel); |
|
1572 |
file2.Close(); |
|
1573 |
r=TheFs.Delete(file2name); |
|
189 | 1574 |
test_KErrNone(r); |
0 | 1575 |
ses2.Close(); |
1576 |
ses3.Close(); |
|
1577 |
} |
|
1578 |
||
1579 |
||
1580 |
||
1581 |
file.Close(); |
|
1582 |
r=TheFs.Delete(KFileFiller); |
|
189 | 1583 |
test_KErrNone(r); |
0 | 1584 |
|
1585 |
} |
|
1586 |
||
1587 |
||
1588 |
void TestChangeNotification() |
|
1589 |
// |
|
1590 |
// test that disk space notification works with (extended) change notification |
|
1591 |
// |
|
1592 |
{ |
|
1593 |
// create a filler file |
|
1594 |
RFile file; |
|
1595 |
TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO); |
|
189 | 1596 |
test_KErrNone(r); |
0 | 1597 |
TInt64 free=FreeDiskSpace(KDefaultDrive); |
1598 |
// use 8KB in filler file |
|
1599 |
FillDisk(file,free-8192,KDefaultDrive); |
|
1600 |
||
1601 |
// test change notification when no disk space change |
|
1602 |
test.Next(_L("test change notification")); |
|
1603 |
TThreadTask task = ETaskNoChange1; |
|
1604 |
InitialiseForThread(task); |
|
1605 |
free=FreeDiskSpace(KDefaultDrive); |
|
1606 |
TInt64 threshold1=free+gMinFileSize; |
|
1607 |
TInt64 threshold2=free-gMinFileSize; |
|
1608 |
TRequestStatus stat1,stat2,stat3; |
|
1609 |
TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); //more free space becoming available |
|
1610 |
TheFs.NotifyDiskSpace(threshold2,KDefaultDrive,stat2); |
|
1611 |
TheFs.NotifyChange(ENotifyAll,stat3); |
|
1612 |
test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
|
1613 |
RThread thread; |
|
1614 |
r=thread.Create(_L("thread1"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 1615 |
test_KErrNone(r); |
0 | 1616 |
TRequestStatus deathStat; |
1617 |
thread.Logon( deathStat ); |
|
1618 |
thread.Resume(); |
|
1619 |
User::After(1000000); |
|
1620 |
User::WaitForRequest(stat3); |
|
1621 |
if(!LffsDrive) |
|
1622 |
test(stat1==KRequestPending && stat2==KRequestPending && stat3==KErrNone); |
|
1623 |
else |
|
1624 |
test(stat2==KRequestPending && stat3==KErrNone); //As below |
|
1625 |
||
1626 |
TheFs.NotifyDiskSpaceCancel(); |
|
1627 |
if(!LffsDrive) |
|
1628 |
test(stat1==KErrCancel && stat2==KErrCancel); |
|
1629 |
else |
|
1630 |
test(stat2==KErrCancel); //is invalid for LFFS as can free up space un expectedly |
|
1631 |
||
1632 |
User::WaitForRequest( deathStat ); |
|
1633 |
thread.Close(); |
|
1634 |
CleanupForThread(task); |
|
1635 |
||
1636 |
// Have three different sessions |
|
1637 |
// do an operation that will cause the change notification |
|
1638 |
// and disk change notification to be signalled |
|
1639 |
test.Next(_L(" test change notification and disk space notification")); |
|
1640 |
RFs session2,session3; |
|
1641 |
r=session2.Connect(); |
|
189 | 1642 |
test_KErrNone(r); |
0 | 1643 |
r=session3.Connect(); |
189 | 1644 |
test_KErrNone(r); |
0 | 1645 |
r=session2.SetSessionPath(gSessionPath); |
189 | 1646 |
test_KErrNone(r); |
0 | 1647 |
r=session3.SetSessionPath(gSessionPath); |
189 | 1648 |
test_KErrNone(r); |
0 | 1649 |
task=ETaskFileWrite; |
1650 |
InitialiseForThread(task); |
|
1651 |
free=FreeDiskSpace(KDefaultDrive); |
|
1652 |
threshold1=free-400; |
|
1653 |
TheFs.NotifyDiskSpace(threshold1,KDefaultDrive,stat1); |
|
1654 |
session2.NotifyChange(ENotifyAll,stat2); |
|
1655 |
session3.NotifyChange(ENotifyAll,stat3,KTestFile1); |
|
1656 |
test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
|
1657 |
r=thread.Create(_L("thread2"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task); |
|
189 | 1658 |
test_KErrNone(r); |
0 | 1659 |
thread.Logon( deathStat ); |
1660 |
thread.Resume(); |
|
1661 |
User::After(1000000); |
|
1662 |
User::WaitForRequest(stat1); |
|
1663 |
User::WaitForRequest(stat2); |
|
1664 |
User::WaitForRequest(stat3); |
|
1665 |
test(stat1==KErrNone && stat2==KErrNone && stat3==KErrNone); |
|
1666 |
free=FreeDiskSpace(KDefaultDrive); |
|
1667 |
test(free<threshold1); |
|
1668 |
User::WaitForRequest( deathStat ); |
|
1669 |
thread.Close(); |
|
1670 |
CleanupForThread(task); |
|
1671 |
||
1672 |
// check cancellation of change notification and disk space notification |
|
1673 |
// on same session |
|
1674 |
test.Next(_L("test cancellation of notifications")); |
|
1675 |
TheFs.NotifyDiskSpace(FreeDiskSpace(KDefaultDrive)-512,KDefaultDrive,stat1); |
|
1676 |
TheFs.NotifyChange(ENotifyAll,stat2); |
|
1677 |
TheFs.NotifyChange(ENotifyAll,stat3,KTestFile1); |
|
1678 |
test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
|
1679 |
TheFs.NotifyChangeCancel(); |
|
1680 |
test(stat1==KRequestPending&&stat2==KErrCancel&&stat3==KErrCancel); |
|
1681 |
TheFs.NotifyDiskSpaceCancel(); |
|
1682 |
test(stat1==KErrCancel); |
|
1683 |
// request change notification again |
|
1684 |
TheFs.NotifyDiskSpace(FreeDiskSpace(KDefaultDrive)-512,KDefaultDrive,stat1); |
|
1685 |
TheFs.NotifyChange(ENotifyAll,stat2); |
|
1686 |
TheFs.NotifyChange(ENotifyAll,stat3,KTestFile1); |
|
1687 |
test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending); |
|
1688 |
TheFs.NotifyDiskSpaceCancel(); |
|
1689 |
test(stat1==KErrCancel&&stat2==KRequestPending&&stat3==KRequestPending); |
|
1690 |
TheFs.NotifyChangeCancel(); |
|
1691 |
test(stat1==KErrCancel&&stat2==KErrCancel&&stat3==KErrCancel); |
|
1692 |
||
1693 |
||
1694 |
session2.Close(); |
|
1695 |
session3.Close(); |
|
1696 |
||
1697 |
file.Close(); |
|
1698 |
r=TheFs.Delete(KFileFiller); |
|
189 | 1699 |
test_KErrNone(r); |
0 | 1700 |
|
1701 |
} |
|
1702 |
||
231 | 1703 |
//------------------------------------------------------------------------------------------------- |
1704 |
// Test the fix for: |
|
1705 |
// ou1cimx#410349 Not getting any Notification from RFs::NotifyDiskSpace() for E and F drive when when tested multiple |
|
1706 |
// |
|
1707 |
// Action: Enable a plugin to intercept RFs::Delete, and test RFs::Delet can still trigger disk space |
|
1708 |
// notification |
|
1709 |
//------------------------------------------------------------------------------------------------- |
|
1710 |
||
1711 |
_LIT(KPreModifierPluginFileName,"premodifier_plugin"); |
|
1712 |
_LIT(KPreModifierPluginName,"PreModifierPlugin"); |
|
1713 |
const TUint KTestFileSize = KKilo * 100; |
|
1714 |
||
1715 |
#define SAFETEST_KErrNone(a) if(a != KErrNone)\ |
|
1716 |
{\ |
|
1717 |
TheFs.DismountPlugin(KPreModifierPluginName);\ |
|
1718 |
TheFs.RemovePlugin(KPreModifierPluginName);\ |
|
1719 |
test_KErrNone(a);\ |
|
1720 |
} |
|
1721 |
||
1722 |
TInt PluginTestThreadFunction(TAny*) |
|
1723 |
{ |
|
1724 |
RTest test(_L("PluginTestThreadFunction")); |
|
1725 |
RFs fs; |
|
1726 |
fs.Connect(); |
|
1727 |
||
1728 |
TInt r = fs.SetSessionPath(gSessionPath); |
|
1729 |
test_KErrNone(r); |
|
1730 |
||
1731 |
RFile file; |
|
1732 |
r = file.Create(fs, KTestFile1, EFileShareAny|EFileWrite); |
|
1733 |
test_KErrNone(r); |
|
1734 |
r = file.SetSize(KTestFileSize); |
|
1735 |
test_KErrNone(r); |
|
1736 |
file.Close(); |
|
1737 |
||
1738 |
User::After(5000000); // wait for 5 seconds, to ensure first notification received. |
|
1739 |
||
1740 |
r = fs.Delete(KTestFile1); |
|
1741 |
test_KErrNone(r); |
|
1742 |
||
1743 |
fs.Close(); |
|
1744 |
return KErrNone; |
|
1745 |
} |
|
1746 |
||
1747 |
void TestDiskSpaceNotifyWithPlugin() |
|
1748 |
{ |
|
1749 |
test.Next(_L("Test Disk Space Notify With Plugin")); |
|
1750 |
||
1751 |
TInt drive; |
|
1752 |
TInt r = RFs::CharToDrive(gSessionPath[0],drive); |
|
1753 |
SAFETEST_KErrNone(r); |
|
1754 |
Format(drive); |
|
1755 |
||
1756 |
r = TheFs.MkDirAll(gSessionPath); |
|
1757 |
SAFETEST_KErrNone(r); |
|
1758 |
||
1759 |
r = TheFs.AddPlugin(KPreModifierPluginFileName); |
|
1760 |
SAFETEST_KErrNone(r); |
|
1761 |
||
1762 |
r = TheFs.MountPlugin(KPreModifierPluginName); |
|
1763 |
SAFETEST_KErrNone(r); |
|
1764 |
||
1765 |
TInt64 free = FreeDiskSpace(drive); |
|
1766 |
TInt64 threshold = free - KTestFileSize + 1; |
|
1767 |
||
1768 |
TRequestStatus status; |
|
1769 |
TRequestStatus statusDeath; |
|
1770 |
||
1771 |
TheFs.NotifyDiskSpace(threshold, drive, status); |
|
1772 |
||
1773 |
RThread thread; |
|
1774 |
r = thread.Create(_L("PluginTestThread"), PluginTestThreadFunction, KStackSize, KHeapSize, KHeapSize, NULL); |
|
1775 |
SAFETEST_KErrNone(r); |
|
1776 |
thread.Logon(statusDeath); |
|
1777 |
thread.Resume(); |
|
1778 |
||
1779 |
User::WaitForRequest(status); |
|
1780 |
SAFETEST_KErrNone(status.Int()); |
|
1781 |
||
1782 |
TheFs.NotifyDiskSpace(threshold, drive, status); |
|
1783 |
User::WaitForRequest(status); |
|
1784 |
SAFETEST_KErrNone(status.Int()); |
|
1785 |
||
1786 |
User::WaitForRequest(statusDeath); |
|
1787 |
SAFETEST_KErrNone(statusDeath.Int()); |
|
1788 |
thread.Close(); |
|
1789 |
||
1790 |
r = TheFs.DismountPlugin(KPreModifierPluginName); |
|
1791 |
SAFETEST_KErrNone(r); |
|
1792 |
||
1793 |
r = TheFs.RemovePlugin(KPreModifierPluginName); |
|
1794 |
SAFETEST_KErrNone(r); |
|
1795 |
||
1796 |
Format(drive); |
|
1797 |
} |
|
1798 |
||
0 | 1799 |
GLDEF_C void CallTestsL() |
1800 |
// |
|
1801 |
// Do all tests |
|
1802 |
// |
|
1803 |
{ |
|
1804 |
TInt r = KErrNone; |
|
1805 |
TInt driveNumber; |
|
1806 |
if(IsTestingLFFS()) |
|
1807 |
{ |
|
1808 |
LffsDrive = ETrue; |
|
1809 |
r = TheFs.CharToDrive( gSessionPath[0], driveNumber ); |
|
1810 |
test( KErrNone == r ); |
|
1811 |
} |
|
1812 |
||
1813 |
// at present internal ram drive not tested - the test should allow for fact |
|
1814 |
// that memory allocation will affect the free disk space on the internal ram drive |
|
1815 |
||
1816 |
// pc file system c drive is also not tested - the test should allow for the fact |
|
1817 |
// that other windows processes may affect the free disk space |
|
1818 |
#ifdef __WINS__ |
|
1819 |
if(gSessionPath[0]==(TText)'C') |
|
1820 |
#else |
|
1821 |
// check if gSessionPath drive is RAM drive |
|
1822 |
TDriveInfo driveInfo; |
|
1823 |
test(KErrNone == TheFs.CharToDrive(gSessionPath[0], driveNumber)); |
|
1824 |
test(KErrNone == TheFs.Drive(driveInfo, driveNumber)); |
|
1825 |
if(driveInfo.iType == EMediaRam) |
|
1826 |
#endif |
|
1827 |
{ |
|
1828 |
#ifdef __WINS__ |
|
1829 |
test.Printf( _L("C:\\ is not tested, test will exit") ); |
|
1830 |
#else |
|
1831 |
test.Printf( _L("%c:\\ is not tested (is RAM drive), test will exit"), gSessionPath[0]); |
|
1832 |
#endif |
|
1833 |
return; |
|
1834 |
} |
|
1835 |
//Test uses C drive as secondary drive so test can't be tested on that drive |
|
1836 |
r = TheFs.CharToDrive(gSessionPath[0], driveNumber); |
|
189 | 1837 |
test_KErrNone(r); |
0 | 1838 |
if(driveNumber == EDriveC) |
1839 |
{ |
|
1840 |
test.Printf(_L("Test uses C drive as secondary drive so test can't be test on C drive, test will exit")); |
|
1841 |
return; |
|
1842 |
} |
|
1843 |
||
1844 |
Initialise(); |
|
1845 |
TestErrorConditions(); |
|
1846 |
TestCancellation(); |
|
1847 |
TestFunctions(); |
|
1848 |
TestMultiple(); |
|
1849 |
if( !LffsDrive ) |
|
1850 |
{ |
|
1851 |
TestDiskNotify(); |
|
1852 |
} |
|
1853 |
||
1854 |
TestChangeNotification(); |
|
231 | 1855 |
TestDiskSpaceNotifyWithPlugin(); |
0 | 1856 |
|
1857 |
if( LffsDrive ) |
|
1858 |
{ |
|
1859 |
||
1860 |
TestLffsFunctions(); |
|
1861 |
TestLffsMultiple(); |
|
1862 |
} |
|
1863 |
} |
|
1864 |