175 |
176 |
176 TBuf<20> filename; |
177 TBuf<20> filename; |
177 filename.Append(_L("media.change1")); |
178 filename.Append(_L("media.change1")); |
178 |
179 |
179 r = notify->AddNotification((TUint)TFsNotification::ECreate,path,filename); |
180 r = notify->AddNotification((TUint)TFsNotification::ECreate,path,filename); |
180 test(r==KErrNone); |
181 test_KErrNone(r); |
181 |
182 |
182 TRequestStatus status; |
183 TRequestStatus status; |
183 r = notify->RequestNotifications(status); |
184 r = notify->RequestNotifications(status); |
184 test(r==KErrNone); |
185 test_KErrNone(r); |
185 |
186 |
186 test.Printf(_L("*****************************************************************\n")); |
187 test.Printf(_L("*****************************************************************\n")); |
187 test.Printf(_L("Waiting 10 seconds.\n")); |
188 test.Printf(_L("Waiting 10 seconds.\n")); |
188 test.Printf(_L("This is a MANUAL test, it requires the removal of the media card.\n")); |
189 test.Printf(_L("This is a MANUAL test, it requires the removal of the media card.\n")); |
189 test.Printf(_L("PLEASE REMOVE THE MEDIA CARD. (DriveNumber %d)\n"),globalDriveNum); |
190 test.Printf(_L("PLEASE REMOVE THE MEDIA CARD. (DriveNumber %d)\n"),globalDriveNum); |
190 test.Printf(_L("Or press Ctrl + F5 on the emulator.\n")); |
191 test.Printf(_L("Or press Ctrl + F5 on the emulator.\n")); |
191 test.Printf(_L("*****************************************************************\n")); |
192 test.Printf(_L("*****************************************************************\n")); |
192 RTimer timer1; |
193 RTimer timer1; |
193 r = timer1.CreateLocal(); |
194 r = timer1.CreateLocal(); |
194 test(r == KErrNone); |
195 test_KErrNone(r); |
195 TRequestStatus timeout; |
196 TRequestStatus timeout; |
196 TTimeIntervalMicroSeconds32 time = 10000000; |
197 TTimeIntervalMicroSeconds32 time = 10000000; |
197 timer1.After(timeout,time); |
198 timer1.After(timeout,time); |
198 User::WaitForRequest(timeout,status); |
199 User::WaitForRequest(timeout,status); |
199 test(status.Int() != KRequestPending); |
200 test(status.Int() != KRequestPending); |
273 TBuf<40> fullname; |
274 TBuf<40> fullname; |
274 fullname.Append(path); |
275 fullname.Append(path); |
275 fullname.Append(filename); |
276 fullname.Append(filename); |
276 |
277 |
277 r = notify1->AddNotification((TUint)TFsNotification::ECreate,path,filename); |
278 r = notify1->AddNotification((TUint)TFsNotification::ECreate,path,filename); |
278 test(r==KErrNone); |
279 test_KErrNone(r); |
279 r = notify2->AddNotification((TUint)TFsNotification::ECreate,path,filename); |
280 r = notify2->AddNotification((TUint)TFsNotification::ECreate,path,filename); |
280 test(r==KErrNone); |
281 test_KErrNone(r); |
281 |
282 |
282 delete notify1; //Delete notify1 and ensure we still get notification on notify2 |
283 delete notify1; //Delete notify1 and ensure we still get notification on notify2 |
283 |
284 |
284 TRequestStatus status; |
285 TRequestStatus status; |
285 r = notify2->RequestNotifications(status); |
286 r = notify2->RequestNotifications(status); |
286 test(r==KErrNone); |
287 test_KErrNone(r); |
287 |
288 |
288 RFile file; |
289 RFile file; |
289 file.Replace(fs,fullname,EFileWrite); //Replace produces Create notification |
290 file.Replace(fs,fullname,EFileWrite); //Replace produces Create notification |
290 file.Close(); |
291 file.Close(); |
291 |
292 |
292 RTimer tim; |
293 RTimer tim; |
293 r = tim.CreateLocal(); |
294 r = tim.CreateLocal(); |
294 test(r==KErrNone); |
295 test_KErrNone(r); |
295 |
296 |
296 TRequestStatus timStatus; |
297 TRequestStatus timStatus; |
297 TTimeIntervalMicroSeconds32 time = 10000000; //10 seconds |
298 TTimeIntervalMicroSeconds32 time = 10000000; //10 seconds |
298 tim.After(timStatus,time); |
299 tim.After(timStatus,time); |
299 |
300 |
300 User::WaitForRequest(status,timStatus); |
301 User::WaitForRequest(status,timStatus); |
301 test(status!=KRequestPending); |
302 test(status!=KRequestPending); |
302 |
303 |
303 r = fs.Delete(fullname); |
304 r = fs.Delete(fullname); |
304 test(r==KErrNone); |
305 test_KErrNone(r); |
305 |
306 |
306 delete notify2; |
307 delete notify2; |
307 tim.Close(); |
308 tim.Close(); |
308 fs.Close(); |
309 fs.Close(); |
309 return KErrNone; |
310 return KErrNone; |
322 fs.Connect(); |
323 fs.Connect(); |
323 |
324 |
324 CFsNotify* notify = NULL; |
325 CFsNotify* notify = NULL; |
325 |
326 |
326 TRAPD(r,notify = CFsNotify::NewL(fs,KMinNotificationBufferSize);); |
327 TRAPD(r,notify = CFsNotify::NewL(fs,KMinNotificationBufferSize);); |
327 test(r==KErrNone); |
328 test_KErrNone(r); |
328 test(notify!=NULL); |
329 test(notify!=NULL); |
329 |
330 |
330 TBuf<40> path; |
331 TBuf<40> path; |
331 path.Append((TChar)gDriveToTest); |
332 path.Append((TChar)gDriveToTest); |
332 path.Append(_L(":\\")); |
333 path.Append(_L(":\\")); |
333 |
334 |
334 TBuf<15> filename; |
335 TBuf<15> filename; |
335 filename.Append(_L("*")); |
336 filename.Append(_L("*")); |
336 |
337 |
337 r = notify->AddNotification((TUint)TFsNotification::ECreate,path,filename); |
338 r = notify->AddNotification((TUint)TFsNotification::ECreate,path,filename); |
338 test(r==KErrNone); |
339 test_KErrNone(r); |
339 |
340 |
340 TRequestStatus status; |
341 TRequestStatus status; |
341 r = notify->RequestNotifications(status); |
342 r = notify->RequestNotifications(status); |
342 test(r==KErrNone); |
343 test_KErrNone(r); |
343 |
344 |
344 RFile file; |
345 RFile file; |
345 TBuf<40> filePath; |
346 TBuf<40> filePath; |
346 filePath.Append((TChar)gDriveToTest); |
347 filePath.Append((TChar)gDriveToTest); |
347 filePath.Append(_L(":\\file.root")); |
348 filePath.Append(_L(":\\file.root")); |
348 r = file.Replace(fs,filePath,EFileRead); |
349 r = file.Replace(fs,filePath,EFileRead); |
349 test(r==KErrNone); |
350 test_KErrNone(r); |
350 file.Close(); |
351 file.Close(); |
351 |
352 |
352 TRequestStatus s2; |
353 TRequestStatus s2; |
353 RTimer tim; |
354 RTimer tim; |
354 test(tim.CreateLocal()==KErrNone); |
355 test(tim.CreateLocal()==KErrNone); |
1956 User::LeaveIfError(package.iBarrier.CreateLocal(0)); |
1957 User::LeaveIfError(package.iBarrier.CreateLocal(0)); |
1957 RThread watcher; |
1958 RThread watcher; |
1958 RThread doer; |
1959 RThread doer; |
1959 |
1960 |
1960 TInt r = watcher.Create(_L("TestTwoNotificationsWatcherThread"),MultipleNotificationsTFWatcher,KDefaultStackSize,KMinHeapSize,KMaxHeapSize,&package); |
1961 TInt r = watcher.Create(_L("TestTwoNotificationsWatcherThread"),MultipleNotificationsTFWatcher,KDefaultStackSize,KMinHeapSize,KMaxHeapSize,&package); |
1961 test(r==KErrNone); |
1962 test_KErrNone(r); |
1962 r = doer.Create(_L("TestTwoNotificationsDoerThread"),TwoNotificationsTFDoer,KDefaultStackSize,KMinHeapSize,KMaxHeapSize,&package); |
1963 r = doer.Create(_L("TestTwoNotificationsDoerThread"),TwoNotificationsTFDoer,KDefaultStackSize,KMinHeapSize,KMaxHeapSize,&package); |
1963 test(r==KErrNone); |
1964 test_KErrNone(r); |
1964 test.Next(_L("TestTwoNotifications - Resume Watcher")); |
1965 test.Next(_L("TestTwoNotifications - Resume Watcher")); |
1965 watcher.Resume(); |
1966 watcher.Resume(); |
1966 test.Next(_L("TestTwoNotifications - Wait for Watcher to be ready")); |
1967 test.Next(_L("TestTwoNotifications - Wait for Watcher to be ready")); |
1967 package.iBarrier.Wait(); //Wait till Watcher has requested notification |
1968 package.iBarrier.Wait(); //Wait till Watcher has requested notification |
1968 test.Next(_L("TestTwoNotifications - Resume Doer")); |
1969 test.Next(_L("TestTwoNotifications - Resume Doer")); |
2620 User::LeaveIfError(package.iBarrier2.CreateLocal(0)); |
2621 User::LeaveIfError(package.iBarrier2.CreateLocal(0)); |
2621 RThread watcher; |
2622 RThread watcher; |
2622 RThread doer; |
2623 RThread doer; |
2623 |
2624 |
2624 TInt r = watcher.Create(_L("TestCancelNotification-WatcherThread"),TestCancelNotificationWatcher,KDefaultStackSize*2,KMinHeapSize,KMaxHeapSize,&package); |
2625 TInt r = watcher.Create(_L("TestCancelNotification-WatcherThread"),TestCancelNotificationWatcher,KDefaultStackSize*2,KMinHeapSize,KMaxHeapSize,&package); |
2625 test(r == KErrNone); |
2626 test_KErrNone(r); |
2626 r = doer.Create(_L("TestCancelNotification-DoerThread"),SimpleSingleNotificationTFDoer,KDefaultStackSize*2,KMinHeapSize,KMaxHeapSize,&package); |
2627 r = doer.Create(_L("TestCancelNotification-DoerThread"),SimpleSingleNotificationTFDoer,KDefaultStackSize*2,KMinHeapSize,KMaxHeapSize,&package); |
2627 test(r == KErrNone); |
2628 test_KErrNone(r); |
2628 test.Printf(_L("TestCancelNotificationL - Watcher.Resume()")); |
2629 test.Printf(_L("TestCancelNotificationL - Watcher.Resume()")); |
2629 watcher.Resume(); |
2630 watcher.Resume(); |
2630 test.Printf(_L("TestCancelNotificationL - Waiting on package.iBarrier.Wait()")); |
2631 test.Printf(_L("TestCancelNotificationL - Waiting on package.iBarrier.Wait()")); |
2631 package.iBarrier.Wait(); //W1 - Wait until Watcher has created CFsNotify |
2632 package.iBarrier.Wait(); //W1 - Wait until Watcher has created CFsNotify |
2632 test.Printf(_L("TestCancelNotificationL -Doer Resume")); |
2633 test.Printf(_L("TestCancelNotificationL -Doer Resume")); |
3249 path.Append((TChar)gDriveToTest); |
3250 path.Append((TChar)gDriveToTest); |
3250 path.Append(_L(":\\F32-TST\\T_NOTIFIER\\")); |
3251 path.Append(_L(":\\F32-TST\\T_NOTIFIER\\")); |
3251 path.Append(watcher1Pkg.iFileName); |
3252 path.Append(watcher1Pkg.iFileName); |
3252 RFile file; |
3253 RFile file; |
3253 r = file.Open(fs,path,EFileWrite); |
3254 r = file.Open(fs,path,EFileWrite); |
3254 test(r==KErrNone); |
3255 test_KErrNone(r); |
3255 |
3256 |
3256 r = file.SetSize(1); |
3257 r = file.SetSize(1); |
3257 test(r==KErrNone); |
3258 test_KErrNone(r); |
3258 r = file.SetSize(2); |
3259 r = file.SetSize(2); |
3259 test(r==KErrNone); |
3260 test_KErrNone(r); |
3260 r = file.SetSize(3); |
3261 r = file.SetSize(3); |
3261 test(r==KErrNone); |
3262 test_KErrNone(r); |
3262 file.Close(); |
3263 file.Close(); |
3263 |
3264 |
3264 watcher1Pkg.iBarrier.Signal(); // Signal post operations complete (Sx) |
3265 watcher1Pkg.iBarrier.Signal(); // Signal post operations complete (Sx) |
3265 |
3266 |
3266 RTimer tim; |
3267 RTimer tim; |
3267 r = tim.CreateLocal(); |
3268 r = tim.CreateLocal(); |
3268 test(r==KErrNone); |
3269 test_KErrNone(r); |
3269 TRequestStatus timStatus; |
3270 TRequestStatus timStatus; |
3270 |
3271 |
3271 test.Next(_L("TestOverflow - Wait for watcher1 thread death")); |
3272 test.Next(_L("TestOverflow - Wait for watcher1 thread death")); |
3272 TTimeIntervalMicroSeconds32 interval = 10000000; //10 seconds |
3273 TTimeIntervalMicroSeconds32 interval = 10000000; //10 seconds |
3273 tim.After(timStatus,interval); |
3274 tim.After(timStatus,interval); |
3305 void TestNonDriveFilters() |
3306 void TestNonDriveFilters() |
3306 { |
3307 { |
3307 test.Next(_L("TestNonDriveFilters")); |
3308 test.Next(_L("TestNonDriveFilters")); |
3308 RFs fs; |
3309 RFs fs; |
3309 TInt r = fs.Connect(); |
3310 TInt r = fs.Connect(); |
3310 test(r==KErrNone); |
3311 test_KErrNone(r); |
3311 |
3312 |
3312 TDriveList drives; |
3313 TDriveList drives; |
3313 r = fs.DriveList(drives); |
3314 r = fs.DriveList(drives); |
3314 test(r==KErrNone); |
3315 test_KErrNone(r); |
3315 |
3316 |
3316 CFsNotify* notify = NULL; |
3317 CFsNotify* notify = NULL; |
3317 TRAP(r,notify= CFsNotify::NewL(fs,KMinNotificationBufferSize)); |
3318 TRAP(r,notify= CFsNotify::NewL(fs,KMinNotificationBufferSize)); |
3318 |
3319 |
3319 TBuf<20> testfile; |
3320 TBuf<20> testfile; |
3320 testfile.Append(_L("test.file")); |
3321 testfile.Append(_L("test.file")); |
3321 |
3322 |
3322 r = notify->AddNotification((TUint)TFsNotification::ECreate,_L(""),testfile); |
3323 r = notify->AddNotification((TUint)TFsNotification::ECreate,_L(""),testfile); |
3323 test(r==KErrNone); |
3324 test_KErrNone(r); |
3324 |
3325 |
3325 TRequestStatus status; |
3326 TRequestStatus status; |
3326 r = notify->RequestNotifications(status); |
3327 r = notify->RequestNotifications(status); |
3327 test(r==KErrNone); |
3328 test_KErrNone(r); |
3328 |
3329 |
3329 TBuf<40> path; |
3330 TBuf<40> path; |
3330 path.Append((TChar)gDriveToTest); |
3331 path.Append((TChar)gDriveToTest); |
3331 path.Append(_L(":\\F32-TST\\T_NOTIFIER\\")); |
3332 path.Append(_L(":\\F32-TST\\T_NOTIFIER\\")); |
3332 |
3333 |
3380 |
3381 |
3381 const TFsNotification* notification = notify->NextNotification(); |
3382 const TFsNotification* notification = notify->NextNotification(); |
3382 test(notification != NULL); |
3383 test(notification != NULL); |
3383 TPtrC _path; |
3384 TPtrC _path; |
3384 r = notification->Path(_path); |
3385 r = notification->Path(_path); |
3385 test(r==KErrNone); |
3386 test_KErrNone(r); |
3386 TChar driveletter = _path[0]; |
3387 TChar driveletter = _path[0]; |
3387 driveletter.UpperCase(); |
3388 driveletter.UpperCase(); |
3388 test(driveletter == (TChar)gDriveToTest); |
3389 test(driveletter == (TChar)gDriveToTest); |
3389 |
3390 |
3390 if(notification = notify->NextNotification(), notification==NULL) |
3391 if(notification = notify->NextNotification(), notification==NULL) |
3391 { |
3392 { |
3392 TRequestStatus status2; |
3393 TRequestStatus status2; |
3393 r = notify->RequestNotifications(status2); |
3394 r = notify->RequestNotifications(status2); |
3394 test(r==KErrNone); |
3395 test_KErrNone(r); |
3395 |
3396 |
3396 RTimer timer2; |
3397 RTimer timer2; |
3397 r = timer2.CreateLocal(); |
3398 r = timer2.CreateLocal(); |
3398 test(r == KErrNone); |
3399 test_KErrNone(r); |
3399 TRequestStatus timeout2; |
3400 TRequestStatus timeout2; |
3400 TTimeIntervalMicroSeconds32 time2 = 10000000; //10 seconds |
3401 TTimeIntervalMicroSeconds32 time2 = 10000000; //10 seconds |
3401 timer2.After(timeout2,time2); |
3402 timer2.After(timeout2,time2); |
3402 User::WaitForRequest(timeout2,status2); |
3403 User::WaitForRequest(timeout2,status2); |
3403 test(status2.Int() != KRequestPending); |
3404 test(status2.Int() != KRequestPending); |
3421 // We receive no notifications for files changed under the directory |
3422 // We receive no notifications for files changed under the directory |
3422 void NegativeTestDirStar() |
3423 void NegativeTestDirStar() |
3423 { |
3424 { |
3424 RFs fs; |
3425 RFs fs; |
3425 TInt r = fs.Connect(); |
3426 TInt r = fs.Connect(); |
3426 test(r==KErrNone); |
3427 test_KErrNone(r); |
3427 |
3428 |
3428 CFsNotify* notify = NULL; |
3429 CFsNotify* notify = NULL; |
3429 TRAP(r,notify= CFsNotify::NewL(fs,KMinNotificationBufferSize)); |
3430 TRAP(r,notify= CFsNotify::NewL(fs,KMinNotificationBufferSize)); |
3430 |
3431 |
3431 TBuf<40> path; |
3432 TBuf<40> path; |
3432 path.Append((TChar)gDriveToTest); |
3433 path.Append((TChar)gDriveToTest); |
3433 path.Append(_L(":\\F32-TST\\T_NOTIFIER\\")); |
3434 path.Append(_L(":\\F32-TST\\T_NOTIFIER\\")); |
3434 r = fs.MkDirAll(path); |
3435 r = fs.MkDirAll(path); |
3435 test(r == KErrNone || r == KErrAlreadyExists); |
3436 test_Value(r, r == KErrNone || r == KErrAlreadyExists); |
3436 |
3437 |
3437 r = notify->AddNotification((TUint)TFsNotification::ECreate,path,_L("")); |
3438 r = notify->AddNotification((TUint)TFsNotification::ECreate,path,_L("")); |
3438 test(r==KErrNone); |
3439 test_KErrNone(r); |
3439 |
3440 |
3440 TRequestStatus status; |
3441 TRequestStatus status; |
3441 r = notify->RequestNotifications(status); |
3442 r = notify->RequestNotifications(status); |
3442 test(r==KErrNone); |
3443 test_KErrNone(r); |
3443 |
3444 |
3444 TBuf<40> filename; |
3445 TBuf<40> filename; |
3445 filename.Append((TChar)gDriveToTest); |
3446 filename.Append((TChar)gDriveToTest); |
3446 filename.Append(_L(":\\F32-TST\\T_NOTIFIER\\dir.star")); |
3447 filename.Append(_L(":\\F32-TST\\T_NOTIFIER\\dir.star")); |
3447 |
3448 |
3448 RFile file; |
3449 RFile file; |
3449 r = file.Replace(fs,filename,EFileWrite); |
3450 r = file.Replace(fs,filename,EFileWrite); |
3450 test(r==KErrNone); |
3451 test_KErrNone(r); |
3451 file.Close(); |
3452 file.Close(); |
3452 |
3453 |
3453 RTimer timer1; |
3454 RTimer timer1; |
3454 r = timer1.CreateLocal(); |
3455 r = timer1.CreateLocal(); |
3455 test(r == KErrNone); |
3456 test_KErrNone(r); |
3456 TRequestStatus timeout; |
3457 TRequestStatus timeout; |
3457 TTimeIntervalMicroSeconds32 time = 2000000; //2 seconds |
3458 TTimeIntervalMicroSeconds32 time = 2000000; //2 seconds |
3458 timer1.After(timeout,time); |
3459 timer1.After(timeout,time); |
3459 User::WaitForRequest(timeout,status); |
3460 User::WaitForRequest(timeout,status); |
3460 test(status.Int() == KRequestPending); |
3461 test(status.Int() == KRequestPending); |
3492 delete notify; |
3493 delete notify; |
3493 notify = NULL; |
3494 notify = NULL; |
3494 |
3495 |
3495 test.Printf(_L("NegativeTests() C\n")); |
3496 test.Printf(_L("NegativeTests() C\n")); |
3496 TRAP(r,notify = CFsNotify::NewL(fs,KMaxTInt)); |
3497 TRAP(r,notify = CFsNotify::NewL(fs,KMaxTInt)); |
3497 test(r==KErrArgument); |
3498 test_Value(r, r == KErrArgument); |
3498 test(notify==NULL); |
3499 test(notify==NULL); |
3499 |
3500 |
3500 //3 |
3501 //3 |
3501 test.Printf(_L("NegativeTests() D\n")); |
3502 test.Printf(_L("NegativeTests() D\n")); |
3502 TBuf<40> path; |
3503 TBuf<40> path; |
3503 path.Append((TChar)gDriveToTest); |
3504 path.Append((TChar)gDriveToTest); |
3504 path.Append(_L(":\\F32-TST\\T_NOTIFIER\\")); |
3505 path.Append(_L(":\\F32-TST\\T_NOTIFIER\\")); |
3505 TBuf<20> filename; |
3506 TBuf<20> filename; |
3506 filename.Append(_L("file.txt")); |
3507 filename.Append(_L("file.txt")); |
3507 TRAP(r,notify = CFsNotify::NewL(fs,KMinNotificationBufferSize)); |
3508 TRAP(r,notify = CFsNotify::NewL(fs,KMinNotificationBufferSize)); |
3508 test(r==KErrNone); |
3509 test_KErrNone(r); |
3509 test(notify!=NULL); |
3510 test(notify!=NULL); |
3510 r = notify->AddNotification(0,path,filename); |
3511 r = notify->AddNotification(0,path,filename); |
3511 test(r == KErrArgument); |
3512 test_Value(r, r == KErrArgument); |
3512 |
3513 |
3513 test.Printf(_L("NegativeTests() E\n")); |
3514 test.Printf(_L("NegativeTests() E\n")); |
3514 r = notify->AddNotification((TUint)0x8000,path,filename); //invalid value |
3515 r = notify->AddNotification((TUint)0x8000,path,filename); //invalid value |
3515 test(r == KErrArgument); |
3516 test_Value(r, r == KErrArgument); |
3516 |
3517 |
3517 test.Printf(_L("NegativeTests() F\n")); |
3518 test.Printf(_L("NegativeTests() F\n")); |
3518 TBuf<40> invalidPath; |
3519 TBuf<40> invalidPath; |
3519 invalidPath.Append(_L("1:\\*")); |
3520 invalidPath.Append(_L("1:\\*")); |
3520 r = notify->AddNotification((TUint)TFsNotification::ECreate,invalidPath,filename); |
3521 r = notify->AddNotification((TUint)TFsNotification::ECreate,invalidPath,filename); |
3521 test(r == KErrNotFound || r == KErrPathNotFound); |
3522 test_Value(r, r == KErrNotFound || r == KErrPathNotFound); |
3522 |
3523 |
3523 //4 |
3524 //4 |
3524 test.Printf(_L("NegativeTests() G\n")); |
3525 test.Printf(_L("NegativeTests() G\n")); |
3525 TRequestStatus wrongStatus; |
3526 TRequestStatus wrongStatus; |
3526 wrongStatus = KRequestPending; |
3527 wrongStatus = KRequestPending; |
3527 r = notify->RequestNotifications(wrongStatus); |
3528 r = notify->RequestNotifications(wrongStatus); |
3528 test(r == KErrInUse); |
3529 test_Value(r, r == KErrInUse); |
3529 |
3530 |
3530 test.Printf(_L("NegativeTests() H\n")); |
3531 test.Printf(_L("NegativeTests() H\n")); |
3531 TRequestStatus status; |
3532 TRequestStatus status; |
3532 r = notify->RequestNotifications(status); |
3533 r = notify->RequestNotifications(status); |
3533 test(r==KErrNone); |
3534 test_KErrNone(r); |
3534 r = notify->CancelNotifications(wrongStatus); |
3535 r = notify->CancelNotifications(wrongStatus); |
3535 test(r == KErrInUse); |
3536 test_Value(r, r == KErrInUse); |
3536 |
3537 |
3537 delete notify; |
3538 delete notify; |
3538 notify = NULL; |
3539 notify = NULL; |
3539 fs.Close(); |
3540 fs.Close(); |
3540 } |
3541 } |
3692 // |
3693 // |
3693 PrintLine(); |
3694 PrintLine(); |
3694 __UHEAP_MARK; |
3695 __UHEAP_MARK; |
3695 r = TestTwoDoersL(); |
3696 r = TestTwoDoersL(); |
3696 __UHEAP_MARKEND; |
3697 __UHEAP_MARKEND; |
3697 test(r==KErrNone); |
3698 test_KErrNone(r); |
3698 test.Printf(_L("------- End of TwoDoers Test -----------------------------------------\n")); |
3699 test.Printf(_L("------- End of TwoDoers Test -----------------------------------------\n")); |
3699 // |
3700 // |
3700 // 6. Create 2 file server sessions |
3701 // 6. Create 2 file server sessions |
3701 // Add a notification on each session for the same specific file creation |
3702 // Add a notification on each session for the same specific file creation |
3702 // Create that file |
3703 // Create that file |
3703 // |
3704 // |
3704 PrintLine(); |
3705 PrintLine(); |
3705 __UHEAP_MARK; |
3706 __UHEAP_MARK; |
3706 r = TestTwoWatchersL(); |
3707 r = TestTwoWatchersL(); |
3707 __UHEAP_MARKEND; |
3708 __UHEAP_MARKEND; |
3708 test(r==KErrNone); |
3709 test_KErrNone(r); |
3709 test.Printf(_L("------- End of TwoWatchers Test --------------------------------------\n")); |
3710 test.Printf(_L("------- End of TwoWatchers Test --------------------------------------\n")); |
3710 // |
3711 // |
3711 // 7. Create 2 file server sessions and 2 clients |
3712 // 7. Create 2 file server sessions and 2 clients |
3712 // Add a notification on each session for different file creations |
3713 // Add a notification on each session for different file creations |
3713 // Clients create a file each |
3714 // Clients create a file each |
3714 // |
3715 // |
3715 PrintLine(); |
3716 PrintLine(); |
3716 __UHEAP_MARK; |
3717 __UHEAP_MARK; |
3717 r = TestTwoWatchersTwoDoersL(); |
3718 r = TestTwoWatchersTwoDoersL(); |
3718 __UHEAP_MARKEND; |
3719 __UHEAP_MARKEND; |
3719 test(r==KErrNone); |
3720 test_KErrNone(r); |
3720 test.Printf(_L("------- End of TwoWatchersTwoDoers Test ------------------------------\n")); |
3721 test.Printf(_L("------- End of TwoWatchersTwoDoers Test ------------------------------\n")); |
3721 // |
3722 // |
3722 // 8. Add notification for a specific file creation |
3723 // 8. Add notification for a specific file creation |
3723 // Cancel the notification request |
3724 // Cancel the notification request |
3724 // Create that file |
3725 // Create that file |
3725 // |
3726 // |
3726 PrintLine(); |
3727 PrintLine(); |
3727 __UHEAP_MARK; |
3728 __UHEAP_MARK; |
3728 r = TestCancelNotificationL(); |
3729 r = TestCancelNotificationL(); |
3729 __UHEAP_MARKEND; |
3730 __UHEAP_MARKEND; |
3730 test(r==KErrNone); |
3731 test_KErrNone(r); |
3731 test.Printf(_L("------- End of CancelNotification Test -------------------------------\n")); |
3732 test.Printf(_L("------- End of CancelNotification Test -------------------------------\n")); |
3732 // |
3733 // |
3733 // 9. Create 2 file server sessions |
3734 // 9. Create 2 file server sessions |
3734 // Add a notification on each session for the same specific file creation |
3735 // Add a notification on each session for the same specific file creation |
3735 // Delete the first notification |
3736 // Delete the first notification |
3775 // |
3776 // |
3776 PrintLine(); |
3777 PrintLine(); |
3777 test.Next(_L("EFileCreate Tests")); |
3778 test.Next(_L("EFileCreate Tests")); |
3778 _LIT(KFilename3,"file.create"); |
3779 _LIT(KFilename3,"file.create"); |
3779 r = TestMultipleNotificationsL(_L(""),KFilename3,5,5,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3780 r = TestMultipleNotificationsL(_L(""),KFilename3,5,5,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3780 test(r==KErrNone); |
3781 test_KErrNone(r); |
3781 test.Printf(_L("------- End of EFileCreate Tests -------------------------------------\n")); |
3782 test.Printf(_L("------- End of EFileCreate Tests -------------------------------------\n")); |
3782 // |
3783 // |
3783 // RFs::MkDir |
3784 // RFs::MkDir |
3784 // 2. Add notification for a specific directory creation |
3785 // 2. Add notification for a specific directory creation |
3785 // Create that directory |
3786 // Create that directory |
3786 // |
3787 // |
3787 PrintLine(); |
3788 PrintLine(); |
3788 test.Next(_L("EFsMkDir Test")); |
3789 test.Next(_L("EFsMkDir Test")); |
3789 _LIT(KDirName1,"dirCreate\\"); |
3790 _LIT(KDirName1,"dirCreate\\"); |
3790 r = TestMultipleNotificationsL(KDirName1,_L(""),1,1,t_notification::EFsMkDir,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3791 r = TestMultipleNotificationsL(KDirName1,_L(""),1,1,t_notification::EFsMkDir,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3791 test(r==KErrNone); |
3792 test_KErrNone(r); |
3792 test.Printf(_L("------- End of EFsMkDir Test -----------------------------------------\n")); |
3793 test.Printf(_L("------- End of EFsMkDir Test -----------------------------------------\n")); |
3793 // |
3794 // |
3794 // RFile::Replace |
3795 // RFile::Replace |
3795 // 3. Add notification for a specific file creation |
3796 // 3. Add notification for a specific file creation |
3796 // Replace that file |
3797 // Replace that file |
3797 // |
3798 // |
3798 PrintLine(); |
3799 PrintLine(); |
3799 test.Next(_L("EFileReplace Test")); |
3800 test.Next(_L("EFileReplace Test")); |
3800 r = TestMultipleNotificationsL(_L(""),KFilename3,1,1,t_notification::EFileReplace,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3801 r = TestMultipleNotificationsL(_L(""),KFilename3,1,1,t_notification::EFileReplace,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3801 test(r==KErrNone); |
3802 test_KErrNone(r); |
3802 test.Printf(_L("------- End of EFileReplace Test -------------------------------------\n")); |
3803 test.Printf(_L("------- End of EFileReplace Test -------------------------------------\n")); |
3803 // |
3804 // |
3804 // 4. Add notification for a specific file creation |
3805 // 4. Add notification for a specific file creation |
3805 // Remove that notification |
3806 // Remove that notification |
3806 // Create that file |
3807 // Create that file |
3807 // |
3808 // |
3808 PrintLine(); |
3809 PrintLine(); |
3809 __UHEAP_MARK; |
3810 __UHEAP_MARK; |
3810 r = TestAddRemoveNotificationL(); |
3811 r = TestAddRemoveNotificationL(); |
3811 __UHEAP_MARKEND; |
3812 __UHEAP_MARKEND; |
3812 test(r==KErrNone); |
3813 test_KErrNone(r); |
3813 test.Printf(_L("------- End of Add and Remove Notification Test ----------------------\n")); |
3814 test.Printf(_L("------- End of Add and Remove Notification Test ----------------------\n")); |
3814 // |
3815 // |
3815 // Wildcard Create Tests |
3816 // Wildcard Create Tests |
3816 // 5. Add notification for file creation using wildcard name |
3817 // 5. Add notification for file creation using wildcard name |
3817 // Add notification for file/directory wildcard including subdirectories |
3818 // Add notification for file/directory wildcard including subdirectories |
3821 test.Next(_L("Wildcard Create Tests")); |
3822 test.Next(_L("Wildcard Create Tests")); |
3822 // |
3823 // |
3823 // Wildcard Name |
3824 // Wildcard Name |
3824 _LIT(KWildcardName1,"*"); |
3825 _LIT(KWildcardName1,"*"); |
3825 r = TestMultipleNotificationsL(_L(""),KWildcardName1,1,1,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3826 r = TestMultipleNotificationsL(_L(""),KWildcardName1,1,1,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3826 test(r==KErrNone); |
3827 test_KErrNone(r); |
3827 r = TestMultipleNotificationsL(KWildcardName1,KWildcardName1,1,1,t_notification::EFileCreate_subs,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3828 r = TestMultipleNotificationsL(KWildcardName1,KWildcardName1,1,1,t_notification::EFileCreate_subs,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3828 test(r==KErrNone); |
3829 test_KErrNone(r); |
3829 r = TestMultipleNotificationsL(KWildcardName1,KWildcardName1,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__); |
3830 r = TestMultipleNotificationsL(KWildcardName1,KWildcardName1,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__); |
3830 test(r==KErrNone); |
3831 test_KErrNone(r); |
3831 // |
3832 // |
3832 // Wildcard including Subdirectories |
3833 // Wildcard including Subdirectories |
3833 _LIT(KWildcardName2,"*\\"); |
3834 _LIT(KWildcardName2,"*\\"); |
3834 r = TestMultipleNotificationsL(KWildcardName2,KWildcardName1,1,1,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__); |
3835 r = TestMultipleNotificationsL(KWildcardName2,KWildcardName1,1,1,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__); |
3835 test(r==KErrNone); |
3836 test_KErrNone(r); |
3836 r = TestMultipleNotificationsL(KWildcardName2,KWildcardName1,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3837 r = TestMultipleNotificationsL(KWildcardName2,KWildcardName1,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3837 test(r==KErrNone); |
3838 test_KErrNone(r); |
3838 _LIT(KDirName2,"SubDir\\"); |
3839 _LIT(KDirName2,"SubDir\\"); |
3839 _LIT(KWildcardName3,"?"); |
3840 _LIT(KWildcardName3,"?"); |
3840 r = TestMultipleNotificationsL(KDirName2,KWildcardName3,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3841 r = TestMultipleNotificationsL(KDirName2,KWildcardName3,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3841 test(r==KErrNone); |
3842 test_KErrNone(r); |
3842 // |
3843 // |
3843 // Wildcard Type |
3844 // Wildcard Type |
3844 _LIT(KWildcardName4,"*.*"); |
3845 _LIT(KWildcardName4,"*.*"); |
3845 r = TestMultipleNotificationsL(_L(""),KWildcardName4,1,1,t_notification::EFileCreate_txt_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3846 r = TestMultipleNotificationsL(_L(""),KWildcardName4,1,1,t_notification::EFileCreate_txt_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3846 test(r==KErrNone); |
3847 test_KErrNone(r); |
3847 r = TestMultipleNotificationsL(_L(""),KWildcardName4,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__); |
3848 r = TestMultipleNotificationsL(_L(""),KWildcardName4,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__); |
3848 test(r==KErrNone); |
3849 test_KErrNone(r); |
3849 // |
3850 // |
3850 // 6. Add notification for file creation for a specific type |
3851 // 6. Add notification for file creation for a specific type |
3851 // Create file with that type |
3852 // Create file with that type |
3852 // Create file with different type |
3853 // Create file with different type |
3853 // |
3854 // |
3854 _LIT(KWildcardName5,"*.txt"); |
3855 _LIT(KWildcardName5,"*.txt"); |
3855 r = TestMultipleNotificationsL(_L(""),KWildcardName5,1,1,t_notification::EFileCreate_txt,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3856 r = TestMultipleNotificationsL(_L(""),KWildcardName5,1,1,t_notification::EFileCreate_txt,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3856 test(r==KErrNone); |
3857 test_KErrNone(r); |
3857 test.Printf(_L("------- End of Wildcard Create Tests ---------------------------------\n")); |
3858 test.Printf(_L("------- End of Wildcard Create Tests ---------------------------------\n")); |
3858 |
3859 |
3859 |
3860 |
3860 //============================================================================= |
3861 //============================================================================= |
3861 //! @SYMTestCaseID PBASE-T_NOTIFY-2445 |
3862 //! @SYMTestCaseID PBASE-T_NOTIFY-2445 |
3873 // |
3874 // |
3874 PrintLine(); |
3875 PrintLine(); |
3875 test.Next(_L("Attribute Tests")); |
3876 test.Next(_L("Attribute Tests")); |
3876 _LIT(KFilename4,"file.setatts"); |
3877 _LIT(KFilename4,"file.setatts"); |
3877 r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFileSetAtt,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3878 r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFileSetAtt,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3878 test(r==KErrNone); |
3879 test_KErrNone(r); |
3879 r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFileSet,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3880 r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFileSet,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3880 test(r==KErrNone); |
3881 test_KErrNone(r); |
3881 r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFsSetEntry,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3882 r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFsSetEntry,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3882 test(r==KErrNone); |
3883 test_KErrNone(r); |
3883 // |
3884 // |
3884 // Wildcard Attribute Test including subdirectories |
3885 // Wildcard Attribute Test including subdirectories |
3885 // 2. Add notification for file attribute change using wildcard name |
3886 // 2. Add notification for file attribute change using wildcard name |
3886 // Create number of files that match the notification |
3887 // Create number of files that match the notification |
3887 // Change attributes of some files |
3888 // Change attributes of some files |
3888 // |
3889 // |
3889 r = TestMultipleNotificationsL(KWildcardName2,_L("*"),3,3,t_notification::EFileSetAtt_subs,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3890 r = TestMultipleNotificationsL(KWildcardName2,_L("*"),3,3,t_notification::EFileSetAtt_subs,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3890 test(r==KErrNone); |
3891 test_KErrNone(r); |
3891 test.Printf(_L("------- End of Attribute Tests ---------------------------------------\n")); |
3892 test.Printf(_L("------- End of Attribute Tests ---------------------------------------\n")); |
3892 |
3893 |
3893 |
3894 |
3894 //============================================================================= |
3895 //============================================================================= |
3895 //! @SYMTestCaseID PBASE-T_NOTIFY-2446 |
3896 //! @SYMTestCaseID PBASE-T_NOTIFY-2446 |
3907 // |
3908 // |
3908 PrintLine(); |
3909 PrintLine(); |
3909 test.Next(_L("Rename Tests")); |
3910 test.Next(_L("Rename Tests")); |
3910 _LIT(KFilename5,"file.rename"); |
3911 _LIT(KFilename5,"file.rename"); |
3911 r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFsReplace,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3912 r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFsReplace,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3912 test(r==KErrNone); |
3913 test_KErrNone(r); |
3913 r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFsRename,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3914 r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFsRename,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3914 test(r==KErrNone); |
3915 test_KErrNone(r); |
3915 r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFileRename,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3916 r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFileRename,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3916 test(r==KErrNone); |
3917 test_KErrNone(r); |
3917 // |
3918 // |
3918 // 2. Add notification for a specific directory rename |
3919 // 2. Add notification for a specific directory rename |
3919 // Rename that directory |
3920 // Rename that directory |
3920 // |
3921 // |
3921 _LIT(KDirName3,"dirRename\\"); |
3922 _LIT(KDirName3,"dirRename\\"); |
3922 r = TestMultipleNotificationsL(KDirName3,_L(""),1,1,t_notification::EFsRename_dir,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3923 r = TestMultipleNotificationsL(KDirName3,_L(""),1,1,t_notification::EFsRename_dir,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3923 test(r==KErrNone); |
3924 test_KErrNone(r); |
3924 // |
3925 // |
3925 // 3. Add notification for file rename using wildcard name |
3926 // 3. Add notification for file rename using wildcard name |
3926 // Create file that match the notification |
3927 // Create file that match the notification |
3927 // Repeatedly rename the file |
3928 // Repeatedly rename the file |
3928 // |
3929 // |
3929 r = TestMultipleNotificationsL(_L(""),KWildcardName1,3,3,t_notification::EFileRename_wild,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3930 r = TestMultipleNotificationsL(_L(""),KWildcardName1,3,3,t_notification::EFileRename_wild,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3930 test(r==KErrNone); |
3931 test_KErrNone(r); |
3931 test.Printf(_L("------- End of Rename Tests ------------------------------------------\n")); |
3932 test.Printf(_L("------- End of Rename Tests ------------------------------------------\n")); |
3932 |
3933 |
3933 |
3934 |
3934 //============================================================================= |
3935 //============================================================================= |
3935 //! @SYMTestCaseID PBASE-T_NOTIFY-2447 |
3936 //! @SYMTestCaseID PBASE-T_NOTIFY-2447 |
3947 // |
3948 // |
3948 PrintLine(); |
3949 PrintLine(); |
3949 test.Next(_L("EFsDelete Test")); |
3950 test.Next(_L("EFsDelete Test")); |
3950 _LIT(KFilename6,"file.delete"); |
3951 _LIT(KFilename6,"file.delete"); |
3951 r = TestMultipleNotificationsL(_L(""),KFilename6,1,1,t_notification::EFsDelete,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3952 r = TestMultipleNotificationsL(_L(""),KFilename6,1,1,t_notification::EFsDelete,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3952 test(r==KErrNone); |
3953 test_KErrNone(r); |
3953 // |
3954 // |
3954 // RFs::RmDir |
3955 // RFs::RmDir |
3955 // 2. Add notification for a specific directory delete |
3956 // 2. Add notification for a specific directory delete |
3956 // Delete that directory |
3957 // Delete that directory |
3957 // |
3958 // |
3958 PrintLine(); |
3959 PrintLine(); |
3959 test.Next(_L("EFsRmDir Tests")); |
3960 test.Next(_L("EFsRmDir Tests")); |
3960 _LIT(KDirName4,"dirRemove\\"); |
3961 _LIT(KDirName4,"dirRemove\\"); |
3961 r = TestMultipleNotificationsL(KDirName4,_L(""),1,1,t_notification::EFsRmDir,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3962 r = TestMultipleNotificationsL(KDirName4,_L(""),1,1,t_notification::EFsRmDir,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3962 test(r==KErrNone); |
3963 test_KErrNone(r); |
3963 // |
3964 // |
3964 // This test should not receive any notifications because a non-empty directory cannot be removed |
3965 // This test should not receive any notifications because a non-empty directory cannot be removed |
3965 // 3. Add notification for specific directory delete |
3966 // 3. Add notification for specific directory delete |
3966 // Create files inside that directory |
3967 // Create files inside that directory |
3967 // Delete the directory |
3968 // Delete the directory |
3968 // |
3969 // |
3969 _LIT(KDirName5,"dirRmNonEmp\\"); |
3970 _LIT(KDirName5,"dirRmNonEmp\\"); |
3970 r = TestMultipleNotificationsL(KDirName5,_L(""),1,1,t_notification::EFsRmDir_nonEmpty,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)ETrue,__LINE__); |
3971 r = TestMultipleNotificationsL(KDirName5,_L(""),1,1,t_notification::EFsRmDir_nonEmpty,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)ETrue,__LINE__); |
3971 test(r==KErrNone); |
3972 test_KErrNone(r); |
3972 // |
3973 // |
3973 // Wildcard Name ("*") |
3974 // Wildcard Name ("*") |
3974 // 4. Add notification for directory delete using wildcard name |
3975 // 4. Add notification for directory delete using wildcard name |
3975 // Create directory that match the notification |
3976 // Create directory that match the notification |
3976 // Delete that directory |
3977 // Delete that directory |
3977 // |
3978 // |
3978 r = TestMultipleNotificationsL(KWildcardName1,_L(""),1,1,t_notification::EFsRmDir_wild,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3979 r = TestMultipleNotificationsL(KWildcardName1,_L(""),1,1,t_notification::EFsRmDir_wild,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3979 test(r==KErrNone); |
3980 test_KErrNone(r); |
3980 // |
3981 // |
3981 // Wildcard Type ("*.txt") |
3982 // Wildcard Type ("*.txt") |
3982 // Creates files with different types and should only receive notifications from "*.txt" file deletions |
3983 // Creates files with different types and should only receive notifications from "*.txt" file deletions |
3983 // 5. Add notification for file deletes using wildcard type |
3984 // 5. Add notification for file deletes using wildcard type |
3984 // Create number of files that match the notification |
3985 // Create number of files that match the notification |
3985 // Delete those files |
3986 // Delete those files |
3986 // |
3987 // |
3987 r = TestMultipleNotificationsL(_L(""),KWildcardName4,3,3,t_notification::EFsDelete,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3988 r = TestMultipleNotificationsL(_L(""),KWildcardName4,3,3,t_notification::EFsDelete,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
3988 test(r==KErrNone); |
3989 test_KErrNone(r); |
3989 test.Printf(_L("------- End of Delete Tests ------------------------------------------\n")); |
3990 test.Printf(_L("------- End of Delete Tests ------------------------------------------\n")); |
3990 |
3991 |
3991 |
3992 |
3992 //====================================================================== |
3993 //====================================================================== |
3993 //! @SYMTestCaseID PBASE-T_NOTIFY-2448 |
3994 //! @SYMTestCaseID PBASE-T_NOTIFY-2448 |
4011 test.Next(_L("EFileWrite Tests")); |
4012 test.Next(_L("EFileWrite Tests")); |
4012 _LIT(KFilename7,"file.write"); |
4013 _LIT(KFilename7,"file.write"); |
4013 __UHEAP_MARK; |
4014 __UHEAP_MARK; |
4014 r = TestMultipleNotificationsL(_L(""),KFilename7,7,7,t_notification::EFileWrite,TFsNotification::EFileChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4015 r = TestMultipleNotificationsL(_L(""),KFilename7,7,7,t_notification::EFileWrite,TFsNotification::EFileChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4015 __UHEAP_MARKEND; |
4016 __UHEAP_MARKEND; |
4016 test(r==KErrNone); |
4017 test_KErrNone(r); |
4017 // |
4018 // |
4018 // 2. Add notification for a specific file change |
4019 // 2. Add notification for a specific file change |
4019 // Write to the specified file a number of times without changing its size |
4020 // Write to the specified file a number of times without changing its size |
4020 // |
4021 // |
4021 // Four letters are written to a file, then the first letter in the file is replaced aIterations times |
4022 // Four letters are written to a file, then the first letter in the file is replaced aIterations times |
4022 // aMaxNotifications = 1 + aIterations |
4023 // aMaxNotifications = 1 + aIterations |
4023 // |
4024 // |
4024 r = TestMultipleNotificationsL(_L(""),KFilename7,3,4,t_notification::EFileWrite_samesize,TFsNotification::EFileChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4025 r = TestMultipleNotificationsL(_L(""),KFilename7,3,4,t_notification::EFileWrite_samesize,TFsNotification::EFileChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4025 test(r==KErrNone); |
4026 test_KErrNone(r); |
4026 test.Printf(_L("------- End of EFileWrite Tests --------------------------------------\n")); |
4027 test.Printf(_L("------- End of EFileWrite Tests --------------------------------------\n")); |
4027 // |
4028 // |
4028 // 3. Add notification for a specific file change |
4029 // 3. Add notification for a specific file change |
4029 // Write to that file asynchronously |
4030 // Write to that file asynchronously |
4030 // |
4031 // |
4046 // |
4047 // |
4047 PrintLine(); |
4048 PrintLine(); |
4048 test.Next(_L("EFileSetSize Tests")); |
4049 test.Next(_L("EFileSetSize Tests")); |
4049 _LIT(KFilename9,"file.setsize"); |
4050 _LIT(KFilename9,"file.setsize"); |
4050 r = TestMultipleNotificationsL(_L(""),KFilename9,5,9,t_notification::EFileSetSize,TFsNotification::EFileChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4051 r = TestMultipleNotificationsL(_L(""),KFilename9,5,9,t_notification::EFileSetSize,TFsNotification::EFileChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4051 test(r==KErrNone); |
4052 test_KErrNone(r); |
4052 test.Printf(_L("------- End of EFileSetSize Tests ------------------------------------\n")); |
4053 test.Printf(_L("------- End of EFileSetSize Tests ------------------------------------\n")); |
4053 |
4054 |
4054 |
4055 |
4055 // |
4056 // |
4056 PrintLine(); |
4057 PrintLine(); |
4057 test.Next(_L("CFileMan Tests")); |
4058 test.Next(_L("CFileMan Tests")); |
4058 _LIT(KFilenameCFMan,"cf1le.man"); |
4059 _LIT(KFilenameCFMan,"cf1le.man"); |
4059 TUint notificationTypes = (TUint)TFsNotification::ECreate|TFsNotification::EFileChange|TFsNotification::EAttribute|TFsNotification::EDelete|TFsNotification::ERename; |
4060 TUint notificationTypes = (TUint)TFsNotification::ECreate|TFsNotification::EFileChange|TFsNotification::EAttribute|TFsNotification::EDelete|TFsNotification::ERename; |
4060 r = TestMultipleNotificationsL(_L(""),KFilenameCFMan,1,5,t_notification::ECFileManMove,notificationTypes,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4061 r = TestMultipleNotificationsL(_L(""),KFilenameCFMan,1,5,t_notification::ECFileManMove,notificationTypes,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4061 test(r==KErrNone); |
4062 test_KErrNone(r); |
4062 test.Printf(_L("------- End of CFileMan Tests -------------------------------------\n")); |
4063 test.Printf(_L("------- End of CFileMan Tests -------------------------------------\n")); |
4063 |
4064 |
4064 |
4065 |
4065 //======================================================================================== |
4066 //======================================================================================== |
4066 //! @SYMTestCaseID PBASE-T_NOTIFY-2449 |
4067 //! @SYMTestCaseID PBASE-T_NOTIFY-2449 |
4079 // |
4080 // |
4080 PrintLine(); |
4081 PrintLine(); |
4081 test.Next(_L("Mount Tests")); |
4082 test.Next(_L("Mount Tests")); |
4082 TFullName filesystemName; |
4083 TFullName filesystemName; |
4083 r = TheFs.FileSystemName(filesystemName,globalDriveNum); |
4084 r = TheFs.FileSystemName(filesystemName,globalDriveNum); |
4084 test(r==KErrNone); |
4085 test_KErrNone(r); |
4085 r = TestMultipleNotificationsL(filesystemName,1,1,t_notification::EDismount,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4086 r = TestMultipleNotificationsL(filesystemName,1,1,t_notification::EDismount,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4086 test(r==KErrNone); |
4087 test_KErrNone(r); |
4087 // |
4088 // |
4088 // RFs::MountFileSystem |
4089 // RFs::MountFileSystem |
4089 // 2. Add notification for media change |
4090 // 2. Add notification for media change |
4090 // Mount the file system |
4091 // Mount the file system |
4091 // |
4092 // |
4092 r = TestMultipleNotificationsL(filesystemName,1,1,t_notification::EMount,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4093 r = TestMultipleNotificationsL(filesystemName,1,1,t_notification::EMount,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4093 test(r==KErrNone); |
4094 test_KErrNone(r); |
4094 // |
4095 // |
4095 // Repeatedly mount and dismount the file system |
4096 // Repeatedly mount and dismount the file system |
4096 // 3. Add notification for media change |
4097 // 3. Add notification for media change |
4097 // Repeatedly dismount and mount the file system |
4098 // Repeatedly dismount and mount the file system |
4098 // |
4099 // |
4099 // The file system is dismounted and mounted aIterations times |
4100 // The file system is dismounted and mounted aIterations times |
4100 // aMaxNotifications = 2*aIterations |
4101 // aMaxNotifications = 2*aIterations |
4101 // |
4102 // |
4102 r = TestMultipleNotificationsL(filesystemName,5,10,t_notification::EMountDismount,TFsNotification::EMediaChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4103 r = TestMultipleNotificationsL(filesystemName,5,10,t_notification::EMountDismount,TFsNotification::EMediaChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4103 test(r==KErrNone); |
4104 test_KErrNone(r); |
4104 // |
4105 // |
4105 // RFs::MountFileSystemAndScan |
4106 // RFs::MountFileSystemAndScan |
4106 // 4. Add notification for media change |
4107 // 4. Add notification for media change |
4107 // Mount and scan the file system |
4108 // Mount and scan the file system |
4108 // |
4109 // |
4109 // The file system is dismounted and mounted aIterations times |
4110 // The file system is dismounted and mounted aIterations times |
4110 // aMaxNotifications = 2*aIterations |
4111 // aMaxNotifications = 2*aIterations |
4111 // |
4112 // |
4112 //#ifndef __WINS__ |
4113 //#ifndef __WINS__ |
4113 // r = TestMultipleNotificationsL(filesystemName,1,2,t_notification::EMountScan,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4114 // r = TestMultipleNotificationsL(filesystemName,1,2,t_notification::EMountScan,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4114 // test(r==KErrNone); |
4115 // test_KErrNone(r); |
4115 //#endif |
4116 //#endif |
4116 test.Printf(_L("------- End of Mount Tests -------------------------------------------\n")); |
4117 test.Printf(_L("------- End of Mount Tests -------------------------------------------\n")); |
4117 TDriveInfo drvInfo; |
4118 TDriveInfo drvInfo; |
4118 TInt driveNum; |
4119 TInt driveNum; |
4119 TheFs.CharToDrive(gDriveToTest,driveNum); |
4120 TheFs.CharToDrive(gDriveToTest,driveNum); |
4120 r = TheFs.Drive(drvInfo,driveNum); |
4121 r = TheFs.Drive(drvInfo,driveNum); |
4121 test (r == KErrNone); |
4122 test_KErrNone(r); |
4122 TPtrC driveDes((TText*)&gDriveToTest,1); |
4123 TPtrC driveDes((TText*)&gDriveToTest,1); |
4123 // |
4124 // |
4124 // Manual Tests - Will only run on removable drives |
4125 // Manual Tests - Will only run on removable drives |
4125 // |
4126 // |
4126 /* if(drvInfo.iDriveAtt & KDriveAttRemovable) |
4127 /* if(drvInfo.iDriveAtt & KDriveAttRemovable) |
4130 // Remove media card manually |
4131 // Remove media card manually |
4131 // |
4132 // |
4132 PrintLine(); |
4133 PrintLine(); |
4133 test.Next(_L("Media Card Removal/Insertion Tests")); |
4134 test.Next(_L("Media Card Removal/Insertion Tests")); |
4134 r = TestMultipleNotificationsL(driveDes,1,1,t_notification::EMediaCardRemoval,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4135 r = TestMultipleNotificationsL(driveDes,1,1,t_notification::EMediaCardRemoval,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4135 test(r==KErrNone); |
4136 test_KErrNone(r); |
4136 // |
4137 // |
4137 // 6. Add notification for media change |
4138 // 6. Add notification for media change |
4138 // Insert media card manually |
4139 // Insert media card manually |
4139 // |
4140 // |
4140 r = TestMultipleNotificationsL(driveDes,1,1,t_notification::EMediaCardInsertion,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4141 r = TestMultipleNotificationsL(driveDes,1,1,t_notification::EMediaCardInsertion,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4141 test(r==KErrNone); |
4142 test_KErrNone(r); |
4142 test.Printf(_L("------- End of Media Card Removal/Insertion Tests --------------------\n")); |
4143 test.Printf(_L("------- End of Media Card Removal/Insertion Tests --------------------\n")); |
4143 // |
4144 // |
4144 // We should receive an EMediaChange notification even though we did not register for it |
4145 // We should receive an EMediaChange notification even though we did not register for it |
4145 // 7. Do not add notification for media change |
4146 // 7. Do not add notification for media change |
4146 // Remove and insert media card manually |
4147 // Remove and insert media card manually |
4184 // Change the drive name |
4185 // Change the drive name |
4185 // |
4186 // |
4186 PrintLine(); |
4187 PrintLine(); |
4187 test.Next(_L("DriveName Test")); |
4188 test.Next(_L("DriveName Test")); |
4188 r = TestMultipleNotificationsL(driveDes,1,2,t_notification::ESetDriveName,TFsNotification::EDriveName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4189 r = TestMultipleNotificationsL(driveDes,1,2,t_notification::ESetDriveName,TFsNotification::EDriveName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4189 test(r==KErrNone); |
4190 test_KErrNone(r); |
4190 // |
4191 // |
4191 // 2. Add notification for a specific drive name change |
4192 // 2. Add notification for a specific drive name change |
4192 // Repeatedly rename the drive |
4193 // Repeatedly rename the drive |
4193 // |
4194 // |
4194 r = TestMultipleNotificationsL(driveDes,3,6,t_notification::ESetDriveName,TFsNotification::EDriveName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4195 r = TestMultipleNotificationsL(driveDes,3,6,t_notification::ESetDriveName,TFsNotification::EDriveName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4195 test(r==KErrNone); |
4196 test_KErrNone(r); |
4196 test.Printf(_L("------- End of DriveName Test ----------------------------------------\n")); |
4197 test.Printf(_L("------- End of DriveName Test ----------------------------------------\n")); |
4197 |
4198 |
4198 |
4199 |
4199 //================================================================================ |
4200 //================================================================================ |
4200 //! @SYMTestCaseID PBASE-T_NOTIFY-2451 |
4201 //! @SYMTestCaseID PBASE-T_NOTIFY-2451 |
4216 // |
4217 // |
4217 // 1. Add notification for a specific volume name change |
4218 // 1. Add notification for a specific volume name change |
4218 // Change the volume name |
4219 // Change the volume name |
4219 // |
4220 // |
4220 r = TestMultipleNotificationsL(driveDes,1,2,t_notification::ESetVolumeLabel,TFsNotification::EVolumeName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4221 r = TestMultipleNotificationsL(driveDes,1,2,t_notification::ESetVolumeLabel,TFsNotification::EVolumeName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4221 test(r==KErrNone); |
4222 test_KErrNone(r); |
4222 // |
4223 // |
4223 // 2. Add notification for a specific volume name change |
4224 // 2. Add notification for a specific volume name change |
4224 // Repeatedly rename the volume |
4225 // Repeatedly rename the volume |
4225 // |
4226 // |
4226 r = TestMultipleNotificationsL(driveDes,3,6,t_notification::ESetVolumeLabel,TFsNotification::EVolumeName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4227 r = TestMultipleNotificationsL(driveDes,3,6,t_notification::ESetVolumeLabel,TFsNotification::EVolumeName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4227 test(r==KErrNone); |
4228 test_KErrNone(r); |
4228 test.Printf(_L("------- End of VolumeName Test ---------------------------------------\n")); |
4229 test.Printf(_L("------- End of VolumeName Test ---------------------------------------\n")); |
4229 #endif |
4230 #endif |
4230 |
4231 |
4231 |
4232 |
4232 //============================================================================= |
4233 //============================================================================= |
4248 // EAllOps1: A file is created and deleted aIterations times |
4249 // EAllOps1: A file is created and deleted aIterations times |
4249 // aMaxNotification = 2*aIterations |
4250 // aMaxNotification = 2*aIterations |
4250 // |
4251 // |
4251 _LIT(KFilename10,"file.allops"); |
4252 _LIT(KFilename10,"file.allops"); |
4252 r = TestMultipleNotificationsL(_L(""),KFilename10,4,8,t_notification::EAllOps1,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4253 r = TestMultipleNotificationsL(_L(""),KFilename10,4,8,t_notification::EAllOps1,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4253 test(r==KErrNone); |
4254 test_KErrNone(r); |
4254 // |
4255 // |
4255 // 2. Add notification for all operations |
4256 // 2. Add notification for all operations |
4256 // Create a file |
4257 // Create a file |
4257 // Write to the file |
4258 // Write to the file |
4258 // Delete the file |
4259 // Delete the file |
4259 // |
4260 // |
4260 // EAllOps2: A file is created, written to aIterations times and then deleted |
4261 // EAllOps2: A file is created, written to aIterations times and then deleted |
4261 // aMaxNotification = 2 + aIterations (See File Write Tests) |
4262 // aMaxNotification = 2 + aIterations (See File Write Tests) |
4262 // |
4263 // |
4263 r = TestMultipleNotificationsL(_L(""),KFilename10,4,6,t_notification::EAllOps2,(TUint)TFsNotification::EAllOps,2*KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4264 r = TestMultipleNotificationsL(_L(""),KFilename10,4,6,t_notification::EAllOps2,(TUint)TFsNotification::EAllOps,2*KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4264 test(r==KErrNone); |
4265 test_KErrNone(r); |
4265 // |
4266 // |
4266 // 3. Add notification for all operations |
4267 // 3. Add notification for all operations |
4267 // Create a file |
4268 // Create a file |
4268 // Change the file size |
4269 // Change the file size |
4269 // Delete the file |
4270 // Delete the file |
4271 // EAllOps3: A file is created, its size is increased size aIterations times, decreased (aIterations - 1) times |
4272 // EAllOps3: A file is created, its size is increased size aIterations times, decreased (aIterations - 1) times |
4272 // and then deleted |
4273 // and then deleted |
4273 // aMaxNotifications = 1 + 2*aIterations |
4274 // aMaxNotifications = 1 + 2*aIterations |
4274 // |
4275 // |
4275 r = TestMultipleNotificationsL(_L(""),KFilename10,4,9,t_notification::EAllOps3,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize*2,(TBool)EFalse,__LINE__); |
4276 r = TestMultipleNotificationsL(_L(""),KFilename10,4,9,t_notification::EAllOps3,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize*2,(TBool)EFalse,__LINE__); |
4276 test(r==KErrNone); |
4277 test_KErrNone(r); |
4277 // |
4278 // |
4278 // 4. Add notification for all operations |
4279 // 4. Add notification for all operations |
4279 // Create a file |
4280 // Create a file |
4280 // Change the file attribute |
4281 // Change the file attribute |
4281 // Delete the file |
4282 // Delete the file |
4282 // |
4283 // |
4283 // EAllOps4: A file is created, its attribute is changed and the file is deleted |
4284 // EAllOps4: A file is created, its attribute is changed and the file is deleted |
4284 // aMaxNotification = 3 |
4285 // aMaxNotification = 3 |
4285 // |
4286 // |
4286 r = TestMultipleNotificationsL(_L(""),KFilename10,1,3,t_notification::EAllOps4,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4287 r = TestMultipleNotificationsL(_L(""),KFilename10,1,3,t_notification::EAllOps4,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4287 test(r==KErrNone); |
4288 test_KErrNone(r); |
4288 // |
4289 // |
4289 // 5. Add notification for all operations |
4290 // 5. Add notification for all operations |
4290 // Create a file |
4291 // Create a file |
4291 // Rename the file |
4292 // Rename the file |
4292 // |
4293 // |
4293 // EAllOps5: A file is created and renamed |
4294 // EAllOps5: A file is created and renamed |
4294 // aMaxNotification = 2 |
4295 // aMaxNotification = 2 |
4295 // |
4296 // |
4296 r = TestMultipleNotificationsL(_L(""),KFilename10,1,2,t_notification::EAllOps5,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4297 r = TestMultipleNotificationsL(_L(""),KFilename10,1,2,t_notification::EAllOps5,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4297 test(r==KErrNone); |
4298 test_KErrNone(r); |
4298 // |
4299 // |
4299 // 6. Add notification for all operations |
4300 // 6. Add notification for all operations |
4300 // Change drive name |
4301 // Change drive name |
4301 // Change volume name |
4302 // Change volume name |
4302 // |
4303 // |
4354 // |
4355 // |
4355 // A file is created, its attribute is changed and the file is deleted |
4356 // A file is created, its attribute is changed and the file is deleted |
4356 // aMaxNotification = 3 |
4357 // aMaxNotification = 3 |
4357 // |
4358 // |
4358 r = TestMultipleNotificationsL(_L(""),KFilename11,1,3,t_notification::EAllOps4,TFsNotification::EAttribute | TFsNotification::EDelete | TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4359 r = TestMultipleNotificationsL(_L(""),KFilename11,1,3,t_notification::EAllOps4,TFsNotification::EAttribute | TFsNotification::EDelete | TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4359 test(r==KErrNone); |
4360 test_KErrNone(r); |
4360 // |
4361 // |
4361 // TFsNotification::ERename | TFsNotification::ECreate |
4362 // TFsNotification::ERename | TFsNotification::ECreate |
4362 // 4. Add notification for create and rename for a specific file |
4363 // 4. Add notification for create and rename for a specific file |
4363 // Create a file |
4364 // Create a file |
4364 // Rename the file |
4365 // Rename the file |
4365 // |
4366 // |
4366 // A file is created and renamed |
4367 // A file is created and renamed |
4367 // aMaxNotification = 2 |
4368 // aMaxNotification = 2 |
4368 // |
4369 // |
4369 r = TestMultipleNotificationsL(_L(""),KFilename11,1,2,t_notification::EAllOps5,TFsNotification::ERename | TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4370 r = TestMultipleNotificationsL(_L(""),KFilename11,1,2,t_notification::EAllOps5,TFsNotification::ERename | TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__); |
4370 test(r==KErrNone); |
4371 test_KErrNone(r); |
4371 // |
4372 // |
4372 // TFsNotification::EVolumeName | TFsNotification::EDriveName |
4373 // TFsNotification::EVolumeName | TFsNotification::EDriveName |
4373 // 5. Add notification for drive and volume name change for a specific drive |
4374 // 5. Add notification for drive and volume name change for a specific drive |
4374 // Change drive name |
4375 // Change drive name |
4375 // Change volume name |
4376 // Change volume name |