kerneltest/f32test/server/t_notifier.cpp
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
equal deleted inserted replaced
256:c1f20ce4abcf 257:3e88ff8f41d5
    13 // Description:
    13 // Description:
    14 // f32test\server\t_notifier.cpp
    14 // f32test\server\t_notifier.cpp
    15 // 
    15 // 
    16 //
    16 //
    17 
    17 
    18 #define __E32TEST_EXTENSION__
       
    19 #include <f32file.h>
    18 #include <f32file.h>
    20 #include <e32test.h>
    19 #include <e32test.h>
    21 #include <e32svr.h>
    20 #include <e32svr.h>
    22 #include <hal.h>
    21 #include <hal.h>
    23 #include "t_server.h"
    22 #include "t_server.h"
   163 // We should receive an EMediaChange notification even though we did not register for it 
   162 // We should receive an EMediaChange notification even though we did not register for it 
   164 void TestMediaCardNotificationWhenNotRegisteredForIt()
   163 void TestMediaCardNotificationWhenNotRegisteredForIt()
   165 	{
   164 	{
   166 	RFs fs;
   165 	RFs fs;
   167 	TInt r = fs.Connect();
   166 	TInt r = fs.Connect();
   168 	test_KErrNone(r);
   167 	test(r==KErrNone);
   169 	
   168 	
   170 	CFsNotify* notify = NULL;
   169 	CFsNotify* notify = NULL;
   171 	TRAP(r,notify= CFsNotify::NewL(fs,KMinNotificationBufferSize));
   170 	TRAP(r,notify= CFsNotify::NewL(fs,KMinNotificationBufferSize));
   172 	
   171 	
   173 	TBuf<40> path;
   172 	TBuf<40> path;
   176 	
   175 	
   177 	TBuf<20> filename;
   176 	TBuf<20> filename;
   178 	filename.Append(_L("media.change1"));
   177 	filename.Append(_L("media.change1"));
   179 	
   178 	
   180 	r = notify->AddNotification((TUint)TFsNotification::ECreate,path,filename);
   179 	r = notify->AddNotification((TUint)TFsNotification::ECreate,path,filename);
   181 	test_KErrNone(r);
   180 	test(r==KErrNone);
   182 	
   181 	
   183 	TRequestStatus status;
   182 	TRequestStatus status;
   184 	r = notify->RequestNotifications(status);
   183 	r = notify->RequestNotifications(status);
   185 	test_KErrNone(r);
   184 	test(r==KErrNone);
   186 	
   185 	
   187 	test.Printf(_L("*****************************************************************\n"));
   186 	test.Printf(_L("*****************************************************************\n"));
   188 	test.Printf(_L("Waiting 10 seconds.\n"));
   187 	test.Printf(_L("Waiting 10 seconds.\n"));
   189 	test.Printf(_L("This is a MANUAL test, it requires the removal of the media card.\n"));
   188 	test.Printf(_L("This is a MANUAL test, it requires the removal of the media card.\n"));
   190 	test.Printf(_L("PLEASE REMOVE THE MEDIA CARD. (DriveNumber %d)\n"),globalDriveNum);
   189 	test.Printf(_L("PLEASE REMOVE THE MEDIA CARD. (DriveNumber %d)\n"),globalDriveNum);
   191 	test.Printf(_L("Or press Ctrl + F5 on the emulator.\n"));
   190 	test.Printf(_L("Or press Ctrl + F5 on the emulator.\n"));
   192 	test.Printf(_L("*****************************************************************\n"));
   191 	test.Printf(_L("*****************************************************************\n"));
   193 	RTimer timer1;
   192 	RTimer timer1;
   194 	r = timer1.CreateLocal();
   193 	r = timer1.CreateLocal();
   195 	test_KErrNone(r);
   194 	test(r == KErrNone);
   196 	TRequestStatus timeout;
   195 	TRequestStatus timeout;
   197 	TTimeIntervalMicroSeconds32 time = 10000000;
   196 	TTimeIntervalMicroSeconds32 time = 10000000;
   198 	timer1.After(timeout,time);
   197 	timer1.After(timeout,time);
   199 	User::WaitForRequest(timeout,status);
   198 	User::WaitForRequest(timeout,status);
   200 	test(status.Int() != KRequestPending);
   199 	test(status.Int() != KRequestPending);
   208 	TBuf<2> drive;
   207 	TBuf<2> drive;
   209 	drive.Append((TChar)gDriveToTest);
   208 	drive.Append((TChar)gDriveToTest);
   210 	drive.Append(_L(":"));
   209 	drive.Append(_L(":"));
   211 	TPtrC drivePtr;
   210 	TPtrC drivePtr;
   212 	r = notification->Path(drivePtr);
   211 	r = notification->Path(drivePtr);
   213 	test_KErrNone(r);
   212 	test(r==KErrNone);
   214 	r = drivePtr.Compare(drive);
   213 	r = drivePtr.Compare(drive);
   215 	test_Value(r, r == 0);
   214 	test(r==0);
   216 	
   215 	
   217 	test.Printf(_L("*****************************************************************\n"));
   216 	test.Printf(_L("*****************************************************************\n"));
   218 	test.Printf(_L("Waiting 10 seconds.\n"));
   217 	test.Printf(_L("Waiting 10 seconds.\n"));
   219 	test.Printf(_L("This is a MANUAL test, it requires the insertion of the media card.\n"));
   218 	test.Printf(_L("This is a MANUAL test, it requires the insertion of the media card.\n"));
   220 	test.Printf(_L("PLEASE INSERT THE MEDIA CARD. (DriveNumber %d)\n"),globalDriveNum);
   219 	test.Printf(_L("PLEASE INSERT THE MEDIA CARD. (DriveNumber %d)\n"),globalDriveNum);
   225 	if(notification == NULL)
   224 	if(notification == NULL)
   226 		{
   225 		{
   227 		notify->RequestNotifications(status);
   226 		notify->RequestNotifications(status);
   228 		RTimer timer2;
   227 		RTimer timer2;
   229 		r = timer2.CreateLocal();
   228 		r = timer2.CreateLocal();
   230 		test_KErrNone(r);
   229 		test(r == KErrNone);
   231 		TRequestStatus timeout2;
   230 		TRequestStatus timeout2;
   232 		timer2.After(timeout2,time);
   231 		timer2.After(timeout2,time);
   233 		User::WaitForRequest(timeout2,status);
   232 		User::WaitForRequest(timeout2,status);
   234 		test(status.Int() != KRequestPending);
   233 		test(status.Int() != KRequestPending);
   235 		notification = notify->NextNotification();
   234 		notification = notify->NextNotification();
   248 // and then checks if the second one still works
   247 // and then checks if the second one still works
   249 TInt TestClientRemovalL()
   248 TInt TestClientRemovalL()
   250 	{
   249 	{
   251 	RFs fs;
   250 	RFs fs;
   252 	TInt r = fs.Connect();
   251 	TInt r = fs.Connect();
   253 	test_KErrNone(r);
   252 	test(r==KErrNone);
   254 	
   253 	
   255 	CFsNotify* notify1 = NULL;
   254 	CFsNotify* notify1 = NULL;
   256 	CFsNotify* notify2 = NULL;
   255 	CFsNotify* notify2 = NULL;
   257 	TRAP(r,notify1= CFsNotify::NewL(fs,KMinNotificationBufferSize);
   256 	TRAP(r,notify1= CFsNotify::NewL(fs,KMinNotificationBufferSize);
   258 		   notify2= CFsNotify::NewL(fs,KMinNotificationBufferSize);
   257 		   notify2= CFsNotify::NewL(fs,KMinNotificationBufferSize);
   259 		);
   258 		);
   260 	if(r!=KErrNone)
   259 	if(r!=KErrNone)
   261 		{
   260 		{
   262 		delete notify1;
   261 		delete notify1;
   263 		delete notify2;
   262 		delete notify2;
   264 		test_KErrNone(r);
   263 		test(r==KErrNone);
   265 		}
   264 		}
   266 	
   265 	
   267 	TBuf<40> path;
   266 	TBuf<40> path;
   268 	path.Append((TChar)gDriveToTest);
   267 	path.Append((TChar)gDriveToTest);
   269 	path.Append(_L(":\\F32-TST\\T_NOTIFIER\\"));
   268 	path.Append(_L(":\\F32-TST\\T_NOTIFIER\\"));
   274 	TBuf<40> fullname;
   273 	TBuf<40> fullname;
   275 	fullname.Append(path);
   274 	fullname.Append(path);
   276 	fullname.Append(filename);
   275 	fullname.Append(filename);
   277 	
   276 	
   278 	r = notify1->AddNotification((TUint)TFsNotification::ECreate,path,filename);
   277 	r = notify1->AddNotification((TUint)TFsNotification::ECreate,path,filename);
   279 	test_KErrNone(r);
   278 	test(r==KErrNone);
   280 	r = notify2->AddNotification((TUint)TFsNotification::ECreate,path,filename);
   279 	r = notify2->AddNotification((TUint)TFsNotification::ECreate,path,filename);
   281 	test_KErrNone(r);
   280 	test(r==KErrNone);
   282 	
   281 	
   283 	delete notify1; //Delete notify1 and ensure we still get notification on notify2
   282 	delete notify1; //Delete notify1 and ensure we still get notification on notify2
   284 	
   283 	
   285 	TRequestStatus status;
   284 	TRequestStatus status;
   286 	r = notify2->RequestNotifications(status);
   285 	r = notify2->RequestNotifications(status);
   287 	test_KErrNone(r);
   286 	test(r==KErrNone);
   288 	
   287 	
   289 	RFile file;
   288 	RFile file;
   290 	file.Replace(fs,fullname,EFileWrite); //Replace produces Create notification
   289 	file.Replace(fs,fullname,EFileWrite); //Replace produces Create notification
   291 	file.Close();
   290 	file.Close();
   292 	
   291 	
   293 	RTimer tim;
   292 	RTimer tim;
   294 	r = tim.CreateLocal();
   293 	r = tim.CreateLocal();
   295 	test_KErrNone(r);
   294 	test(r==KErrNone);
   296 	
   295 	
   297 	TRequestStatus timStatus;
   296 	TRequestStatus timStatus;
   298 	TTimeIntervalMicroSeconds32 time = 10000000; //10 seconds
   297 	TTimeIntervalMicroSeconds32 time = 10000000; //10 seconds
   299 	tim.After(timStatus,time);
   298 	tim.After(timStatus,time);
   300 	
   299 	
   301 	User::WaitForRequest(status,timStatus);
   300 	User::WaitForRequest(status,timStatus);
   302 	test(status!=KRequestPending);
   301 	test(status!=KRequestPending);
   303 	
   302 	
   304 	r = fs.Delete(fullname);
   303 	r = fs.Delete(fullname);
   305 	test_KErrNone(r);
   304 	test(r==KErrNone);
   306 	
   305 	
   307 	delete notify2;
   306 	delete notify2;
   308 	tim.Close();
   307 	tim.Close();
   309 	fs.Close();
   308 	fs.Close();
   310 	return KErrNone;
   309 	return KErrNone;
   323 	fs.Connect();
   322 	fs.Connect();
   324 	
   323 	
   325 	CFsNotify* notify = NULL;
   324 	CFsNotify* notify = NULL;
   326 	
   325 	
   327 	TRAPD(r,notify = CFsNotify::NewL(fs,KMinNotificationBufferSize););
   326 	TRAPD(r,notify = CFsNotify::NewL(fs,KMinNotificationBufferSize););
   328 	test_KErrNone(r);
   327 	test(r==KErrNone);
   329 	test(notify!=NULL);
   328 	test(notify!=NULL);
   330 	
   329 	
   331 	TBuf<40> path;
   330 	TBuf<40> path;
   332 	path.Append((TChar)gDriveToTest);
   331 	path.Append((TChar)gDriveToTest);
   333 	path.Append(_L(":\\"));
   332 	path.Append(_L(":\\"));
   334 	
   333 	
   335 	TBuf<15> filename;
   334 	TBuf<15> filename;
   336 	filename.Append(_L("*"));
   335 	filename.Append(_L("*"));
   337 	
   336 	
   338 	r = notify->AddNotification((TUint)TFsNotification::ECreate,path,filename);
   337 	r = notify->AddNotification((TUint)TFsNotification::ECreate,path,filename);
   339 	test_KErrNone(r);
   338 	test(r==KErrNone);
   340 	
   339 	
   341 	TRequestStatus status;
   340 	TRequestStatus status;
   342 	r = notify->RequestNotifications(status);
   341 	r = notify->RequestNotifications(status);
   343 	test_KErrNone(r);
   342 	test(r==KErrNone);
   344 	
   343 	
   345 	RFile file;
   344 	RFile file;
   346 	TBuf<40> filePath;
   345 	TBuf<40> filePath;
   347 	filePath.Append((TChar)gDriveToTest);
   346 	filePath.Append((TChar)gDriveToTest);
   348 	filePath.Append(_L(":\\file.root"));
   347 	filePath.Append(_L(":\\file.root"));
   349 	r = file.Replace(fs,filePath,EFileRead);
   348 	r = file.Replace(fs,filePath,EFileRead);
   350 	test_KErrNone(r);
   349 	test(r==KErrNone);
   351 	file.Close();
   350 	file.Close();
   352 	
   351 	
   353 	TRequestStatus s2;
   352 	TRequestStatus s2;
   354 	RTimer tim;
   353 	RTimer tim;
   355 	test(tim.CreateLocal()==KErrNone);
   354 	test(tim.CreateLocal()==KErrNone);
  1325 		    safe_test(multipleTestDoer,r,__LINE__,pkgDoer.iLineCall);
  1324 		    safe_test(multipleTestDoer,r,__LINE__,pkgDoer.iLineCall);
  1326 		    file.Close();
  1325 		    file.Close();
  1327 		    
  1326 		    
  1328 		    CFileMan* cfman = NULL;
  1327 		    CFileMan* cfman = NULL;
  1329 		    TRAP(r, cfman = CFileMan::NewL(fs);)
  1328 		    TRAP(r, cfman = CFileMan::NewL(fs);)
  1330 		    test_KErrNone(r);
  1329 		    test(r == KErrNone);
  1331             test(cfman != NULL);
  1330             test(cfman != NULL);
  1332             TBuf<40> unmonitored_path;
  1331             TBuf<40> unmonitored_path;
  1333             unmonitored_path.Append(gDriveToTest);
  1332             unmonitored_path.Append(gDriveToTest);
  1334             unmonitored_path.Append(_L(":\\F32-TST\\"));
  1333             unmonitored_path.Append(_L(":\\F32-TST\\"));
  1335             unmonitored_path.Append(pkgDoer.iString);
  1334             unmonitored_path.Append(pkgDoer.iString);
  1395 	{
  1394 	{
  1396 	RProcess process;
  1395 	RProcess process;
  1397 	TUidType uid;
  1396 	TUidType uid;
  1398 	TPtrC command((TText*)&gDriveToTest,1);
  1397 	TPtrC command((TText*)&gDriveToTest,1);
  1399 	TInt r = process.Create(aProcessName,command,uid);
  1398 	TInt r = process.Create(aProcessName,command,uid);
  1400 	test_KErrNone(r);
  1399 	test(r==KErrNone);
  1401 	process.Resume();
  1400 	process.Resume();
  1402 	TRequestStatus s1;
  1401 	TRequestStatus s1;
  1403 	TRequestStatus s2;
  1402 	TRequestStatus s2;
  1404 	RTimer tim;
  1403 	RTimer tim;
  1405 	r = tim.CreateLocal();
  1404 	r = tim.CreateLocal();
  1406 	test_KErrNone(r);
  1405 	test(r==KErrNone);
  1407 	TTimeIntervalMicroSeconds32 delay = 5000000; //5 seconds
  1406 	TTimeIntervalMicroSeconds32 delay = 5000000; //5 seconds
  1408 	tim.After(s1,delay);
  1407 	tim.After(s1,delay);
  1409 	process.Logon(s2);
  1408 	process.Logon(s2);
  1410 	User::WaitForRequest(s1,s2);
  1409 	User::WaitForRequest(s1,s2);
  1411 	test(s2.Int()!=KRequestPending);
  1410 	test(s2.Int()!=KRequestPending);
  1957 	User::LeaveIfError(package.iBarrier.CreateLocal(0));
  1956 	User::LeaveIfError(package.iBarrier.CreateLocal(0));
  1958 	RThread watcher;
  1957 	RThread watcher;
  1959 	RThread doer;
  1958 	RThread doer;
  1960 	
  1959 	
  1961 	TInt r = watcher.Create(_L("TestTwoNotificationsWatcherThread"),MultipleNotificationsTFWatcher,KDefaultStackSize,KMinHeapSize,KMaxHeapSize,&package);
  1960 	TInt r = watcher.Create(_L("TestTwoNotificationsWatcherThread"),MultipleNotificationsTFWatcher,KDefaultStackSize,KMinHeapSize,KMaxHeapSize,&package);
  1962 	test_KErrNone(r);
  1961 	test(r==KErrNone);
  1963 	r = doer.Create(_L("TestTwoNotificationsDoerThread"),TwoNotificationsTFDoer,KDefaultStackSize,KMinHeapSize,KMaxHeapSize,&package);
  1962 	r = doer.Create(_L("TestTwoNotificationsDoerThread"),TwoNotificationsTFDoer,KDefaultStackSize,KMinHeapSize,KMaxHeapSize,&package);
  1964 	test_KErrNone(r);
  1963 	test(r==KErrNone);
  1965 	test.Next(_L("TestTwoNotifications - Resume Watcher"));
  1964 	test.Next(_L("TestTwoNotifications - Resume Watcher"));
  1966 	watcher.Resume();
  1965 	watcher.Resume();
  1967 	test.Next(_L("TestTwoNotifications - Wait for Watcher to be ready"));
  1966 	test.Next(_L("TestTwoNotifications - Wait for Watcher to be ready"));
  1968 	package.iBarrier.Wait(); //Wait till Watcher has requested notification
  1967 	package.iBarrier.Wait(); //Wait till Watcher has requested notification
  1969 	test.Next(_L("TestTwoNotifications - Resume Doer"));
  1968 	test.Next(_L("TestTwoNotifications - Resume Doer"));
  2621 	User::LeaveIfError(package.iBarrier2.CreateLocal(0));
  2620 	User::LeaveIfError(package.iBarrier2.CreateLocal(0));
  2622 	RThread watcher;
  2621 	RThread watcher;
  2623 	RThread doer;
  2622 	RThread doer;
  2624 
  2623 
  2625 	TInt r = watcher.Create(_L("TestCancelNotification-WatcherThread"),TestCancelNotificationWatcher,KDefaultStackSize*2,KMinHeapSize,KMaxHeapSize,&package);
  2624 	TInt r = watcher.Create(_L("TestCancelNotification-WatcherThread"),TestCancelNotificationWatcher,KDefaultStackSize*2,KMinHeapSize,KMaxHeapSize,&package);
  2626 	test_KErrNone(r);
  2625 	test(r == KErrNone);
  2627 	r = doer.Create(_L("TestCancelNotification-DoerThread"),SimpleSingleNotificationTFDoer,KDefaultStackSize*2,KMinHeapSize,KMaxHeapSize,&package);
  2626 	r = doer.Create(_L("TestCancelNotification-DoerThread"),SimpleSingleNotificationTFDoer,KDefaultStackSize*2,KMinHeapSize,KMaxHeapSize,&package);
  2628 	test_KErrNone(r);
  2627 	test(r == KErrNone);
  2629 	test.Printf(_L("TestCancelNotificationL - Watcher.Resume()"));
  2628 	test.Printf(_L("TestCancelNotificationL - Watcher.Resume()"));
  2630 	watcher.Resume();
  2629 	watcher.Resume();
  2631 	test.Printf(_L("TestCancelNotificationL - Waiting on package.iBarrier.Wait()"));
  2630 	test.Printf(_L("TestCancelNotificationL - Waiting on package.iBarrier.Wait()"));
  2632 	package.iBarrier.Wait();	//W1 - Wait until Watcher has created CFsNotify
  2631 	package.iBarrier.Wait();	//W1 - Wait until Watcher has created CFsNotify
  2633 	test.Printf(_L("TestCancelNotificationL -Doer Resume"));
  2632 	test.Printf(_L("TestCancelNotificationL -Doer Resume"));
  2644 	test.Next(_L("TestCancelNotification - Wait for watcher thread death"));
  2643 	test.Next(_L("TestCancelNotification - Wait for watcher thread death"));
  2645 	watcher.Logon(status);
  2644 	watcher.Logon(status);
  2646 	
  2645 	
  2647 	RTimer tim;
  2646 	RTimer tim;
  2648 	r = tim.CreateLocal();
  2647 	r = tim.CreateLocal();
  2649 	test_KErrNone(r);
  2648 	test(r==KErrNone);
  2650 	
  2649 	
  2651 	TRequestStatus timStatus;
  2650 	TRequestStatus timStatus;
  2652 	TTimeIntervalMicroSeconds32 time = 10000000; //10 seconds
  2651 	TTimeIntervalMicroSeconds32 time = 10000000; //10 seconds
  2653 	tim.After(timStatus,time);
  2652 	tim.After(timStatus,time);
  2654 	
  2653 	
  2728 			TBuf<20> filename;
  2727 			TBuf<20> filename;
  2729 			filename.Append(_L("session.close"));
  2728 			filename.Append(_L("session.close"));
  2730 			
  2729 			
  2731 			RDebug::Printf("TestSessionCloseTF - Case 2 - Add Notification\n");
  2730 			RDebug::Printf("TestSessionCloseTF - Case 2 - Add Notification\n");
  2732 			r = notify->AddNotification((TUint)TFsNotification::ECreate,path,filename);
  2731 			r = notify->AddNotification((TUint)TFsNotification::ECreate,path,filename);
  2733 			test_KErrNone(r);
  2732 			test(r==KErrNone);
  2734 			
  2733 			
  2735 			RDebug::Printf("TestSessionCloseTF - Case 2 - Fs.Close\n");
  2734 			RDebug::Printf("TestSessionCloseTF - Case 2 - Fs.Close\n");
  2736 			fs.Close();
  2735 			fs.Close();
  2737 
  2736 
  2738 			CleanupStack::PushL(notify);
  2737 			CleanupStack::PushL(notify);
  2778 	TRequestStatus status;
  2777 	TRequestStatus status;
  2779 	thread.Logon(status);
  2778 	thread.Logon(status);
  2780 	User::WaitForRequest(status);
  2779 	User::WaitForRequest(status);
  2781 	test.Printf(_L("Kern-Exec 0 is EXPECTED\n"));
  2780 	test.Printf(_L("Kern-Exec 0 is EXPECTED\n"));
  2782 	TInt err = thread.ExitReason();
  2781 	TInt err = thread.ExitReason();
  2783 	test_KErrNone(err);
  2782 	test(err == KErrNone);
  2784 	TExitType et = thread.ExitType();
  2783 	TExitType et = thread.ExitType();
  2785 	test(et == EExitPanic);
  2784 	test(et == EExitPanic);
  2786 	CLOSE_AND_WAIT(thread);
  2785 	CLOSE_AND_WAIT(thread);
  2787 	sem.Close();
  2786 	sem.Close();
  2788 	}
  2787 	}
  2858 	//80*7 = 560.
  2857 	//80*7 = 560.
  2859 	// -4 means we should get 6 notifications
  2858 	// -4 means we should get 6 notifications
  2860 	//Except the first one will still be in the buffer
  2859 	//Except the first one will still be in the buffer
  2861 	// (as we've not called RequestNotification yet) so we'll only actually get 5.
  2860 	// (as we've not called RequestNotification yet) so we'll only actually get 5.
  2862 	TRAPD(r, notify = CFsNotify::NewL(fs,(80*7)-4));
  2861 	TRAPD(r, notify = CFsNotify::NewL(fs,(80*7)-4));
  2863 	test_KErrNone(r);
  2862 	test(r == KErrNone);
  2864 	User::LeaveIfNull(notify);
  2863 	User::LeaveIfNull(notify);
  2865 	notify->AddNotification(TFsNotification::EFileChange,path,filename);
  2864 	notify->AddNotification(TFsNotification::EFileChange,path,filename);
  2866 	notify->RequestNotifications(status);
  2865 	notify->RequestNotifications(status);
  2867 	
  2866 	
  2868 	//Signal that we are ready for doer to start (W1)
  2867 	//Signal that we are ready for doer to start (W1)
  2940 	 * The watcher's last notification should be an overflow
  2939 	 * The watcher's last notification should be an overflow
  2941 	 */
  2940 	 */
  2942 	test.Next(_L("TestOverflow"));
  2941 	test.Next(_L("TestOverflow"));
  2943 	RFs fs;
  2942 	RFs fs;
  2944 	TInt r = fs.Connect();
  2943 	TInt r = fs.Connect();
  2945 	test_KErrNone(r);
  2944 	test(r == KErrNone);
  2946 	_LIT(KFileName,"over.flow");
  2945 	_LIT(KFileName,"over.flow");
  2947 	SThreadPackage doerPkg;
  2946 	SThreadPackage doerPkg;
  2948 	doerPkg.iFileName = KFileName;
  2947 	doerPkg.iFileName = KFileName;
  2949 	
  2948 	
  2950 	SThreadPackage watcher1Pkg;
  2949 	SThreadPackage watcher1Pkg;
  2982 	// (W3)
  2981 	// (W3)
  2983 	watcher1Pkg.iBarrier.Signal();
  2982 	watcher1Pkg.iBarrier.Signal();
  2984 	
  2983 	
  2985 	RTimer tim;
  2984 	RTimer tim;
  2986 	r = tim.CreateLocal();
  2985 	r = tim.CreateLocal();
  2987 	test_KErrNone(r);
  2986 	test(r==KErrNone);
  2988 	TRequestStatus timStatus;
  2987 	TRequestStatus timStatus;
  2989 	
  2988 	
  2990 	test.Next(_L("TestOverflow - Wait for watcher1 thread death"));
  2989 	test.Next(_L("TestOverflow - Wait for watcher1 thread death"));
  2991 	TTimeIntervalMicroSeconds32 interval = 10000000; //10 seconds
  2990 	TTimeIntervalMicroSeconds32 interval = 10000000; //10 seconds
  2992 	tim.After(timStatus,interval);
  2991 	tim.After(timStatus,interval);
  3059 
  3058 
  3060 TInt HandlePostOverflow(SThreadPackage& aPackage, CFsNotify* aNotify)
  3059 TInt HandlePostOverflow(SThreadPackage& aPackage, CFsNotify* aNotify)
  3061     {
  3060     {
  3062     TRequestStatus status;
  3061     TRequestStatus status;
  3063     TInt r = aNotify->RequestNotifications(status);
  3062     TInt r = aNotify->RequestNotifications(status);
  3064     test_KErrNone(r);
  3063     test(r == KErrNone);
  3065     //Signal that overflow has been found (W4)
  3064     //Signal that overflow has been found (W4)
  3066     aPackage.iBarrier.Signal();
  3065     aPackage.iBarrier.Signal();
  3067     
  3066     
  3068     User::WaitForRequest(status);
  3067     User::WaitForRequest(status);
  3069     
  3068     
  3085             }
  3084             }
  3086         notification = aNotify->NextNotification();
  3085         notification = aNotify->NextNotification();
  3087         if(notification == NULL)
  3086         if(notification == NULL)
  3088             {
  3087             {
  3089             r = aNotify->RequestNotifications(status);
  3088             r = aNotify->RequestNotifications(status);
  3090             test_KErrNone(r);
  3089             test(r == KErrNone);
  3091             User::WaitForRequest(status);
  3090             User::WaitForRequest(status);
  3092             notification = aNotify->NextNotification();
  3091             notification = aNotify->NextNotification();
  3093             }
  3092             }
  3094         test(notification != NULL);
  3093         test(notification != NULL);
  3095         count++;
  3094         count++;
  3126     //80*7 = 560.
  3125     //80*7 = 560.
  3127     // -4 means we should get 6 notifications
  3126     // -4 means we should get 6 notifications
  3128     //Except the first one will still be in the buffer
  3127     //Except the first one will still be in the buffer
  3129     // (as we've not called RequestNotification yet) so we'll only actually get 5.
  3128     // (as we've not called RequestNotification yet) so we'll only actually get 5.
  3130     TRAPD(r, notify = CFsNotify::NewL(fs,(80*7)-4));
  3129     TRAPD(r, notify = CFsNotify::NewL(fs,(80*7)-4));
  3131     test_KErrNone(r);
  3130     test(r == KErrNone);
  3132     User::LeaveIfNull(notify);
  3131     User::LeaveIfNull(notify);
  3133     notify->AddNotification(TFsNotification::EFileChange,path,filename);
  3132     notify->AddNotification(TFsNotification::EFileChange,path,filename);
  3134     notify->RequestNotifications(status);
  3133     notify->RequestNotifications(status);
  3135     
  3134     
  3136     //Signal that we are ready for doer to start (W1)
  3135     //Signal that we are ready for doer to start (W1)
  3195 TInt TestPostOverflowNotifications()
  3194 TInt TestPostOverflowNotifications()
  3196     {
  3195     {
  3197     test.Next(_L("TestPostOverflowNotifications"));
  3196     test.Next(_L("TestPostOverflowNotifications"));
  3198     RFs fs;
  3197     RFs fs;
  3199     TInt r = fs.Connect();
  3198     TInt r = fs.Connect();
  3200     test_KErrNone(r);
  3199     test(r == KErrNone);
  3201     _LIT(KFileName,"post.over");
  3200     _LIT(KFileName,"post.over");
  3202     SThreadPackage doerPkg;
  3201     SThreadPackage doerPkg;
  3203     doerPkg.iFileName = KFileName;
  3202     doerPkg.iFileName = KFileName;
  3204     
  3203     
  3205     SThreadPackage watcher1Pkg;
  3204     SThreadPackage watcher1Pkg;
  3250     path.Append((TChar)gDriveToTest);
  3249     path.Append((TChar)gDriveToTest);
  3251     path.Append(_L(":\\F32-TST\\T_NOTIFIER\\"));
  3250     path.Append(_L(":\\F32-TST\\T_NOTIFIER\\"));
  3252     path.Append(watcher1Pkg.iFileName);
  3251     path.Append(watcher1Pkg.iFileName);
  3253     RFile file;
  3252     RFile file;
  3254     r = file.Open(fs,path,EFileWrite);
  3253     r = file.Open(fs,path,EFileWrite);
  3255     test_KErrNone(r);
  3254     test(r==KErrNone);
  3256     
  3255     
  3257     r = file.SetSize(1);
  3256     r = file.SetSize(1);
  3258     test_KErrNone(r);
  3257     test(r==KErrNone);
  3259     r = file.SetSize(2);
  3258     r = file.SetSize(2);
  3260     test_KErrNone(r);
  3259     test(r==KErrNone);
  3261     r = file.SetSize(3);
  3260     r = file.SetSize(3);
  3262     test_KErrNone(r);
  3261     test(r==KErrNone);
  3263     file.Close();
  3262     file.Close();
  3264     
  3263     
  3265     watcher1Pkg.iBarrier.Signal(); // Signal post operations complete (Sx)
  3264     watcher1Pkg.iBarrier.Signal(); // Signal post operations complete (Sx)
  3266     
  3265     
  3267     RTimer tim;
  3266     RTimer tim;
  3268     r = tim.CreateLocal();
  3267     r = tim.CreateLocal();
  3269     test_KErrNone(r);
  3268     test(r==KErrNone);
  3270     TRequestStatus timStatus;
  3269     TRequestStatus timStatus;
  3271     
  3270     
  3272     test.Next(_L("TestOverflow - Wait for watcher1 thread death"));
  3271     test.Next(_L("TestOverflow - Wait for watcher1 thread death"));
  3273     TTimeIntervalMicroSeconds32 interval = 10000000; //10 seconds
  3272     TTimeIntervalMicroSeconds32 interval = 10000000; //10 seconds
  3274     tim.After(timStatus,interval);
  3273     tim.After(timStatus,interval);
  3306 void TestNonDriveFilters()
  3305 void TestNonDriveFilters()
  3307 	{
  3306 	{
  3308 	test.Next(_L("TestNonDriveFilters"));
  3307 	test.Next(_L("TestNonDriveFilters"));
  3309 	RFs fs;
  3308 	RFs fs;
  3310 	TInt r = fs.Connect();
  3309 	TInt r = fs.Connect();
  3311 	test_KErrNone(r);
  3310 	test(r==KErrNone);
  3312 	
  3311 	
  3313 	TDriveList drives;
  3312 	TDriveList drives;
  3314 	r = fs.DriveList(drives);
  3313 	r = fs.DriveList(drives);
  3315 	test_KErrNone(r);
  3314 	test(r==KErrNone);
  3316 	
  3315 	
  3317 	CFsNotify* notify = NULL;
  3316 	CFsNotify* notify = NULL;
  3318 	TRAP(r,notify= CFsNotify::NewL(fs,KMinNotificationBufferSize));
  3317 	TRAP(r,notify= CFsNotify::NewL(fs,KMinNotificationBufferSize));
  3319 	
  3318 	
  3320 	TBuf<20> testfile;
  3319 	TBuf<20> testfile;
  3321 	testfile.Append(_L("test.file"));
  3320 	testfile.Append(_L("test.file"));
  3322 	
  3321 	
  3323 	r = notify->AddNotification((TUint)TFsNotification::ECreate,_L(""),testfile);
  3322 	r = notify->AddNotification((TUint)TFsNotification::ECreate,_L(""),testfile);
  3324 	test_KErrNone(r);
  3323 	test(r==KErrNone);
  3325 	
  3324 	
  3326 	TRequestStatus status;
  3325 	TRequestStatus status;
  3327 	r = notify->RequestNotifications(status);
  3326 	r = notify->RequestNotifications(status);
  3328 	test_KErrNone(r);
  3327 	test(r==KErrNone);
  3329 	
  3328 	
  3330 	TBuf<40> path;
  3329 	TBuf<40> path;
  3331 	path.Append((TChar)gDriveToTest);
  3330 	path.Append((TChar)gDriveToTest);
  3332 	path.Append(_L(":\\F32-TST\\T_NOTIFIER\\"));
  3331 	path.Append(_L(":\\F32-TST\\T_NOTIFIER\\"));
  3333 	
  3332 	
  3335 	fullname.Append(path);
  3334 	fullname.Append(path);
  3336 	fullname.Append(testfile);
  3335 	fullname.Append(testfile);
  3337 	
  3336 	
  3338 	RFile file;
  3337 	RFile file;
  3339 	r = fs.MkDirAll(path);
  3338 	r = fs.MkDirAll(path);
  3340 	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
  3339 	test(r==KErrNone || r==KErrAlreadyExists);
  3341 	r = file.Replace(fs,fullname,EFileWrite);
  3340 	r = file.Replace(fs,fullname,EFileWrite);
  3342 	test_KErrNone(r);
  3341 	test(r==KErrNone);
  3343 	file.Close();
  3342 	file.Close();
  3344 	
  3343 	
  3345 	fs.Delete(fullname);
  3344 	fs.Delete(fullname);
  3346 	
  3345 	
  3347 	TChar testDrive = (TChar)gDriveToTest;
  3346 	TChar testDrive = (TChar)gDriveToTest;
  3361 			break;
  3360 			break;
  3362 			}
  3361 			}
  3363 		}
  3362 		}
  3364 	
  3363 	
  3365 	r = fs.MkDirAll(fullname);
  3364 	r = fs.MkDirAll(fullname);
  3366 	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
  3365 	test(r==KErrNone || r==KErrAlreadyExists);
  3367 	r = file.Replace(fs,fullname,EFileWrite);
  3366 	r = file.Replace(fs,fullname,EFileWrite);
  3368 	test_KErrNone(r);
  3367 	test(r==KErrNone);
  3369 	file.Close();
  3368 	file.Close();
  3370 	
  3369 	
  3371 	RTimer timer1;
  3370 	RTimer timer1;
  3372 	r = timer1.CreateLocal();
  3371 	r = timer1.CreateLocal();
  3373 	test_KErrNone(r);
  3372 	test(r == KErrNone);
  3374 	TRequestStatus timeout;
  3373 	TRequestStatus timeout;
  3375 	TTimeIntervalMicroSeconds32 time = 10000000;    //10 seconds
  3374 	TTimeIntervalMicroSeconds32 time = 10000000;    //10 seconds
  3376 	timer1.After(timeout,time);
  3375 	timer1.After(timeout,time);
  3377 	User::WaitForRequest(timeout,status);
  3376 	User::WaitForRequest(timeout,status);
  3378 	test(status.Int() != KRequestPending);
  3377 	test(status.Int() != KRequestPending);
  3381 
  3380 
  3382 	const TFsNotification* notification = notify->NextNotification();
  3381 	const TFsNotification* notification = notify->NextNotification();
  3383 	test(notification != NULL);
  3382 	test(notification != NULL);
  3384 	TPtrC _path;
  3383 	TPtrC _path;
  3385 	r = notification->Path(_path);
  3384 	r = notification->Path(_path);
  3386 	test_KErrNone(r);
  3385 	test(r==KErrNone);
  3387 	TChar driveletter = _path[0];
  3386 	TChar driveletter = _path[0];
  3388 	driveletter.UpperCase();
  3387 	driveletter.UpperCase();
  3389 	test(driveletter ==  (TChar)gDriveToTest);
  3388 	test(driveletter ==  (TChar)gDriveToTest);
  3390 	
  3389 	
  3391 	if(notification = notify->NextNotification(), notification==NULL)
  3390 	if(notification = notify->NextNotification(), notification==NULL)
  3392 		{
  3391 		{
  3393 		TRequestStatus status2;
  3392 		TRequestStatus status2;
  3394 		r = notify->RequestNotifications(status2);
  3393 		r = notify->RequestNotifications(status2);
  3395 		test_KErrNone(r);
  3394 		test(r==KErrNone);
  3396 		
  3395 		
  3397 		RTimer timer2;
  3396 		RTimer timer2;
  3398 		r = timer2.CreateLocal();
  3397 		r = timer2.CreateLocal();
  3399 		test_KErrNone(r);
  3398 		test(r == KErrNone);
  3400 		TRequestStatus timeout2;
  3399 		TRequestStatus timeout2;
  3401 		TTimeIntervalMicroSeconds32 time2 = 10000000;    //10 seconds
  3400 		TTimeIntervalMicroSeconds32 time2 = 10000000;    //10 seconds
  3402 		timer2.After(timeout2,time2);
  3401 		timer2.After(timeout2,time2);
  3403 		User::WaitForRequest(timeout2,status2);
  3402 		User::WaitForRequest(timeout2,status2);
  3404 		test(status2.Int() != KRequestPending);
  3403 		test(status2.Int() != KRequestPending);
  3407 		
  3406 		
  3408 		notification = notify->NextNotification();
  3407 		notification = notify->NextNotification();
  3409 		}
  3408 		}
  3410 	test(notification != NULL);
  3409 	test(notification != NULL);
  3411 	r = notification->Path(_path);
  3410 	r = notification->Path(_path);
  3412 	test_KErrNone(r);
  3411 	test(r==KErrNone);
  3413 	driveletter = _path[0];
  3412 	driveletter = _path[0];
  3414 	driveletter.UpperCase();
  3413 	driveletter.UpperCase();
  3415 	test(driveletter == (TChar)'C');	
  3414 	test(driveletter == (TChar)'C');	
  3416 	
  3415 	
  3417 	delete notify;
  3416 	delete notify;
  3422 // We receive no notifications for files changed under the directory
  3421 // We receive no notifications for files changed under the directory
  3423 void NegativeTestDirStar()
  3422 void NegativeTestDirStar()
  3424 	{
  3423 	{
  3425 	RFs fs;
  3424 	RFs fs;
  3426 	TInt r = fs.Connect();
  3425 	TInt r = fs.Connect();
  3427 	test_KErrNone(r);
  3426 	test(r==KErrNone);
  3428 	
  3427 	
  3429 	CFsNotify* notify = NULL;
  3428 	CFsNotify* notify = NULL;
  3430 	TRAP(r,notify= CFsNotify::NewL(fs,KMinNotificationBufferSize));
  3429 	TRAP(r,notify= CFsNotify::NewL(fs,KMinNotificationBufferSize));
  3431 	
  3430 	
  3432 	TBuf<40> path;
  3431 	TBuf<40> path;
  3433 	path.Append((TChar)gDriveToTest);
  3432 	path.Append((TChar)gDriveToTest);
  3434 	path.Append(_L(":\\F32-TST\\T_NOTIFIER\\"));
  3433 	path.Append(_L(":\\F32-TST\\T_NOTIFIER\\"));
  3435 	r = fs.MkDirAll(path);
  3434 	r = fs.MkDirAll(path);
  3436 	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
  3435 	test(r == KErrNone || r == KErrAlreadyExists);
  3437 	
  3436 	
  3438 	r = notify->AddNotification((TUint)TFsNotification::ECreate,path,_L(""));
  3437 	r = notify->AddNotification((TUint)TFsNotification::ECreate,path,_L(""));
  3439 	test_KErrNone(r);
  3438 	test(r==KErrNone);
  3440 	
  3439 	
  3441 	TRequestStatus status;
  3440 	TRequestStatus status;
  3442 	r = notify->RequestNotifications(status);
  3441 	r = notify->RequestNotifications(status);
  3443 	test_KErrNone(r);
  3442 	test(r==KErrNone);
  3444 	
  3443 	
  3445 	TBuf<40> filename;
  3444 	TBuf<40> filename;
  3446 	filename.Append((TChar)gDriveToTest);
  3445 	filename.Append((TChar)gDriveToTest);
  3447 	filename.Append(_L(":\\F32-TST\\T_NOTIFIER\\dir.star"));
  3446 	filename.Append(_L(":\\F32-TST\\T_NOTIFIER\\dir.star"));
  3448 	
  3447 	
  3449 	RFile file;
  3448 	RFile file;
  3450 	r = file.Replace(fs,filename,EFileWrite);
  3449 	r = file.Replace(fs,filename,EFileWrite);
  3451 	test_KErrNone(r);
  3450 	test(r==KErrNone);
  3452 	file.Close();
  3451 	file.Close();
  3453 	
  3452 	
  3454 	RTimer timer1;
  3453 	RTimer timer1;
  3455 	r = timer1.CreateLocal();
  3454 	r = timer1.CreateLocal();
  3456 	test_KErrNone(r);
  3455 	test(r == KErrNone);
  3457 	TRequestStatus timeout;
  3456 	TRequestStatus timeout;
  3458 	TTimeIntervalMicroSeconds32 time = 2000000;    //2 seconds
  3457 	TTimeIntervalMicroSeconds32 time = 2000000;    //2 seconds
  3459 	timer1.After(timeout,time);
  3458 	timer1.After(timeout,time);
  3460 	User::WaitForRequest(timeout,status);
  3459 	User::WaitForRequest(timeout,status);
  3461 	test(status.Int() == KRequestPending);
  3460 	test(status.Int() == KRequestPending);
  3478 	//1
  3477 	//1
  3479 	test.Printf(_L("NegativeTests() A\n"));
  3478 	test.Printf(_L("NegativeTests() A\n"));
  3480 	RFs fs;
  3479 	RFs fs;
  3481 	CFsNotify* notify = NULL;
  3480 	CFsNotify* notify = NULL;
  3482 	TInt r = fs.Connect();
  3481 	TInt r = fs.Connect();
  3483 	test_KErrNone(r);
  3482 	test(r == KErrNone);
  3484 	TRAP(r,notify = CFsNotify::NewL(fs,0));
  3483 	TRAP(r,notify = CFsNotify::NewL(fs,0));
  3485 	test(notify != NULL);
  3484 	test(notify != NULL);
  3486 	delete notify;
  3485 	delete notify;
  3487 	notify = NULL;
  3486 	notify = NULL;
  3488 	
  3487 	
  3493 	delete notify;
  3492 	delete notify;
  3494 	notify = NULL;
  3493 	notify = NULL;
  3495 
  3494 
  3496 	test.Printf(_L("NegativeTests() C\n"));
  3495 	test.Printf(_L("NegativeTests() C\n"));
  3497 	TRAP(r,notify = CFsNotify::NewL(fs,KMaxTInt));
  3496 	TRAP(r,notify = CFsNotify::NewL(fs,KMaxTInt));
  3498 	test_Value(r, r == KErrArgument);
  3497 	test(r==KErrArgument);
  3499 	test(notify==NULL);
  3498 	test(notify==NULL);
  3500 	
  3499 	
  3501 	//3
  3500 	//3
  3502 	test.Printf(_L("NegativeTests() D\n"));
  3501 	test.Printf(_L("NegativeTests() D\n"));
  3503 	TBuf<40> path;
  3502 	TBuf<40> path;
  3504 	path.Append((TChar)gDriveToTest);
  3503 	path.Append((TChar)gDriveToTest);
  3505 	path.Append(_L(":\\F32-TST\\T_NOTIFIER\\"));
  3504 	path.Append(_L(":\\F32-TST\\T_NOTIFIER\\"));
  3506 	TBuf<20> filename;
  3505 	TBuf<20> filename;
  3507 	filename.Append(_L("file.txt"));
  3506 	filename.Append(_L("file.txt"));
  3508 	TRAP(r,notify = CFsNotify::NewL(fs,KMinNotificationBufferSize));
  3507 	TRAP(r,notify = CFsNotify::NewL(fs,KMinNotificationBufferSize));
  3509 	test_KErrNone(r);
  3508 	test(r==KErrNone);
  3510 	test(notify!=NULL);
  3509 	test(notify!=NULL);
  3511 	r = notify->AddNotification(0,path,filename);
  3510 	r = notify->AddNotification(0,path,filename);
  3512 	test_Value(r, r == KErrArgument);
  3511 	test(r == KErrArgument);
  3513 	
  3512 	
  3514 	test.Printf(_L("NegativeTests() E\n"));
  3513 	test.Printf(_L("NegativeTests() E\n"));
  3515 	r = notify->AddNotification((TUint)0x8000,path,filename); //invalid value
  3514 	r = notify->AddNotification((TUint)0x8000,path,filename); //invalid value
  3516 	test_Value(r, r == KErrArgument);
  3515 	test(r == KErrArgument);
  3517 	
  3516 	
  3518 	test.Printf(_L("NegativeTests() F\n"));
  3517 	test.Printf(_L("NegativeTests() F\n"));
  3519 	TBuf<40> invalidPath;
  3518 	TBuf<40> invalidPath;
  3520 	invalidPath.Append(_L("1:\\*"));
  3519 	invalidPath.Append(_L("1:\\*"));
  3521 	r = notify->AddNotification((TUint)TFsNotification::ECreate,invalidPath,filename);
  3520 	r = notify->AddNotification((TUint)TFsNotification::ECreate,invalidPath,filename);
  3522 	test_Value(r, r == KErrNotFound || r == KErrPathNotFound);
  3521 	test(r == KErrNotFound || r == KErrPathNotFound);
  3523 	
  3522 	
  3524 	//4
  3523 	//4
  3525 	test.Printf(_L("NegativeTests() G\n"));
  3524 	test.Printf(_L("NegativeTests() G\n"));
  3526 	TRequestStatus wrongStatus;
  3525 	TRequestStatus wrongStatus;
  3527 	wrongStatus = KRequestPending;
  3526 	wrongStatus = KRequestPending;
  3528 	r = notify->RequestNotifications(wrongStatus);
  3527 	r = notify->RequestNotifications(wrongStatus);
  3529 	test_Value(r, r == KErrInUse);
  3528 	test(r == KErrInUse);
  3530 	
  3529 	
  3531 	test.Printf(_L("NegativeTests() H\n"));
  3530 	test.Printf(_L("NegativeTests() H\n"));
  3532 	TRequestStatus status;
  3531 	TRequestStatus status;
  3533 	r = notify->RequestNotifications(status);
  3532 	r = notify->RequestNotifications(status);
  3534 	test_KErrNone(r);
  3533 	test(r==KErrNone);
  3535 	r = notify->CancelNotifications(wrongStatus);
  3534 	r = notify->CancelNotifications(wrongStatus);
  3536 	test_Value(r, r == KErrInUse);
  3535 	test(r == KErrInUse);
  3537 	
  3536 	
  3538 	delete notify;
  3537 	delete notify;
  3539 	notify = NULL;
  3538 	notify = NULL;
  3540 	fs.Close();
  3539 	fs.Close();
  3541 	}
  3540 	}
  3592  * the framework doesn't notify about them
  3591  * the framework doesn't notify about them
  3593  */
  3592  */
  3594 TInt TestNotificationsWithFServPlugins()
  3593 TInt TestNotificationsWithFServPlugins()
  3595 	{
  3594 	{
  3596 	TInt r = TheFs.AddPlugin(KNotifyPluginFileName);
  3595 	TInt r = TheFs.AddPlugin(KNotifyPluginFileName);
  3597 	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
  3596 	test(r==KErrNone || r==KErrAlreadyExists);
  3598 	r = TheFs.MountPlugin(KNotifyPluginName,(TUint)gDriveToTest.GetUpperCase() - 65);
  3597 	r = TheFs.MountPlugin(KNotifyPluginName,(TUint)gDriveToTest.GetUpperCase() - 65);
  3599 	if (r == KErrNotSupported)
  3598 	if (r == KErrNotSupported)
  3600 		{
  3599 		{
  3601 		test.Printf(_L("Plugins are not supported on pagable drives.\nSkipping test.\n"));
  3600 		test.Printf(_L("Plugins are not supported on pagable drives.\nSkipping test.\n"));
  3602 		safe_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
  3601 		safe_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
  3652 	test.Next(_L("CFsNotify Creation and Delete Tests"));
  3651 	test.Next(_L("CFsNotify Creation and Delete Tests"));
  3653 	//Creates and Deletes 1 CFsNotify
  3652 	//Creates and Deletes 1 CFsNotify
  3654 	__UHEAP_MARK;
  3653 	__UHEAP_MARK;
  3655 	r = TestNewDeleteCFsNotify(1);
  3654 	r = TestNewDeleteCFsNotify(1);
  3656 	__UHEAP_MARKEND;
  3655 	__UHEAP_MARKEND;
  3657 	test_KErrNone(r);	
  3656 	test(r==KErrNone);	
  3658 	//Creates and Deletes 50 CFsNotifys
  3657 	//Creates and Deletes 50 CFsNotifys
  3659 	__UHEAP_MARK;
  3658 	__UHEAP_MARK;
  3660 	r = TestNewDeleteCFsNotify(50);
  3659 	r = TestNewDeleteCFsNotify(50);
  3661 	__UHEAP_MARKEND;
  3660 	__UHEAP_MARKEND;
  3662 	test_KErrNone(r);
  3661 	test(r==KErrNone);
  3663 	test.Printf(_L("------- End of User Heap Tests ---------------------------------------\n"));
  3662 	test.Printf(_L("------- End of User Heap Tests ---------------------------------------\n"));
  3664 	//
  3663 	//
  3665 	// 2.	Add notification for creating a file
  3664 	// 2.	Add notification for creating a file
  3666 	//		Create that file
  3665 	//		Create that file
  3667 	//
  3666 	//
  3668 	PrintLine();
  3667 	PrintLine();
  3669 	__UHEAP_MARK;
  3668 	__UHEAP_MARK;
  3670 	r = SimpleCreateTestL();
  3669 	r = SimpleCreateTestL();
  3671 	__UHEAP_MARKEND;
  3670 	__UHEAP_MARKEND;
  3672 	test_KErrNone(r);
  3671 	test(r==KErrNone);
  3673 	test.Printf(_L("------- End of CFsNotify Creation and Delete Tests -------------------\n"));
  3672 	test.Printf(_L("------- End of CFsNotify Creation and Delete Tests -------------------\n"));
  3674 	//
  3673 	//
  3675 	// 3.	Add notification at the root of a drive
  3674 	// 3.	Add notification at the root of a drive
  3676 	//		Create a file in that drive
  3675 	//		Create a file in that drive
  3677 	//
  3676 	//
  3693 	//
  3692 	//
  3694 	PrintLine();
  3693 	PrintLine();
  3695 	__UHEAP_MARK;
  3694 	__UHEAP_MARK;
  3696 	r = TestTwoDoersL();
  3695 	r = TestTwoDoersL();
  3697 	__UHEAP_MARKEND;
  3696 	__UHEAP_MARKEND;
  3698 	test_KErrNone(r);
  3697 	test(r==KErrNone);
  3699 	test.Printf(_L("------- End of TwoDoers Test -----------------------------------------\n"));
  3698 	test.Printf(_L("------- End of TwoDoers Test -----------------------------------------\n"));
  3700 	//
  3699 	//
  3701 	// 6.	Create 2 file server sessions
  3700 	// 6.	Create 2 file server sessions
  3702 	//		Add a notification on each session for the same specific file creation
  3701 	//		Add a notification on each session for the same specific file creation
  3703 	//		Create that file
  3702 	//		Create that file
  3704 	//
  3703 	//
  3705 	PrintLine();
  3704 	PrintLine();
  3706 	__UHEAP_MARK;
  3705 	__UHEAP_MARK;
  3707 	r = TestTwoWatchersL();
  3706 	r = TestTwoWatchersL();
  3708 	__UHEAP_MARKEND;
  3707 	__UHEAP_MARKEND;
  3709 	test_KErrNone(r);
  3708 	test(r==KErrNone);
  3710 	test.Printf(_L("------- End of TwoWatchers Test --------------------------------------\n"));
  3709 	test.Printf(_L("------- End of TwoWatchers Test --------------------------------------\n"));
  3711 	//
  3710 	//
  3712 	// 7.	Create 2 file server sessions and 2 clients
  3711 	// 7.	Create 2 file server sessions and 2 clients
  3713 	//		Add a notification on each session for different file creations
  3712 	//		Add a notification on each session for different file creations
  3714 	//		Clients create a file each
  3713 	//		Clients create a file each
  3715 	//
  3714 	//
  3716 	PrintLine();
  3715 	PrintLine();
  3717 	__UHEAP_MARK;
  3716 	__UHEAP_MARK;
  3718 	r = TestTwoWatchersTwoDoersL();
  3717 	r = TestTwoWatchersTwoDoersL();
  3719 	__UHEAP_MARKEND;
  3718 	__UHEAP_MARKEND;
  3720 	test_KErrNone(r);
  3719 	test(r==KErrNone);
  3721 	test.Printf(_L("------- End of TwoWatchersTwoDoers Test ------------------------------\n"));
  3720 	test.Printf(_L("------- End of TwoWatchersTwoDoers Test ------------------------------\n"));
  3722 	//
  3721 	//
  3723 	// 8.	Add notification for a specific file creation
  3722 	// 8.	Add notification for a specific file creation
  3724 	//		Cancel the notification request
  3723 	//		Cancel the notification request
  3725 	//		Create that file
  3724 	//		Create that file
  3726 	//
  3725 	//
  3727 	PrintLine();
  3726 	PrintLine();
  3728 	__UHEAP_MARK;
  3727 	__UHEAP_MARK;
  3729 	r =  TestCancelNotificationL();
  3728 	r =  TestCancelNotificationL();
  3730 	__UHEAP_MARKEND;
  3729 	__UHEAP_MARKEND;
  3731 	test_KErrNone(r);
  3730 	test(r==KErrNone);
  3732 	test.Printf(_L("------- End of CancelNotification Test -------------------------------\n"));
  3731 	test.Printf(_L("------- End of CancelNotification Test -------------------------------\n"));
  3733 	//
  3732 	//
  3734 	// 9.	Create 2 file server sessions
  3733 	// 9.	Create 2 file server sessions
  3735 	//		Add a notification on each session for the same specific file creation
  3734 	//		Add a notification on each session for the same specific file creation
  3736 	//		Delete the first notification
  3735 	//		Delete the first notification
  3739 	PrintLine();
  3738 	PrintLine();
  3740 	test.Next(_L("TestClientRemoval"));
  3739 	test.Next(_L("TestClientRemoval"));
  3741 	__UHEAP_MARK;
  3740 	__UHEAP_MARK;
  3742 	r = TestClientRemovalL();
  3741 	r = TestClientRemovalL();
  3743 	__UHEAP_MARKEND;
  3742 	__UHEAP_MARKEND;
  3744 	test_KErrNone(r);
  3743 	test(r==KErrNone);
  3745 	test.Printf(_L("------- End of TestClientRemoval Test --------------------------------\n"));
  3744 	test.Printf(_L("------- End of TestClientRemoval Test --------------------------------\n"));
  3746 	//
  3745 	//
  3747 	// 10.	Create a CFsNotify object
  3746 	// 10.	Create a CFsNotify object
  3748 	//		Close the session before closing the subsession
  3747 	//		Close the session before closing the subsession
  3749 	//		Add notification and request notifications
  3748 	//		Add notification and request notifications
  3776 	//
  3775 	//
  3777 	PrintLine();
  3776 	PrintLine();
  3778 	test.Next(_L("EFileCreate Tests"));
  3777 	test.Next(_L("EFileCreate Tests"));
  3779 	_LIT(KFilename3,"file.create");
  3778 	_LIT(KFilename3,"file.create");
  3780 	r = TestMultipleNotificationsL(_L(""),KFilename3,5,5,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3779 	r = TestMultipleNotificationsL(_L(""),KFilename3,5,5,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3781 	test_KErrNone(r);
  3780 	test(r==KErrNone);
  3782 	test.Printf(_L("------- End of EFileCreate Tests -------------------------------------\n"));
  3781 	test.Printf(_L("------- End of EFileCreate Tests -------------------------------------\n"));
  3783 	//
  3782 	//
  3784 	// RFs::MkDir
  3783 	// RFs::MkDir
  3785 	// 2.  Add notification for a specific directory creation 
  3784 	// 2.  Add notification for a specific directory creation 
  3786 	//     Create that directory
  3785 	//     Create that directory
  3787 	//
  3786 	//
  3788 	PrintLine();
  3787 	PrintLine();
  3789 	test.Next(_L("EFsMkDir Test"));
  3788 	test.Next(_L("EFsMkDir Test"));
  3790 	_LIT(KDirName1,"dirCreate\\");
  3789 	_LIT(KDirName1,"dirCreate\\");
  3791 	r = TestMultipleNotificationsL(KDirName1,_L(""),1,1,t_notification::EFsMkDir,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3790 	r = TestMultipleNotificationsL(KDirName1,_L(""),1,1,t_notification::EFsMkDir,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3792 	test_KErrNone(r);
  3791 	test(r==KErrNone);
  3793 	test.Printf(_L("------- End of EFsMkDir Test -----------------------------------------\n"));
  3792 	test.Printf(_L("------- End of EFsMkDir Test -----------------------------------------\n"));
  3794 	//
  3793 	//
  3795 	// RFile::Replace
  3794 	// RFile::Replace
  3796 	// 3.  Add notification for a specific file creation
  3795 	// 3.  Add notification for a specific file creation
  3797 	//     Replace that file
  3796 	//     Replace that file
  3798 	//
  3797 	//
  3799 	PrintLine();
  3798 	PrintLine();
  3800 	test.Next(_L("EFileReplace Test"));
  3799 	test.Next(_L("EFileReplace Test"));
  3801 	r = TestMultipleNotificationsL(_L(""),KFilename3,1,1,t_notification::EFileReplace,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3800 	r = TestMultipleNotificationsL(_L(""),KFilename3,1,1,t_notification::EFileReplace,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3802 	test_KErrNone(r);
  3801 	test(r==KErrNone);
  3803 	test.Printf(_L("------- End of EFileReplace Test -------------------------------------\n"));
  3802 	test.Printf(_L("------- End of EFileReplace Test -------------------------------------\n"));
  3804 	//
  3803 	//
  3805 	// 4.  Add notification for a specific file creation
  3804 	// 4.  Add notification for a specific file creation
  3806 	//     Remove that notification
  3805 	//     Remove that notification
  3807 	//     Create that file
  3806 	//     Create that file
  3808 	//
  3807 	//
  3809 	PrintLine();
  3808 	PrintLine();
  3810 	__UHEAP_MARK;
  3809 	__UHEAP_MARK;
  3811 	r =  TestAddRemoveNotificationL();
  3810 	r =  TestAddRemoveNotificationL();
  3812 	__UHEAP_MARKEND;
  3811 	__UHEAP_MARKEND;
  3813 	test_KErrNone(r);
  3812 	test(r==KErrNone);
  3814 	test.Printf(_L("------- End of Add and Remove Notification Test ----------------------\n"));
  3813 	test.Printf(_L("------- End of Add and Remove Notification Test ----------------------\n"));
  3815 	//
  3814 	//
  3816 	// Wildcard Create Tests
  3815 	// Wildcard Create Tests
  3817 	// 5.  Add notification for file creation using wildcard name
  3816 	// 5.  Add notification for file creation using wildcard name
  3818 	//     Add notification for file/directory wildcard including subdirectories 
  3817 	//     Add notification for file/directory wildcard including subdirectories 
  3822 	test.Next(_L("Wildcard Create Tests"));
  3821 	test.Next(_L("Wildcard Create Tests"));
  3823 	//
  3822 	//
  3824 	// Wildcard Name
  3823 	// Wildcard Name
  3825 	_LIT(KWildcardName1,"*");
  3824 	_LIT(KWildcardName1,"*");
  3826 	r = TestMultipleNotificationsL(_L(""),KWildcardName1,1,1,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3825 	r = TestMultipleNotificationsL(_L(""),KWildcardName1,1,1,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3827 	test_KErrNone(r);
  3826 	test(r==KErrNone);
  3828 	r = TestMultipleNotificationsL(KWildcardName1,KWildcardName1,1,1,t_notification::EFileCreate_subs,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3827 	r = TestMultipleNotificationsL(KWildcardName1,KWildcardName1,1,1,t_notification::EFileCreate_subs,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3829 	test_KErrNone(r);
  3828 	test(r==KErrNone);
  3830 	r = TestMultipleNotificationsL(KWildcardName1,KWildcardName1,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__);
  3829 	r = TestMultipleNotificationsL(KWildcardName1,KWildcardName1,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__);
  3831 	test_KErrNone(r);
  3830 	test(r==KErrNone);
  3832 	//
  3831 	//
  3833 	// Wildcard including Subdirectories
  3832 	// Wildcard including Subdirectories
  3834 	_LIT(KWildcardName2,"*\\");
  3833 	_LIT(KWildcardName2,"*\\");
  3835 	r = TestMultipleNotificationsL(KWildcardName2,KWildcardName1,1,1,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__);
  3834 	r = TestMultipleNotificationsL(KWildcardName2,KWildcardName1,1,1,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__);
  3836 	test_KErrNone(r);
  3835 	test(r==KErrNone);
  3837 	r = TestMultipleNotificationsL(KWildcardName2,KWildcardName1,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3836 	r = TestMultipleNotificationsL(KWildcardName2,KWildcardName1,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3838 	test_KErrNone(r);
  3837 	test(r==KErrNone);
  3839 	_LIT(KDirName2,"SubDir\\");
  3838 	_LIT(KDirName2,"SubDir\\");
  3840 	_LIT(KWildcardName3,"?");
  3839 	_LIT(KWildcardName3,"?");
  3841 	r = TestMultipleNotificationsL(KDirName2,KWildcardName3,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3840 	r = TestMultipleNotificationsL(KDirName2,KWildcardName3,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3842 	test_KErrNone(r);
  3841 	test(r==KErrNone);
  3843 	//
  3842 	//
  3844 	// Wildcard Type
  3843 	// Wildcard Type
  3845 	_LIT(KWildcardName4,"*.*");
  3844 	_LIT(KWildcardName4,"*.*");
  3846 	r = TestMultipleNotificationsL(_L(""),KWildcardName4,1,1,t_notification::EFileCreate_txt_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3845 	r = TestMultipleNotificationsL(_L(""),KWildcardName4,1,1,t_notification::EFileCreate_txt_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3847 	test_KErrNone(r);
  3846 	test(r==KErrNone);
  3848 	r = TestMultipleNotificationsL(_L(""),KWildcardName4,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__);
  3847 	r = TestMultipleNotificationsL(_L(""),KWildcardName4,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__);
  3849 	test_KErrNone(r);
  3848 	test(r==KErrNone);
  3850 	//
  3849 	//
  3851 	// 6.  Add notification for file creation for a specific type
  3850 	// 6.  Add notification for file creation for a specific type
  3852 	//     Create file with that type
  3851 	//     Create file with that type
  3853 	//     Create file with different type
  3852 	//     Create file with different type
  3854 	//
  3853 	//
  3855 	_LIT(KWildcardName5,"*.txt");
  3854 	_LIT(KWildcardName5,"*.txt");
  3856 	r = TestMultipleNotificationsL(_L(""),KWildcardName5,1,1,t_notification::EFileCreate_txt,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3855 	r = TestMultipleNotificationsL(_L(""),KWildcardName5,1,1,t_notification::EFileCreate_txt,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3857 	test_KErrNone(r);
  3856 	test(r==KErrNone);
  3858 	test.Printf(_L("------- End of Wildcard Create Tests ---------------------------------\n"));
  3857 	test.Printf(_L("------- End of Wildcard Create Tests ---------------------------------\n"));
  3859 	
  3858 	
  3860 	
  3859 	
  3861 	//=============================================================================
  3860 	//=============================================================================
  3862 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2445
  3861 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2445
  3874 	//
  3873 	//
  3875 	PrintLine();
  3874 	PrintLine();
  3876 	test.Next(_L("Attribute Tests"));
  3875 	test.Next(_L("Attribute Tests"));
  3877 	_LIT(KFilename4,"file.setatts");
  3876 	_LIT(KFilename4,"file.setatts");
  3878 	r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFileSetAtt,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3877 	r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFileSetAtt,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3879 	test_KErrNone(r);
  3878 	test(r==KErrNone);
  3880 	r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFileSet,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3879 	r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFileSet,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3881 	test_KErrNone(r);
  3880 	test(r==KErrNone);
  3882 	r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFsSetEntry,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3881 	r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFsSetEntry,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3883 	test_KErrNone(r);
  3882 	test(r==KErrNone);
  3884 	//
  3883 	//
  3885 	// Wildcard Attribute Test including subdirectories
  3884 	// Wildcard Attribute Test including subdirectories
  3886 	// 2.  Add notification for file attribute change using wildcard name
  3885 	// 2.  Add notification for file attribute change using wildcard name
  3887 	//     Create number of files that match the notification
  3886 	//     Create number of files that match the notification
  3888 	//     Change attributes of some files
  3887 	//     Change attributes of some files
  3889 	//
  3888 	//
  3890 	r = TestMultipleNotificationsL(KWildcardName2,_L("*"),3,3,t_notification::EFileSetAtt_subs,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3889 	r = TestMultipleNotificationsL(KWildcardName2,_L("*"),3,3,t_notification::EFileSetAtt_subs,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3891 	test_KErrNone(r);
  3890 	test(r==KErrNone);
  3892 	test.Printf(_L("------- End of Attribute Tests ---------------------------------------\n"));
  3891 	test.Printf(_L("------- End of Attribute Tests ---------------------------------------\n"));
  3893 	
  3892 	
  3894 	
  3893 	
  3895 	//=============================================================================
  3894 	//=============================================================================
  3896 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2446
  3895 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2446
  3908 	// 
  3907 	// 
  3909 	PrintLine();
  3908 	PrintLine();
  3910 	test.Next(_L("Rename Tests"));
  3909 	test.Next(_L("Rename Tests"));
  3911 	_LIT(KFilename5,"file.rename");
  3910 	_LIT(KFilename5,"file.rename");
  3912 	r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFsReplace,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3911 	r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFsReplace,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3913 	test_KErrNone(r);
  3912 	test(r==KErrNone);
  3914 	r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFsRename,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3913 	r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFsRename,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3915 	test_KErrNone(r);
  3914 	test(r==KErrNone);
  3916 	r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFileRename,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3915 	r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFileRename,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3917 	test_KErrNone(r);
  3916 	test(r==KErrNone);
  3918 	//
  3917 	//
  3919 	// 2.  Add notification for a specific directory rename
  3918 	// 2.  Add notification for a specific directory rename
  3920 	//     Rename that directory
  3919 	//     Rename that directory
  3921 	//
  3920 	//
  3922 	_LIT(KDirName3,"dirRename\\");
  3921 	_LIT(KDirName3,"dirRename\\");
  3923 	r = TestMultipleNotificationsL(KDirName3,_L(""),1,1,t_notification::EFsRename_dir,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3922 	r = TestMultipleNotificationsL(KDirName3,_L(""),1,1,t_notification::EFsRename_dir,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3924 	test_KErrNone(r);
  3923 	test(r==KErrNone);
  3925 	//
  3924 	//
  3926 	// 3.  Add notification for file rename using wildcard name
  3925 	// 3.  Add notification for file rename using wildcard name
  3927 	//     Create file that match the notification
  3926 	//     Create file that match the notification
  3928 	//     Repeatedly rename the file
  3927 	//     Repeatedly rename the file
  3929 	//
  3928 	//
  3930 	r = TestMultipleNotificationsL(_L(""),KWildcardName1,3,3,t_notification::EFileRename_wild,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3929 	r = TestMultipleNotificationsL(_L(""),KWildcardName1,3,3,t_notification::EFileRename_wild,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3931 	test_KErrNone(r);
  3930 	test(r==KErrNone);
  3932 	test.Printf(_L("------- End of Rename Tests ------------------------------------------\n"));
  3931 	test.Printf(_L("------- End of Rename Tests ------------------------------------------\n"));
  3933 	
  3932 	
  3934 	
  3933 	
  3935 	//=============================================================================
  3934 	//=============================================================================
  3936 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2447
  3935 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2447
  3948 	//
  3947 	//
  3949 	PrintLine();
  3948 	PrintLine();
  3950 	test.Next(_L("EFsDelete Test"));
  3949 	test.Next(_L("EFsDelete Test"));
  3951 	_LIT(KFilename6,"file.delete");
  3950 	_LIT(KFilename6,"file.delete");
  3952 	r = TestMultipleNotificationsL(_L(""),KFilename6,1,1,t_notification::EFsDelete,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3951 	r = TestMultipleNotificationsL(_L(""),KFilename6,1,1,t_notification::EFsDelete,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3953 	test_KErrNone(r);	
  3952 	test(r==KErrNone);	
  3954 	//
  3953 	//
  3955 	// RFs::RmDir
  3954 	// RFs::RmDir
  3956 	// 2.  Add notification for a specific directory delete
  3955 	// 2.  Add notification for a specific directory delete
  3957 	//     Delete that directory
  3956 	//     Delete that directory
  3958 	//
  3957 	//
  3959 	PrintLine();
  3958 	PrintLine();
  3960 	test.Next(_L("EFsRmDir Tests"));
  3959 	test.Next(_L("EFsRmDir Tests"));
  3961 	_LIT(KDirName4,"dirRemove\\");
  3960 	_LIT(KDirName4,"dirRemove\\");
  3962 	r = TestMultipleNotificationsL(KDirName4,_L(""),1,1,t_notification::EFsRmDir,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3961 	r = TestMultipleNotificationsL(KDirName4,_L(""),1,1,t_notification::EFsRmDir,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3963 	test_KErrNone(r);
  3962 	test(r==KErrNone);
  3964     //
  3963     //
  3965     // This test should not receive any notifications because a non-empty directory cannot be removed
  3964     // This test should not receive any notifications because a non-empty directory cannot be removed
  3966     // 3.  Add notification for specific directory delete
  3965     // 3.  Add notification for specific directory delete
  3967     //     Create files inside that directory
  3966     //     Create files inside that directory
  3968     //     Delete the directory
  3967     //     Delete the directory
  3969     //
  3968     //
  3970     _LIT(KDirName5,"dirRmNonEmp\\");
  3969     _LIT(KDirName5,"dirRmNonEmp\\");
  3971     r = TestMultipleNotificationsL(KDirName5,_L(""),1,1,t_notification::EFsRmDir_nonEmpty,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)ETrue,__LINE__);
  3970     r = TestMultipleNotificationsL(KDirName5,_L(""),1,1,t_notification::EFsRmDir_nonEmpty,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)ETrue,__LINE__);
  3972     test_KErrNone(r);	
  3971     test(r==KErrNone);	
  3973     //
  3972     //
  3974     // Wildcard Name ("*")
  3973     // Wildcard Name ("*")
  3975     // 4.  Add notification for directory delete using wildcard name
  3974     // 4.  Add notification for directory delete using wildcard name
  3976     //     Create directory that match the notification
  3975     //     Create directory that match the notification
  3977 	//	   Delete that directory
  3976 	//	   Delete that directory
  3978     //
  3977     //
  3979     r = TestMultipleNotificationsL(KWildcardName1,_L(""),1,1,t_notification::EFsRmDir_wild,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3978     r = TestMultipleNotificationsL(KWildcardName1,_L(""),1,1,t_notification::EFsRmDir_wild,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3980     test_KErrNone(r);	
  3979     test(r==KErrNone);	
  3981     //
  3980     //
  3982     // Wildcard Type ("*.txt")
  3981     // Wildcard Type ("*.txt")
  3983     // Creates files with different types and should only receive notifications from "*.txt" file deletions
  3982     // Creates files with different types and should only receive notifications from "*.txt" file deletions
  3984     // 5.  Add notification for file deletes using wildcard type
  3983     // 5.  Add notification for file deletes using wildcard type
  3985     //     Create number of files that match the notification
  3984     //     Create number of files that match the notification
  3986     //     Delete those files
  3985     //     Delete those files
  3987     //
  3986     //
  3988     r = TestMultipleNotificationsL(_L(""),KWildcardName4,3,3,t_notification::EFsDelete,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3987     r = TestMultipleNotificationsL(_L(""),KWildcardName4,3,3,t_notification::EFsDelete,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  3989     test_KErrNone(r);
  3988     test(r==KErrNone);
  3990     test.Printf(_L("------- End of Delete Tests ------------------------------------------\n"));
  3989     test.Printf(_L("------- End of Delete Tests ------------------------------------------\n"));
  3991 	
  3990 	
  3992 	
  3991 	
  3993 	//======================================================================
  3992 	//======================================================================
  3994 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2448
  3993 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2448
  4012 	test.Next(_L("EFileWrite Tests"));
  4011 	test.Next(_L("EFileWrite Tests"));
  4013 	_LIT(KFilename7,"file.write");
  4012 	_LIT(KFilename7,"file.write");
  4014 	__UHEAP_MARK;
  4013 	__UHEAP_MARK;
  4015 	r = TestMultipleNotificationsL(_L(""),KFilename7,7,7,t_notification::EFileWrite,TFsNotification::EFileChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4014 	r = TestMultipleNotificationsL(_L(""),KFilename7,7,7,t_notification::EFileWrite,TFsNotification::EFileChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4016 	__UHEAP_MARKEND;
  4015 	__UHEAP_MARKEND;
  4017 	test_KErrNone(r);
  4016 	test(r==KErrNone);
  4018 	//
  4017 	//
  4019 	// 2.  Add notification for a specific file change
  4018 	// 2.  Add notification for a specific file change
  4020 	//     Write to the specified file a number of times without changing its size
  4019 	//     Write to the specified file a number of times without changing its size
  4021 	//
  4020 	//
  4022 	// Four letters are written to a file, then the first letter in the file is replaced aIterations times
  4021 	// Four letters are written to a file, then the first letter in the file is replaced aIterations times
  4023 	//     aMaxNotifications = 1 + aIterations
  4022 	//     aMaxNotifications = 1 + aIterations
  4024 	//
  4023 	//
  4025 	r = TestMultipleNotificationsL(_L(""),KFilename7,3,4,t_notification::EFileWrite_samesize,TFsNotification::EFileChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4024 	r = TestMultipleNotificationsL(_L(""),KFilename7,3,4,t_notification::EFileWrite_samesize,TFsNotification::EFileChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4026 	test_KErrNone(r);
  4025 	test(r==KErrNone);
  4027 	test.Printf(_L("------- End of EFileWrite Tests --------------------------------------\n"));
  4026 	test.Printf(_L("------- End of EFileWrite Tests --------------------------------------\n"));
  4028 	//
  4027 	//
  4029 	// 3.  Add notification for a specific file change
  4028 	// 3.  Add notification for a specific file change
  4030 	//     Write to that file asynchronously
  4029 	//     Write to that file asynchronously
  4031 	//
  4030 	//
  4033 	test.Next(_L("EFileWrite_async Tests"));
  4032 	test.Next(_L("EFileWrite_async Tests"));
  4034 	_LIT(KFilename8,"async.write");
  4033 	_LIT(KFilename8,"async.write");
  4035 	__UHEAP_MARK;
  4034 	__UHEAP_MARK;
  4036 	r = TestMultipleNotificationsL(_L(""),KFilename8,4,4,t_notification::EFileWrite_async,TFsNotification::EFileChange,2*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4035 	r = TestMultipleNotificationsL(_L(""),KFilename8,4,4,t_notification::EFileWrite_async,TFsNotification::EFileChange,2*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4037 	__UHEAP_MARKEND;
  4036 	__UHEAP_MARKEND;
  4038 	test_KErrNone(r);
  4037 	test(r==KErrNone);
  4039 	test.Printf(_L("------- End of EFileWrite_async Tests --------------------------------\n"));	
  4038 	test.Printf(_L("------- End of EFileWrite_async Tests --------------------------------\n"));	
  4040 	//
  4039 	//
  4041 	// File Set Size
  4040 	// File Set Size
  4042 	// 4.  Add notification for a specific file change
  4041 	// 4.  Add notification for a specific file change
  4043 	//     Both increase and decrease the file sizes a number of times
  4042 	//     Both increase and decrease the file sizes a number of times
  4047 	//
  4046 	//
  4048 	PrintLine();
  4047 	PrintLine();
  4049 	test.Next(_L("EFileSetSize Tests"));
  4048 	test.Next(_L("EFileSetSize Tests"));
  4050 	_LIT(KFilename9,"file.setsize");
  4049 	_LIT(KFilename9,"file.setsize");
  4051 	r = TestMultipleNotificationsL(_L(""),KFilename9,5,9,t_notification::EFileSetSize,TFsNotification::EFileChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4050 	r = TestMultipleNotificationsL(_L(""),KFilename9,5,9,t_notification::EFileSetSize,TFsNotification::EFileChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4052 	test_KErrNone(r);
  4051 	test(r==KErrNone);
  4053 	test.Printf(_L("------- End of EFileSetSize Tests ------------------------------------\n"));
  4052 	test.Printf(_L("------- End of EFileSetSize Tests ------------------------------------\n"));
  4054 
  4053 
  4055 
  4054 
  4056 	//
  4055 	//
  4057     PrintLine();
  4056     PrintLine();
  4058 	test.Next(_L("CFileMan Tests"));
  4057 	test.Next(_L("CFileMan Tests"));
  4059 	_LIT(KFilenameCFMan,"cf1le.man");
  4058 	_LIT(KFilenameCFMan,"cf1le.man");
  4060 	TUint notificationTypes = (TUint)TFsNotification::ECreate|TFsNotification::EFileChange|TFsNotification::EAttribute|TFsNotification::EDelete|TFsNotification::ERename;
  4059 	TUint notificationTypes = (TUint)TFsNotification::ECreate|TFsNotification::EFileChange|TFsNotification::EAttribute|TFsNotification::EDelete|TFsNotification::ERename;
  4061 	r = TestMultipleNotificationsL(_L(""),KFilenameCFMan,1,5,t_notification::ECFileManMove,notificationTypes,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4060 	r = TestMultipleNotificationsL(_L(""),KFilenameCFMan,1,5,t_notification::ECFileManMove,notificationTypes,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4062 	test_KErrNone(r);
  4061 	test(r==KErrNone);
  4063 	test.Printf(_L("------- End of CFileMan Tests -------------------------------------\n"));
  4062 	test.Printf(_L("------- End of CFileMan Tests -------------------------------------\n"));
  4064 	
  4063 	
  4065 	
  4064 	
  4066 	//========================================================================================
  4065 	//========================================================================================
  4067 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2449
  4066 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2449
  4080 	//
  4079 	//
  4081 	PrintLine();
  4080 	PrintLine();
  4082 	test.Next(_L("Mount Tests"));
  4081 	test.Next(_L("Mount Tests"));
  4083 	TFullName filesystemName;
  4082 	TFullName filesystemName;
  4084 	r = TheFs.FileSystemName(filesystemName,globalDriveNum);
  4083 	r = TheFs.FileSystemName(filesystemName,globalDriveNum);
  4085 	test_KErrNone(r);
  4084 	test(r==KErrNone);
  4086 	r = TestMultipleNotificationsL(filesystemName,1,1,t_notification::EDismount,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4085 	r = TestMultipleNotificationsL(filesystemName,1,1,t_notification::EDismount,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4087 	test_KErrNone(r);
  4086 	test(r==KErrNone);
  4088 	//
  4087 	//
  4089 	// RFs::MountFileSystem
  4088 	// RFs::MountFileSystem
  4090 	// 2.  Add notification for media change
  4089 	// 2.  Add notification for media change
  4091 	//     Mount the file system
  4090 	//     Mount the file system
  4092 	//
  4091 	//
  4093 	r = TestMultipleNotificationsL(filesystemName,1,1,t_notification::EMount,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4092 	r = TestMultipleNotificationsL(filesystemName,1,1,t_notification::EMount,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4094 	test_KErrNone(r);
  4093 	test(r==KErrNone);
  4095 	//
  4094 	//
  4096 	// Repeatedly mount and dismount the file system
  4095 	// Repeatedly mount and dismount the file system
  4097 	// 3.  Add notification for media change
  4096 	// 3.  Add notification for media change
  4098 	//     Repeatedly dismount and mount the file system
  4097 	//     Repeatedly dismount and mount the file system
  4099 	//
  4098 	//
  4100 	// The file system is dismounted and mounted aIterations times
  4099 	// The file system is dismounted and mounted aIterations times
  4101 	//     aMaxNotifications = 2*aIterations
  4100 	//     aMaxNotifications = 2*aIterations
  4102 	//
  4101 	//
  4103 	r = TestMultipleNotificationsL(filesystemName,5,10,t_notification::EMountDismount,TFsNotification::EMediaChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4102 	r = TestMultipleNotificationsL(filesystemName,5,10,t_notification::EMountDismount,TFsNotification::EMediaChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4104 	test_KErrNone(r);
  4103 	test(r==KErrNone);
  4105 	//
  4104 	//
  4106 	// RFs::MountFileSystemAndScan
  4105 	// RFs::MountFileSystemAndScan
  4107 	// 4.  Add notification for media change
  4106 	// 4.  Add notification for media change
  4108 	//     Mount and scan the file system
  4107 	//     Mount and scan the file system
  4109 	//
  4108 	//
  4110 	// The file system is dismounted and mounted aIterations times
  4109 	// The file system is dismounted and mounted aIterations times
  4111 	//     aMaxNotifications = 2*aIterations
  4110 	//     aMaxNotifications = 2*aIterations
  4112 	//
  4111 	//
  4113 //#ifndef __WINS__
  4112 //#ifndef __WINS__
  4114 //    r = TestMultipleNotificationsL(filesystemName,1,2,t_notification::EMountScan,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4113 //    r = TestMultipleNotificationsL(filesystemName,1,2,t_notification::EMountScan,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4115 //    test_KErrNone(r);
  4114 //    test(r==KErrNone);
  4116 //#endif
  4115 //#endif
  4117 	test.Printf(_L("------- End of Mount Tests -------------------------------------------\n"));
  4116 	test.Printf(_L("------- End of Mount Tests -------------------------------------------\n"));
  4118 	TDriveInfo drvInfo;
  4117 	TDriveInfo drvInfo;
  4119 	TInt driveNum;
  4118 	TInt driveNum;
  4120 	TheFs.CharToDrive(gDriveToTest,driveNum);
  4119 	TheFs.CharToDrive(gDriveToTest,driveNum);
  4121 	r = TheFs.Drive(drvInfo,driveNum);
  4120 	r = TheFs.Drive(drvInfo,driveNum);
  4122 	test_KErrNone(r);
  4121 	test (r == KErrNone);
  4123 	TPtrC driveDes((TText*)&gDriveToTest,1);
  4122 	TPtrC driveDes((TText*)&gDriveToTest,1);
  4124 	//
  4123 	//
  4125 	// Manual Tests - Will only run on removable drives
  4124 	// Manual Tests - Will only run on removable drives
  4126 	//
  4125 	//
  4127 /*	if(drvInfo.iDriveAtt & KDriveAttRemovable)
  4126 /*	if(drvInfo.iDriveAtt & KDriveAttRemovable)
  4131 		//    Remove media card manually
  4130 		//    Remove media card manually
  4132 		//
  4131 		//
  4133 		PrintLine();
  4132 		PrintLine();
  4134 		test.Next(_L("Media Card Removal/Insertion Tests"));
  4133 		test.Next(_L("Media Card Removal/Insertion Tests"));
  4135 		r = TestMultipleNotificationsL(driveDes,1,1,t_notification::EMediaCardRemoval,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4134 		r = TestMultipleNotificationsL(driveDes,1,1,t_notification::EMediaCardRemoval,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4136 		test_KErrNone(r);
  4135 		test(r==KErrNone);
  4137 		//
  4136 		//
  4138 		// 6. Add notification for media change
  4137 		// 6. Add notification for media change
  4139 		//    Insert media card manually
  4138 		//    Insert media card manually
  4140 		//
  4139 		//
  4141 		r = TestMultipleNotificationsL(driveDes,1,1,t_notification::EMediaCardInsertion,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4140 		r = TestMultipleNotificationsL(driveDes,1,1,t_notification::EMediaCardInsertion,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4142 		test_KErrNone(r);
  4141 		test(r==KErrNone);
  4143 		test.Printf(_L("------- End of Media Card Removal/Insertion Tests --------------------\n"));
  4142 		test.Printf(_L("------- End of Media Card Removal/Insertion Tests --------------------\n"));
  4144 		//
  4143 		//
  4145 		// We should receive an EMediaChange notification even though we did not register for it
  4144 		// We should receive an EMediaChange notification even though we did not register for it
  4146 		// 7. Do not add notification for media change
  4145 		// 7. Do not add notification for media change
  4147 		//    Remove and insert media card manually
  4146 		//    Remove and insert media card manually
  4160 #endif
  4159 #endif
  4161         {
  4160         {
  4162         PrintLine();
  4161         PrintLine();
  4163         test.Next(_L("RRawDisk::Write Tests"));
  4162         test.Next(_L("RRawDisk::Write Tests"));
  4164         r = TestMultipleNotificationsL(driveDes,1,1,t_notification::ERawDiskWrite,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4163         r = TestMultipleNotificationsL(driveDes,1,1,t_notification::ERawDiskWrite,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4165         test_KErrNone(r);
  4164         test(r==KErrNone);
  4166         test.Printf(_L("------- End of RRawDisk::Write Test ------------------------------  \n"));
  4165         test.Printf(_L("------- End of RRawDisk::Write Test ------------------------------  \n"));
  4167         }	
  4166         }	
  4168 	
  4167 	
  4169 	
  4168 	
  4170 	//===============================================================================
  4169 	//===============================================================================
  4185     //      Change the drive name
  4184     //      Change the drive name
  4186 	//
  4185 	//
  4187 	PrintLine();
  4186 	PrintLine();
  4188 	test.Next(_L("DriveName Test"));
  4187 	test.Next(_L("DriveName Test"));
  4189 	r = TestMultipleNotificationsL(driveDes,1,2,t_notification::ESetDriveName,TFsNotification::EDriveName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4188 	r = TestMultipleNotificationsL(driveDes,1,2,t_notification::ESetDriveName,TFsNotification::EDriveName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4190 	test_KErrNone(r);
  4189 	test(r==KErrNone);
  4191 	//
  4190 	//
  4192 	// 2.  Add notification for a specific drive name change
  4191 	// 2.  Add notification for a specific drive name change
  4193 	//     Repeatedly rename the drive
  4192 	//     Repeatedly rename the drive
  4194 	//
  4193 	//
  4195 	r = TestMultipleNotificationsL(driveDes,3,6,t_notification::ESetDriveName,TFsNotification::EDriveName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4194 	r = TestMultipleNotificationsL(driveDes,3,6,t_notification::ESetDriveName,TFsNotification::EDriveName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4196 	test_KErrNone(r);
  4195 	test(r==KErrNone);
  4197 	test.Printf(_L("------- End of DriveName Test ----------------------------------------\n"));
  4196 	test.Printf(_L("------- End of DriveName Test ----------------------------------------\n"));
  4198 	
  4197 	
  4199 	
  4198 	
  4200 	//================================================================================
  4199 	//================================================================================
  4201 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2451
  4200 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2451
  4217 	//
  4216 	//
  4218 	// 1.  Add notification for a specific volume name change
  4217 	// 1.  Add notification for a specific volume name change
  4219 	//     Change the volume name
  4218 	//     Change the volume name
  4220 	//
  4219 	//
  4221 	r = TestMultipleNotificationsL(driveDes,1,2,t_notification::ESetVolumeLabel,TFsNotification::EVolumeName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4220 	r = TestMultipleNotificationsL(driveDes,1,2,t_notification::ESetVolumeLabel,TFsNotification::EVolumeName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4222 	test_KErrNone(r);
  4221 	test(r==KErrNone);
  4223 	//
  4222 	//
  4224 	// 2.  Add notification for a specific volume name change
  4223 	// 2.  Add notification for a specific volume name change
  4225 	//     Repeatedly rename the volume
  4224 	//     Repeatedly rename the volume
  4226 	//
  4225 	//
  4227 	r = TestMultipleNotificationsL(driveDes,3,6,t_notification::ESetVolumeLabel,TFsNotification::EVolumeName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4226 	r = TestMultipleNotificationsL(driveDes,3,6,t_notification::ESetVolumeLabel,TFsNotification::EVolumeName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4228 	test_KErrNone(r);
  4227 	test(r==KErrNone);
  4229 	test.Printf(_L("------- End of VolumeName Test ---------------------------------------\n"));
  4228 	test.Printf(_L("------- End of VolumeName Test ---------------------------------------\n"));
  4230 #endif
  4229 #endif
  4231 		
  4230 		
  4232 	
  4231 	
  4233     //=============================================================================
  4232     //=============================================================================
  4249 	// EAllOps1: A file is created and deleted aIterations times
  4248 	// EAllOps1: A file is created and deleted aIterations times
  4250 	// 		aMaxNotification = 2*aIterations
  4249 	// 		aMaxNotification = 2*aIterations
  4251 	//
  4250 	//
  4252 	_LIT(KFilename10,"file.allops");
  4251 	_LIT(KFilename10,"file.allops");
  4253 	r = TestMultipleNotificationsL(_L(""),KFilename10,4,8,t_notification::EAllOps1,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4252 	r = TestMultipleNotificationsL(_L(""),KFilename10,4,8,t_notification::EAllOps1,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4254 	test_KErrNone(r);
  4253 	test(r==KErrNone);
  4255 	//
  4254 	//
  4256 	// 2.	Add notification for all operations
  4255 	// 2.	Add notification for all operations
  4257 	//		Create a file
  4256 	//		Create a file
  4258 	//		Write to the file
  4257 	//		Write to the file
  4259 	//		Delete the file
  4258 	//		Delete the file
  4260 	//
  4259 	//
  4261 	// EAllOps2: A file is created, written to aIterations times and then deleted
  4260 	// EAllOps2: A file is created, written to aIterations times and then deleted
  4262 	// 		aMaxNotification = 2 + aIterations (See File Write Tests)
  4261 	// 		aMaxNotification = 2 + aIterations (See File Write Tests)
  4263 	//
  4262 	//
  4264 	r = TestMultipleNotificationsL(_L(""),KFilename10,4,6,t_notification::EAllOps2,(TUint)TFsNotification::EAllOps,2*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4263 	r = TestMultipleNotificationsL(_L(""),KFilename10,4,6,t_notification::EAllOps2,(TUint)TFsNotification::EAllOps,2*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4265 	test_KErrNone(r);
  4264 	test(r==KErrNone);
  4266 	//
  4265 	//
  4267 	// 3.	Add notification for all operations
  4266 	// 3.	Add notification for all operations
  4268 	//		Create a file
  4267 	//		Create a file
  4269 	//		Change the file size
  4268 	//		Change the file size
  4270 	//		Delete the file
  4269 	//		Delete the file
  4272 	// EAllOps3: A file is created, its size is increased size aIterations times, decreased (aIterations - 1) times
  4271 	// EAllOps3: A file is created, its size is increased size aIterations times, decreased (aIterations - 1) times
  4273 	// 			 and then deleted
  4272 	// 			 and then deleted
  4274 	//     aMaxNotifications = 1 + 2*aIterations
  4273 	//     aMaxNotifications = 1 + 2*aIterations
  4275 	//
  4274 	//
  4276 	r = TestMultipleNotificationsL(_L(""),KFilename10,4,9,t_notification::EAllOps3,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize*2,(TBool)EFalse,__LINE__);
  4275 	r = TestMultipleNotificationsL(_L(""),KFilename10,4,9,t_notification::EAllOps3,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize*2,(TBool)EFalse,__LINE__);
  4277 	test_KErrNone(r);
  4276 	test(r==KErrNone);
  4278 	//
  4277 	//
  4279 	// 4.	Add notification for all operations
  4278 	// 4.	Add notification for all operations
  4280 	//		Create a file
  4279 	//		Create a file
  4281 	//		Change the file attribute
  4280 	//		Change the file attribute
  4282 	//		Delete the file
  4281 	//		Delete the file
  4283 	//
  4282 	//
  4284 	// EAllOps4: A file is created, its attribute is changed and the file is deleted
  4283 	// EAllOps4: A file is created, its attribute is changed and the file is deleted
  4285 	// 		aMaxNotification = 3
  4284 	// 		aMaxNotification = 3
  4286 	//
  4285 	//
  4287 	r = TestMultipleNotificationsL(_L(""),KFilename10,1,3,t_notification::EAllOps4,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4286 	r = TestMultipleNotificationsL(_L(""),KFilename10,1,3,t_notification::EAllOps4,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4288 	test_KErrNone(r);
  4287 	test(r==KErrNone);
  4289 	//
  4288 	//
  4290 	// 5.	Add notification for all operations
  4289 	// 5.	Add notification for all operations
  4291 	//		Create a file
  4290 	//		Create a file
  4292 	//		Rename the file
  4291 	//		Rename the file
  4293 	//
  4292 	//
  4294 	// EAllOps5: A file is created and renamed
  4293 	// EAllOps5: A file is created and renamed
  4295 	// 		aMaxNotification = 2
  4294 	// 		aMaxNotification = 2
  4296 	//
  4295 	//
  4297 	r = TestMultipleNotificationsL(_L(""),KFilename10,1,2,t_notification::EAllOps5,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4296 	r = TestMultipleNotificationsL(_L(""),KFilename10,1,2,t_notification::EAllOps5,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4298 	test_KErrNone(r);
  4297 	test(r==KErrNone);
  4299 	//
  4298 	//
  4300 	// 6.	Add notification for all operations
  4299 	// 6.	Add notification for all operations
  4301 	//		Change drive name
  4300 	//		Change drive name
  4302 	//		Change volume name
  4301 	//		Change volume name
  4303 	//
  4302 	//
  4305 	// EAllOps6: The drive and volume names are changed
  4304 	// EAllOps6: The drive and volume names are changed
  4306 	//		aMaxNotification = 2
  4305 	//		aMaxNotification = 2
  4307 	//
  4306 	//
  4308 #ifndef __WINS__
  4307 #ifndef __WINS__
  4309 	r = TestMultipleNotificationsL(driveDes,1,2,t_notification::EAllOps6,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4308 	r = TestMultipleNotificationsL(driveDes,1,2,t_notification::EAllOps6,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4310 	test_KErrNone(r);
  4309 	test(r==KErrNone);
  4311 #endif
  4310 #endif
  4312 	test.Printf(_L("------- End of AllOps Tests ------------------------------------------\n"));
  4311 	test.Printf(_L("------- End of AllOps Tests ------------------------------------------\n"));
  4313 	
  4312 	
  4314 	
  4313 	
  4315     //=============================================================================
  4314     //=============================================================================
  4330 	// A file is created and deleted aIterations times
  4329 	// A file is created and deleted aIterations times
  4331 	// 		aMaxNotification = 2*aIterations
  4330 	// 		aMaxNotification = 2*aIterations
  4332 	//
  4331 	//
  4333 	_LIT(KFilename11,"file.mulfil");
  4332 	_LIT(KFilename11,"file.mulfil");
  4334 	r = TestMultipleNotificationsL(_L(""),KFilename11,3,6,t_notification::EAllOps1,TFsNotification::ECreate | TFsNotification::EDelete,2*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4333 	r = TestMultipleNotificationsL(_L(""),KFilename11,3,6,t_notification::EAllOps1,TFsNotification::ECreate | TFsNotification::EDelete,2*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4335 	test_KErrNone(r);
  4334 	test(r==KErrNone);
  4336 	//
  4335 	//
  4337 	// TFsNotification::EDelete | TFsNotification::ECreate | TFsNotification::EFileChange
  4336 	// TFsNotification::EDelete | TFsNotification::ECreate | TFsNotification::EFileChange
  4338 	// 2.	Add notification for create, file change and delete for a specific file
  4337 	// 2.	Add notification for create, file change and delete for a specific file
  4339 	//		Create a file
  4338 	//		Create a file
  4340 	//		Change the file size
  4339 	//		Change the file size
  4343 	// A file is created, its size is increased size aIterations times, decreased (aIterations - 1) times
  4342 	// A file is created, its size is increased size aIterations times, decreased (aIterations - 1) times
  4344 	// and then deleted
  4343 	// and then deleted
  4345 	//     aMaxNotifications = 1 + 2*aIterations
  4344 	//     aMaxNotifications = 1 + 2*aIterations
  4346 	//
  4345 	//
  4347 	r = TestMultipleNotificationsL(_L(""),KFilename11,4,9,t_notification::EAllOps3,TFsNotification::EDelete | TFsNotification::ECreate | TFsNotification::EFileChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4346 	r = TestMultipleNotificationsL(_L(""),KFilename11,4,9,t_notification::EAllOps3,TFsNotification::EDelete | TFsNotification::ECreate | TFsNotification::EFileChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4348 	test_KErrNone(r);
  4347 	test(r==KErrNone);
  4349 	//
  4348 	//
  4350 	// TFsNotification::EAttribute | TFsNotification::EDelete | TFsNotification::ECreate
  4349 	// TFsNotification::EAttribute | TFsNotification::EDelete | TFsNotification::ECreate
  4351 	// 3.	Add notification for create, attribute change and delete for a specific file
  4350 	// 3.	Add notification for create, attribute change and delete for a specific file
  4352 	//		Create a file
  4351 	//		Create a file
  4353 	//		Change the file attribute
  4352 	//		Change the file attribute
  4355 	//
  4354 	//
  4356 	// A file is created, its attribute is changed and the file is deleted
  4355 	// A file is created, its attribute is changed and the file is deleted
  4357 	// 		aMaxNotification = 3
  4356 	// 		aMaxNotification = 3
  4358 	//
  4357 	//
  4359 	r = TestMultipleNotificationsL(_L(""),KFilename11,1,3,t_notification::EAllOps4,TFsNotification::EAttribute | TFsNotification::EDelete | TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4358 	r = TestMultipleNotificationsL(_L(""),KFilename11,1,3,t_notification::EAllOps4,TFsNotification::EAttribute | TFsNotification::EDelete | TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4360 	test_KErrNone(r);
  4359 	test(r==KErrNone);
  4361 	//
  4360 	//
  4362 	// TFsNotification::ERename | TFsNotification::ECreate
  4361 	// TFsNotification::ERename | TFsNotification::ECreate
  4363 	// 4.	Add notification for create and rename for a specific file
  4362 	// 4.	Add notification for create and rename for a specific file
  4364 	//		Create a file
  4363 	//		Create a file
  4365 	//		Rename the file
  4364 	//		Rename the file
  4366 	//
  4365 	//
  4367 	// A file is created and renamed
  4366 	// A file is created and renamed
  4368 	// 		aMaxNotification = 2
  4367 	// 		aMaxNotification = 2
  4369 	//
  4368 	//
  4370 	r = TestMultipleNotificationsL(_L(""),KFilename11,1,2,t_notification::EAllOps5,TFsNotification::ERename | TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4369 	r = TestMultipleNotificationsL(_L(""),KFilename11,1,2,t_notification::EAllOps5,TFsNotification::ERename | TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4371 	test_KErrNone(r);
  4370 	test(r==KErrNone);
  4372 	//
  4371 	//
  4373 	// TFsNotification::EVolumeName | TFsNotification::EDriveName
  4372 	// TFsNotification::EVolumeName | TFsNotification::EDriveName
  4374 	// 5.	Add notification for drive and volume name change for a specific drive
  4373 	// 5.	Add notification for drive and volume name change for a specific drive
  4375 	//		Change drive name
  4374 	//		Change drive name
  4376 	//		Change volume name
  4375 	//		Change volume name
  4379 	// The drive and volume names are changed
  4378 	// The drive and volume names are changed
  4380 	//		aMaxNotification = 2
  4379 	//		aMaxNotification = 2
  4381 	//
  4380 	//
  4382 #ifndef __WINS__
  4381 #ifndef __WINS__
  4383 	r = TestMultipleNotificationsL(driveDes,1,2,t_notification::EAllOps6,TFsNotification::EVolumeName | TFsNotification::EDriveName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4382 	r = TestMultipleNotificationsL(driveDes,1,2,t_notification::EAllOps6,TFsNotification::EVolumeName | TFsNotification::EDriveName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4384 	test_KErrNone(r);
  4383 	test(r==KErrNone);
  4385 #endif
  4384 #endif
  4386 	test.Printf(_L("------- End of Multiple-Filter Tests ---------------------------------\n"));
  4385 	test.Printf(_L("------- End of Multiple-Filter Tests ---------------------------------\n"));
  4387 	
  4386 	
  4388 	
  4387 	
  4389 	//==============================================================================
  4388 	//==============================================================================
  4399 	// 2.	Make continuous file size changes to the file
  4398 	// 2.	Make continuous file size changes to the file
  4400 	// 3.	When overflow notification occurs, delete the notification
  4399 	// 3.	When overflow notification occurs, delete the notification
  4401 	//
  4400 	//
  4402 	PrintLine();
  4401 	PrintLine();
  4403 	r = TestOverflowL();
  4402 	r = TestOverflowL();
  4404 	test_KErrNone(r);
  4403 	test(r==KErrNone);
  4405 	
  4404 	
  4406 	//For DEF140387
  4405 	//For DEF140387
  4407 	PrintLine();
  4406 	PrintLine();
  4408 	r= TestPostOverflowNotifications();
  4407 	r= TestPostOverflowNotifications();
  4409 	test_KErrNone(r);
  4408 	test(r==KErrNone);
  4410 	test.Printf(_L("------- End of Overflow Test -----------------------------------------\n"));
  4409 	test.Printf(_L("------- End of Overflow Test -----------------------------------------\n"));
  4411 	
  4410 	
  4412 	
  4411 	
  4413 	//============================================================================
  4412 	//============================================================================
  4414 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2455
  4413 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2455
  4453     //! @SYMTestCaseDesc        Plugin Tests
  4452     //! @SYMTestCaseDesc        Plugin Tests
  4454     //! @SYMTestStatus          
  4453     //! @SYMTestStatus          
  4455 	//=============================================================================
  4454 	//=============================================================================
  4456 	PrintLine();
  4455 	PrintLine();
  4457 	r = TestNotificationsWithFServPlugins();
  4456 	r = TestNotificationsWithFServPlugins();
  4458 	test_KErrNone(r);
  4457 	test(r==KErrNone);
  4459 	test.Printf(_L("------- End of Plugin Tests ------------------------------------------\n"));
  4458 	test.Printf(_L("------- End of Plugin Tests ------------------------------------------\n"));
  4460 		
  4459 		
  4461 	
  4460 	
  4462 	//======================================================================
  4461 	//======================================================================
  4463 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2459
  4462 	//! @SYMTestCaseID			PBASE-T_NOTIFY-2459
  4480 #endif
  4479 #endif
  4481 		{
  4480 		{
  4482 		PrintLine();
  4481 		PrintLine();
  4483 		test.Next(_L("Format Tests"));
  4482 		test.Next(_L("Format Tests"));
  4484 		r = TestMultipleNotificationsL(driveDes,1,1,t_notification::EFormat,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4483 		r = TestMultipleNotificationsL(driveDes,1,1,t_notification::EFormat,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
  4485 		test_KErrNone(r);
  4484 		test(r==KErrNone);
  4486 		test.Printf(_L("------- End of Format Tests ------------------------------------------\n"));
  4485 		test.Printf(_L("------- End of Format Tests ------------------------------------------\n"));
  4487 		}
  4486 		}
  4488 	
  4487 	
  4489 	
  4488 	
  4490 	//======================================================================
  4489 	//======================================================================
  4502 	//	3.	A process with the specified uid
  4501 	//	3.	A process with the specified uid
  4503 	//
  4502 	//
  4504 	PrintLine();
  4503 	PrintLine();
  4505 	test.Next(_L("Test T_NOTIFIER_NOCAPS.EXE"));
  4504 	test.Next(_L("Test T_NOTIFIER_NOCAPS.EXE"));
  4506 	r = TestProcessCapabilities(_L("T_NOTIFIER_NOCAPS.EXE"));
  4505 	r = TestProcessCapabilities(_L("T_NOTIFIER_NOCAPS.EXE"));
  4507 	test_Value(r, r == KErrPermissionDenied); //Failure on emulator -> Did you forget to do a wintest?
  4506 	test(r == KErrPermissionDenied); //Failure on emulator -> Did you forget to do a wintest?
  4508 	
  4507 	
  4509 	test.Next(_L("Test T_NOTIFIER_ALLFILES.EXE"));
  4508 	test.Next(_L("Test T_NOTIFIER_ALLFILES.EXE"));
  4510 	r = TestProcessCapabilities(_L("T_NOTIFIER_ALLFILES.EXE"));
  4509 	r = TestProcessCapabilities(_L("T_NOTIFIER_ALLFILES.EXE"));
  4511 	test_KErrNone(r);
  4510 	test(r == KErrNone);
  4512 	
  4511 	
  4513 	test.Next(_L("Test T_NOTIFIER_BELONGS.EXE"));
  4512 	test.Next(_L("Test T_NOTIFIER_BELONGS.EXE"));
  4514 	r = TestProcessCapabilities(_L("T_NOTIFIER_BELONGS.EXE"));
  4513 	r = TestProcessCapabilities(_L("T_NOTIFIER_BELONGS.EXE"));
  4515 	test_KErrNone(r);
  4514 	test(r == KErrNone);
  4516 	test.Printf(_L("------- End of Data-Caging Tests -------------------------------------\n"));
  4515 	test.Printf(_L("------- End of Data-Caging Tests -------------------------------------\n"));
  4517 	
  4516 	
  4518 	
  4517 	
  4519 	test.End();
  4518 	test.End();
  4520 	test.Close();
  4519 	test.Close();