kerneltest/f32test/server/t_notify.cpp
changeset 200 73ea206103e6
parent 109 b3a1d9898418
equal deleted inserted replaced
152:657f875b013e 200:73ea206103e6
    19 #include <f32file.h>
    19 #include <f32file.h>
    20 #include <e32test.h>
    20 #include <e32test.h>
    21 #include <e32svr.h>
    21 #include <e32svr.h>
    22 #include <hal.h>
    22 #include <hal.h>
    23 #include "t_server.h"
    23 #include "t_server.h"
       
    24 #include "f32_test_utils.h"
       
    25 
       
    26 using namespace F32_Test_Utils;
    24 
    27 
    25 const TInt KHeapSize=0x200;
    28 const TInt KHeapSize=0x200;
    26 
    29 
    27 // wait for a bit since NotifyChange handled asynchronously and SetDriveName synchronously
    30 // wait for a bit since NotifyChange handled asynchronously and SetDriveName synchronously
    28 const TInt KNotifyChangeAfter=100000;
    31 const TInt KNotifyChangeAfter=100000;
   137 
   140 
   138 	case ETest4:
   141 	case ETest4:
   139 		{
   142 		{
   140 		TRequestStatus s;
   143 		TRequestStatus s;
   141 		fs.NotifyChange(ENotifyAll,s);
   144 		fs.NotifyChange(ENotifyAll,s);
   142 		test(s==KRequestPending);
   145 		test_Value(s.Int(), s==KRequestPending);
   143 		gSleepThread.Signal();
   146 		gSleepThread.Signal();
   144 		User::After(100000000);
   147 		User::After(100000000);
   145 		}
   148 		}
   146 		break;
   149 		break;
   147 
   150 
   214 	case ETest9:
   217 	case ETest9:
   215 		{
   218 		{
   216 		TRequestStatus s;
   219 		TRequestStatus s;
   217 		TFileName path=_L("\\F32-TST\\NOTIFY\\");
   220 		TFileName path=_L("\\F32-TST\\NOTIFY\\");
   218 		fs.NotifyChange(ENotifyAll,s,path);
   221 		fs.NotifyChange(ENotifyAll,s,path);
   219 		test(s==KRequestPending);
   222 		test_Value(s.Int(), s==KRequestPending);
   220 		gSleepThread.Signal();
   223 		gSleepThread.Signal();
   221 		User::After(100000000);
   224 		User::After(100000000);
   222 		}
   225 		}
   223 		break;
   226 		break;
   224 	case ETest10:
   227 	case ETest10:
   291 	r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
   294 	r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
   292 	test_KErrNone(r);
   295 	test_KErrNone(r);
   293 	thread.Logon(thrdStat);
   296 	thread.Logon(thrdStat);
   294 	thread.Resume();
   297 	thread.Resume();
   295 	User::WaitForRequest(thrdStat);
   298 	User::WaitForRequest(thrdStat);
   296 	test(thrdStat==KErrNone);
   299 	test_KErrNone(thrdStat.Int());
   297 	thread.Close();
   300 	thread.Close();
   298 	User::WaitForRequest(reqStat);
   301 	User::WaitForRequest(reqStat);
   299 	test(reqStat==KErrNone);
   302 	test_KErrNone(reqStat.Int());
   300 
   303 
   301 	RFile file;
   304 	RFile file;
   302 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite|EFileShareExclusive);
   305 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite|EFileShareExclusive);
   303 	test_KErrNone(r);
   306 	test_KErrNone(r);
   304 	file.Write(_L8("Somewhere over the rainbow..."),reqStat);
   307 	file.Write(_L8("Somewhere over the rainbow..."),reqStat);
   305 	User::WaitForRequest(reqStat);
   308 	User::WaitForRequest(reqStat);
   306 	test(reqStat==KErrNone);
   309 	test_KErrNone(reqStat.Int());
   307 	TBuf8<256> buf;
   310 	TBuf8<256> buf;
   308 	file.Read(0, buf,reqStat);
   311 	file.Read(0, buf,reqStat);
   309 	User::WaitForRequest(reqStat);
   312 	User::WaitForRequest(reqStat);
   310 	test(reqStat==KErrNone);
   313 	test_KErrNone(reqStat.Int());
   311 	file.Close();
   314 	file.Close();
   312 
   315 
   313 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareExclusive);
   316 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareExclusive);
   314 	test_Value(r, r == KErrArgument);
   317 	test_Value(r, r == KErrArgument);
   315 
   318 
   317 	test_Value(r, r == KErrArgument);
   320 	test_Value(r, r == KErrArgument);
   318 
   321 
   319 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
   322 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
   320 	test_KErrNone(r);
   323 	test_KErrNone(r);
   321 	file.Read(0, buf, 100, reqStat);
   324 	file.Read(0, buf, 100, reqStat);
   322 	test(reqStat==KRequestPending);
   325 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   323 	file.Close();
   326 	file.Close();
   324 	User::WaitForRequest(reqStat);
   327 	User::WaitForRequest(reqStat);
   325 	test(reqStat==KErrCancel);
   328 	test_Value(reqStat.Int(), reqStat==KErrCancel);
   326 
   329 
   327 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
   330 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
   328 	test_KErrNone(r);
   331 	test_KErrNone(r);
   329 	file.Read(0, buf, 100, reqStat);
   332 	file.Read(0, buf, 100, reqStat);
   330 	test(reqStat==KRequestPending);
   333 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   331 	file.ReadCancel(reqStat);
   334 	file.ReadCancel(reqStat);
   332 	User::WaitForRequest(reqStat);
   335 	User::WaitForRequest(reqStat);
   333 	test(reqStat==KErrCancel);
   336 	test_Value(reqStat.Int(), reqStat==KErrCancel);
   334 	file.Close();
   337 	file.Close();
   335 
   338 
   336 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
   339 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
   337 	test_KErrNone(r);
   340 	test_KErrNone(r);
   338 	file.Read(0, buf, 100, reqStat);
   341 	file.Read(0, buf, 100, reqStat);
   339 	test(reqStat==KRequestPending);
   342 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   340 	file.SetSize(100);
   343 	file.SetSize(100);
   341 	User::WaitForRequest(reqStat);
   344 	User::WaitForRequest(reqStat);
   342 	test(reqStat==KErrNone);
   345 	test_KErrNone(reqStat.Int());
   343 	test(buf.Length() == 100);
   346 	test_Equal(100, buf.Length());
   344 	file.Close();
   347 	file.Close();
   345 
   348 
   346 	test.Next(_L("Repeat Test notification of an entry change"));
   349 	test.Next(_L("Repeat Test notification of an entry change"));
   347 	TheFs.NotifyChange(ENotifyEntry,reqStat);
   350 	TheFs.NotifyChange(ENotifyEntry,reqStat);
   348 	thread.Create(_L("MyThread2"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
   351 	thread.Create(_L("MyThread2"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
   349 	thread.Logon(thrdStat);
   352 	thread.Logon(thrdStat);
   350 	thread.Resume();
   353 	thread.Resume();
   351 	User::WaitForRequest(thrdStat);
   354 	User::WaitForRequest(thrdStat);
   352 	test(thrdStat==KErrNone);
   355 	test_KErrNone(thrdStat.Int());
   353 	thread.Close();
   356 	thread.Close();
   354 	User::WaitForRequest(reqStat);
   357 	User::WaitForRequest(reqStat);
   355 	if (reqStat!=KErrNone)
   358 	test_KErrNone(reqStat.Int());
   356 		{
       
   357 		test.Printf(_L("ReqStat=%d\n"),reqStat.Int());
       
   358 		//test.Getch();
       
   359 		}
       
   360 	test(reqStat==KErrNone);
       
   361 
   359 
   362 	test.Next(_L("Test Notify cancel"));
   360 	test.Next(_L("Test Notify cancel"));
   363 	TheFs.NotifyChange(ENotifyEntry,reqStat);
   361 	TheFs.NotifyChange(ENotifyEntry,reqStat);
   364 	TheFs.NotifyChangeCancel();
   362 	TheFs.NotifyChangeCancel();
   365 	User::WaitForRequest(reqStat);
   363 	User::WaitForRequest(reqStat);
   368 	TheFs.NotifyChange(ENotifyEntry,reqStat);
   366 	TheFs.NotifyChange(ENotifyEntry,reqStat);
   369 	thread.Create(_L("MyThread3"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
   367 	thread.Create(_L("MyThread3"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
   370 	thread.Logon(thrdStat);
   368 	thread.Logon(thrdStat);
   371 	thread.Resume();
   369 	thread.Resume();
   372 	User::WaitForRequest(thrdStat);
   370 	User::WaitForRequest(thrdStat);
   373 	test(thrdStat==KErrNone);
   371 	test_KErrNone(thrdStat.Int());
   374 	thread.Close();
   372 	thread.Close();
   375 	User::WaitForRequest(reqStat);
   373 	User::WaitForRequest(reqStat);
   376 	test(reqStat==KErrNone);
   374 	test_KErrNone(reqStat.Int());
   377 	}
   375 	}
   378 
   376 
   379 static void Test2()
   377 static void Test2()
   380 //
   378 //
   381 // Test notify for multiple clients
   379 // Test notify for multiple clients
   394 	RFs fs2;
   392 	RFs fs2;
   395 	r=fs2.Connect();
   393 	r=fs2.Connect();
   396 	test_KErrNone(r);
   394 	test_KErrNone(r);
   397 	fs2.NotifyChange(ENotifyEntry,reqStat2);
   395 	fs2.NotifyChange(ENotifyEntry,reqStat2);
   398 
   396 
   399 	test(reqStat1==KRequestPending);
   397 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
   400 	test(reqStat2==KRequestPending);
   398 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
   401 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NEWFILE.TXT"));
   399 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NEWFILE.TXT"));
   402 	test_KErrNone(r);
   400 	test_KErrNone(r);
   403 	User::WaitForRequest(reqStat1);
   401 	User::WaitForRequest(reqStat1);
   404 	User::WaitForRequest(reqStat2);
   402 	User::WaitForRequest(reqStat2);
   405 	test(reqStat1==KErrNone);
   403 	test_KErrNone(reqStat1.Int());
   406 	test(reqStat2==KErrNone);
   404 	test_KErrNone(reqStat2.Int());
   407 	}
   405 	}
   408 
   406 
   409 static void Test3()
   407 static void Test3()
   410 //
   408 //
   411 // Test notify cancel
   409 // Test notify cancel
   426 	fs1.NotifyChange(ENotifyAll,status1);
   424 	fs1.NotifyChange(ENotifyAll,status1);
   427 	fs1.NotifyChange(ENotifyAll,status2);
   425 	fs1.NotifyChange(ENotifyAll,status2);
   428 	fs1.NotifyChange(ENotifyAll,status3);
   426 	fs1.NotifyChange(ENotifyAll,status3);
   429 	fs1.NotifyChange(ENotifyAll,status4);
   427 	fs1.NotifyChange(ENotifyAll,status4);
   430 	fs1.NotifyChange(ENotifyAll,status5);
   428 	fs1.NotifyChange(ENotifyAll,status5);
   431 	test(status1==KRequestPending);
   429 	test_Value(status1.Int(), status1==KRequestPending);
   432 	test(status2==KRequestPending);
   430 	test_Value(status2.Int(), status2==KRequestPending);
   433 	test(status3==KRequestPending);
   431 	test_Value(status3.Int(), status3==KRequestPending);
   434 	test(status4==KRequestPending);
   432 	test_Value(status4.Int(), status4==KRequestPending);
   435 	test(status5==KRequestPending);
   433 	test_Value(status5.Int(), status5==KRequestPending);
   436 
   434 
   437 	test.Next(_L("RFs::NotifyCancel()"));
   435 	test.Next(_L("RFs::NotifyCancel()"));
   438 //	Test that one call to RFs::NotifyCancel() cancels all outstanding requests
   436 //	Test that one call to RFs::NotifyCancel() cancels all outstanding requests
   439 	fs1.NotifyChangeCancel();
   437 	fs1.NotifyChangeCancel();
   440 	User::WaitForRequest(status1);
   438 	User::WaitForRequest(status1);
   441 	test(status1==KErrCancel);
   439 	test_Value(status1.Int(), status1==KErrCancel);
   442 	User::WaitForRequest(status2);
   440 	User::WaitForRequest(status2);
   443 	test(status2==KErrCancel);
   441 	test_Value(status2.Int(), status2==KErrCancel);
   444 	User::WaitForRequest(status3);
   442 	User::WaitForRequest(status3);
   445 	test(status3==KErrCancel);
   443 	test_Value(status3.Int(), status3==KErrCancel);
   446 	User::WaitForRequest(status4);
   444 	User::WaitForRequest(status4);
   447 	test(status4==KErrCancel);
   445 	test_Value(status4.Int(), status4==KErrCancel);
   448 	User::WaitForRequest(status5);
   446 	User::WaitForRequest(status5);
   449 	test(status5==KErrCancel);
   447 	test_Value(status5.Int(), status5==KErrCancel);
   450 //	Call the cancel function again to check no further action
   448 //	Call the cancel function again to check no further action
   451 	fs1.NotifyChangeCancel();
   449 	fs1.NotifyChangeCancel();
   452 
   450 
   453 //	Test overloaded function to cancel a single request
   451 //	Test overloaded function to cancel a single request
   454 	test.Next(_L("Cancel notification request using function overload"));
   452 	test.Next(_L("Cancel notification request using function overload"));
   455 	fs1.NotifyChange(ENotifyAll,status1);
   453 	fs1.NotifyChange(ENotifyAll,status1);
   456 	fs1.NotifyChange(ENotifyAll,status2);
   454 	fs1.NotifyChange(ENotifyAll,status2);
   457 	fs1.NotifyChange(ENotifyAll,status3);
   455 	fs1.NotifyChange(ENotifyAll,status3);
   458 	fs1.NotifyChange(ENotifyAll,status4);
   456 	fs1.NotifyChange(ENotifyAll,status4);
   459 	fs1.NotifyChange(ENotifyAll,status5);
   457 	fs1.NotifyChange(ENotifyAll,status5);
   460 	test(status1==KRequestPending);
   458 	test_Value(status1.Int(), status1==KRequestPending);
   461 	test(status2==KRequestPending);
   459 	test_Value(status2.Int(), status2==KRequestPending);
   462 	test(status3==KRequestPending);
   460 	test_Value(status3.Int(), status3==KRequestPending);
   463 	test(status4==KRequestPending);
   461 	test_Value(status4.Int(), status4==KRequestPending);
   464 	test(status5==KRequestPending);
   462 	test_Value(status5.Int(), status5==KRequestPending);
   465 
   463 
   466 //	Cancel the outstanding request with status5
   464 //	Cancel the outstanding request with status5
   467 	test.Next(_L("RFs::NotifyCancel()"));
   465 	test.Next(_L("RFs::NotifyCancel()"));
   468 	fs1.NotifyChangeCancel(status5);
   466 	fs1.NotifyChangeCancel(status5);
   469 	User::WaitForRequest(status5);
   467 	User::WaitForRequest(status5);
   470 	test(status1==KRequestPending);
   468 	test_Value(status1.Int(), status1==KRequestPending);
   471 	test(status2==KRequestPending);
   469 	test_Value(status2.Int(), status2==KRequestPending);
   472 	test(status3==KRequestPending);
   470 	test_Value(status3.Int(), status3==KRequestPending);
   473 	test(status4==KRequestPending);
   471 	test_Value(status4.Int(), status4==KRequestPending);
   474 	test(status5==KErrCancel);
   472 	test_Value(status5.Int(), status5==KErrCancel);
   475 
   473 
   476 	fs1.NotifyChangeCancel(status2);
   474 	fs1.NotifyChangeCancel(status2);
   477 	User::WaitForRequest(status2);
   475 	User::WaitForRequest(status2);
   478 
   476 
   479 	test(status1==KRequestPending);
   477 	test_Value(status1.Int(), status1==KRequestPending);
   480 	test(status2==KErrCancel);
   478 	test_Value(status2.Int(), status2==KErrCancel);
   481 	test(status3==KRequestPending);
   479 	test_Value(status3.Int(), status3==KRequestPending);
   482 	test(status4==KRequestPending);
   480 	test_Value(status4.Int(), status4==KRequestPending);
   483 
   481 
   484 	fs1.NotifyChangeCancel(status4);
   482 	fs1.NotifyChangeCancel(status4);
   485 	User::WaitForRequest(status4);
   483 	User::WaitForRequest(status4);
   486 	test(status1==KRequestPending);
   484 	test_Value(status1.Int(), status1==KRequestPending);
   487 	test(status3==KRequestPending);
   485 	test_Value(status3.Int(), status3==KRequestPending);
   488 	test(status4==KErrCancel);
   486 	test_Value(status4.Int(), status4==KErrCancel);
   489 
   487 
   490 	fs1.NotifyChangeCancel(status4);	//	Test no side effects on trying to cancel a request
   488 	fs1.NotifyChangeCancel(status4);				//	Test no side effects on trying to cancel a request
   491 	test(status4==KErrCancel);			//	that has already been cancelled
   489 	test_Value(status4.Int(), status4==KErrCancel);	//	that has already been cancelled
   492 
   490 
   493 	fs1.NotifyChangeCancel(status1);
   491 	fs1.NotifyChangeCancel(status1);
   494 	User::WaitForRequest(status1);
   492 	User::WaitForRequest(status1);
   495 	test(status1==KErrCancel);
   493 	test_Value(status1.Int(), status1==KErrCancel);
   496 	test(status3==KRequestPending);
   494 	test_Value(status3.Int(), status3==KRequestPending);
   497 	fs1.NotifyChangeCancel(status1);	//	Test no side effects on trying to cancel a request
   495 	fs1.NotifyChangeCancel(status1);	//	Test no side effects on trying to cancel a request
   498 	test(status1==KErrCancel);			//	that has already been cancelled
   496 	test_Value(status1.Int(), status1==KErrCancel);			//	that has already been cancelled
   499 
   497 
   500 	fs1.NotifyChangeCancel(status3);
   498 	fs1.NotifyChangeCancel(status3);
   501 	User::WaitForRequest(status3);
   499 	User::WaitForRequest(status3);
   502 	test(status3==KErrCancel);
   500 	test_Value(status3.Int(), status3==KErrCancel);
   503 
   501 
   504 	fs1.Close();
   502 	fs1.Close();
   505 	}
   503 	}
   506 
   504 
   507 static void Test4()
   505 static void Test4()
   558 	test_KErrNone(r);
   556 	test_KErrNone(r);
   559 	file.Close();
   557 	file.Close();
   560 
   558 
   561 	TRequestStatus reqStat=0;
   559 	TRequestStatus reqStat=0;
   562 	TheFs.NotifyChange(ENotifyEntry,reqStat);
   560 	TheFs.NotifyChange(ENotifyEntry,reqStat);
   563 	test(reqStat==KRequestPending);
   561 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   564 
   562 
   565 	r=gSleepThread.CreateLocal(0);
   563 	r=gSleepThread.CreateLocal(0);
   566 	test_KErrNone(r);
   564 	test_KErrNone(r);
   567 	RThread clientThread;
   565 	RThread clientThread;
   568 	r=clientThread.Create(_L("Test5Thread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
   566 	r=clientThread.Create(_L("Test5Thread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
   569 	test_KErrNone(r);
   567 	test_KErrNone(r);
   570 	clientThread.Resume();
   568 	clientThread.Resume();
   571 	gSleepThread.Wait();
   569 	gSleepThread.Wait();
   572 	test(reqStat==KRequestPending);
   570 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   573 
   571 
   574 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
   572 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
   575 	test_KErrNone(r);
   573 	test_KErrNone(r);
   576 	User::WaitForRequest(reqStat);
   574 	User::WaitForRequest(reqStat);
   577 	test(reqStat==KErrNone);
   575 	test_KErrNone(reqStat.Int());
   578 
   576 
   579 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\koala.txt"));
   577 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\koala.txt"));
   580 	test_KErrNone(r);
   578 	test_KErrNone(r);
   581 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\dingo.txt"));
   579 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\dingo.txt"));
   582 	test_KErrNone(r);
   580 	test_KErrNone(r);
   603         b.Format(_L("Test Media change notification (socket:%d)"),gSocketNumber);
   601         b.Format(_L("Test Media change notification (socket:%d)"),gSocketNumber);
   604         test.Next(b);
   602         test.Next(b);
   605         TRequestStatus reqStat=0;
   603         TRequestStatus reqStat=0;
   606         TInt r;
   604         TInt r;
   607         TheFs.NotifyChange(ENotifyEntry,reqStat);
   605         TheFs.NotifyChange(ENotifyEntry,reqStat);
   608         test(reqStat==KRequestPending);
   606         test_Value(reqStat.Int(), reqStat==KRequestPending);
   609         r=gSleepThread.CreateLocal(0);
   607         r=gSleepThread.CreateLocal(0);
   610         test_KErrNone(r);
   608         test_KErrNone(r);
   611         RThread clientThread;
   609         RThread clientThread;
   612         r=clientThread.Create(_L("Test6Thread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);
   610         r=clientThread.Create(_L("Test6Thread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);
   613         test_KErrNone(r);
   611         test_KErrNone(r);
   614         clientThread.Resume();
   612         clientThread.Resume();
   615         gSleepThread.Wait();
   613         gSleepThread.Wait();
   616         TInt reqInt=reqStat.Int();
   614         TInt reqInt=reqStat.Int();
   617         test(reqInt==KErrNone);
   615         test_KErrNone(reqInt);
   618         User::WaitForRequest(reqStat);
   616         User::WaitForRequest(reqStat);
   619         WaitForMediaChange();
   617         WaitForMediaChange();
   620         gSleepThread.Close();
   618         gSleepThread.Close();
   621         clientThread.Close();
   619         clientThread.Close();
   622         }
   620         }
   639 	test.Next(_L("Test Write to uid region does not trigger notification"));
   637 	test.Next(_L("Test Write to uid region does not trigger notification"));
   640 	TRequestStatus reqStat=0;
   638 	TRequestStatus reqStat=0;
   641 	MakeFile(_L("NewFile.TXT"));
   639 	MakeFile(_L("NewFile.TXT"));
   642 	TInt r;
   640 	TInt r;
   643 	TheFs.NotifyChange(ENotifyEntry,reqStat);
   641 	TheFs.NotifyChange(ENotifyEntry,reqStat);
   644 	test(reqStat==KRequestPending);
   642 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   645 
   643 
   646 	r=gSleepThread.CreateLocal(0);
   644 	r=gSleepThread.CreateLocal(0);
   647 	test_KErrNone(r);
   645 	test_KErrNone(r);
   648 	RThread clientThread;
   646 	RThread clientThread;
   649 	r=clientThread.Create(_L("Test7Thread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest7);
   647 	r=clientThread.Create(_L("Test7Thread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest7);
   650 	test_KErrNone(r);
   648 	test_KErrNone(r);
   651 	clientThread.Resume();
   649 	clientThread.Resume();
   652 	gSleepThread.Wait();
   650 	gSleepThread.Wait();
   653 	test(reqStat==KRequestPending);
   651 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   654 
   652 
   655 	r=TheFs.Delete(_L("Newfile.txt"));
   653 	r=TheFs.Delete(_L("Newfile.txt"));
   656 	test_KErrNone(r);
   654 	test_KErrNone(r);
   657 
   655 
   658 	User::WaitForRequest(reqStat);
   656 	User::WaitForRequest(reqStat);
   677 		test.Next(_L("Test Media change extended notification"));
   675 		test.Next(_L("Test Media change extended notification"));
   678 		TRequestStatus reqStat=0;
   676 		TRequestStatus reqStat=0;
   679 		TFileName path = _L("\\F32-tst\\NOTIFY\\");
   677 		TFileName path = _L("\\F32-tst\\NOTIFY\\");
   680 		TInt r;
   678 		TInt r;
   681 		TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   679 		TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   682 		test(reqStat==KRequestPending);
   680 		test_Value(reqStat.Int(), reqStat==KRequestPending);
   683 		r=gSleepThread.CreateLocal(0);
   681 		r=gSleepThread.CreateLocal(0);
   684 		test_KErrNone(r);
   682 		test_KErrNone(r);
   685 		RThread clientThread;
   683 		RThread clientThread;
   686 		gSocketNumber=0;
   684 		gSocketNumber=0;
   687 		r=clientThread.Create(_L("Test6Thread1"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);	//only generates a media change on removable media
   685 		r=clientThread.Create(_L("Test6Thread1"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);	//only generates a media change on removable media
   688 		test_KErrNone(r);
   686 		test_KErrNone(r);
   689 		clientThread.Resume();
   687 		clientThread.Resume();
   690 		gSleepThread.Wait();
   688 		gSleepThread.Wait();
   691 		User::WaitForRequest(reqStat);
   689 		User::WaitForRequest(reqStat);
   692 		test(reqStat==KErrNone);
   690 		test_KErrNone(reqStat.Int());
   693 		WaitForMediaChange();
   691 		WaitForMediaChange();
   694 		gSleepThread.Close();
   692 		gSleepThread.Close();
   695 		clientThread.Close();
   693 		clientThread.Close();
   696 
   694 
   697         //-- it seems that after generating media change the meia driver isn't ready for some time
   695         //-- it seems that after generating media change the meia driver isn't ready for some time
   699 	    r=TheFs.Drive(driveInfo,CurrentDrive());
   697 	    r=TheFs.Drive(driveInfo,CurrentDrive());
   700 	    test_KErrNone(r);
   698 	    test_KErrNone(r);
   701 
   699 
   702 
   700 
   703 		TheFs.NotifyChange(ENotifyDisk,reqStat,path);
   701 		TheFs.NotifyChange(ENotifyDisk,reqStat,path);
   704 		test(reqStat==KRequestPending);
   702 		test_Value(reqStat.Int(), reqStat==KRequestPending);
   705 		r=gSleepThread.CreateLocal(0);
   703 		r=gSleepThread.CreateLocal(0);
   706 		test_KErrNone(r);
   704 		test_KErrNone(r);
   707 		r=clientThread.Create(_L("Test6Thread2"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);
   705 		r=clientThread.Create(_L("Test6Thread2"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);
   708 		test_KErrNone(r);
   706 		test_KErrNone(r);
   709 		clientThread.Resume();
   707 		clientThread.Resume();
   710 		gSleepThread.Wait();
   708 		gSleepThread.Wait();
   711 		User::WaitForRequest(reqStat);
   709 		User::WaitForRequest(reqStat);
   712 		test(reqStat==KErrNone);
   710 		test_KErrNone(reqStat.Int());
   713 		WaitForMediaChange();
   711 		WaitForMediaChange();
   714 		gSleepThread.Close();
   712 		gSleepThread.Close();
   715 		clientThread.Close();
   713 		clientThread.Close();
   716 
   714 
   717         //-- it seems that after generating media change the meia driver isn't ready for some time
   715         //-- it seems that after generating media change the meia driver isn't ready for some time
   718         User::After(2000000);
   716         User::After(2000000);
   719 	    r=TheFs.Drive(driveInfo,CurrentDrive());
   717 	    r=TheFs.Drive(driveInfo,CurrentDrive());
   720 	    test_KErrNone(r);
   718 	    test_KErrNone(r);
   721 
   719 
   722 		TheFs.NotifyChange(ENotifyWrite,reqStat,path);
   720 		TheFs.NotifyChange(ENotifyWrite,reqStat,path);
   723 		test(reqStat==KRequestPending);
   721 		test_Value(reqStat.Int(), reqStat==KRequestPending);
   724 		r=gSleepThread.CreateLocal(0);
   722 		r=gSleepThread.CreateLocal(0);
   725 		test_KErrNone(r);
   723 		test_KErrNone(r);
   726 		r=clientThread.Create(_L("Test6Thread3"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);
   724 		r=clientThread.Create(_L("Test6Thread3"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);
   727 		test_KErrNone(r);
   725 		test_KErrNone(r);
   728 		clientThread.Resume();
   726 		clientThread.Resume();
   729 		gSleepThread.Wait();
   727 		gSleepThread.Wait();
   730 		User::WaitForRequest(reqStat);
   728 		User::WaitForRequest(reqStat);
   731 		test(reqStat==KErrNone);
   729 		test_KErrNone(reqStat.Int());
   732 		WaitForMediaChange();
   730 		WaitForMediaChange();
   733 		gSleepThread.Close();
   731 		gSleepThread.Close();
   734 		clientThread.Close();
   732 		clientThread.Close();
   735 
   733 
   736         //-- it seems that after generating media change the meia driver isn't ready for some time
   734         //-- it seems that after generating media change the meia driver isn't ready for some time
   754 	test_Value(r, (r == KErrNotFound)||(r==KErrPathNotFound)||(r==KErrNone));
   752 	test_Value(r, (r == KErrNotFound)||(r==KErrPathNotFound)||(r==KErrNone));
   755 
   753 
   756 	TFileName path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
   754 	TFileName path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
   757 	TRequestStatus reqStat(KRequestPending);
   755 	TRequestStatus reqStat(KRequestPending);
   758 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   756 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   759 	test(reqStat==KRequestPending);
   757 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   760 
   758 
   761 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\"));
   759 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\"));
   762 	test_KErrNone(r);
   760 	test_KErrNone(r);
   763 
   761 
   764 	User::WaitForRequest(reqStat);
   762 	User::WaitForRequest(reqStat);
   765 	test(reqStat==KErrNone);
   763 	test_KErrNone(reqStat.Int());
   766 
   764 
   767 	path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man");
   765 	path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man");
   768 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   766 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   769 	test(reqStat==KRequestPending);
   767 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   770 
   768 
   771 	RFile file;
   769 	RFile file;
   772 	r=file.Replace(TheFs,path,EFileStream);
   770 	r=file.Replace(TheFs,path,EFileStream);
   773 	test_KErrNone(r);
   771 	test_KErrNone(r);
   774 	file.Close();
   772 	file.Close();
   775 
   773 
   776 	User::WaitForRequest(reqStat);
   774 	User::WaitForRequest(reqStat);
   777 	test(reqStat==KErrNone);
   775 	test_KErrNone(reqStat.Int());
   778 
   776 
   779 	r=TheFs.Delete(path);
   777 	r=TheFs.Delete(path);
   780 	test_KErrNone(r);
   778 	test_KErrNone(r);
   781 
   779 
   782 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   780 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   783 	test(reqStat==KRequestPending);
   781 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   784 //	Now cancel the outstanding request
   782 //	Now cancel the outstanding request
   785 	TheFs.NotifyChangeCancel(reqStat);
   783 	TheFs.NotifyChangeCancel(reqStat);
   786 	User::WaitForRequest(reqStat);
   784 	User::WaitForRequest(reqStat);
   787 	test(reqStat==KErrCancel);
   785 	test_Value(reqStat.Int(), reqStat==KErrCancel);
   788 
   786 
   789 //	Repeat with a ENotifyFile request
   787 //	Repeat with a ENotifyFile request
   790 	TheFs.NotifyChange(ENotifyFile,reqStat,path);
   788 	TheFs.NotifyChange(ENotifyFile,reqStat,path);
   791 	test(reqStat==KRequestPending);
   789 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   792 
   790 
   793 	r=file.Replace(TheFs,path,EFileStream);
   791 	r=file.Replace(TheFs,path,EFileStream);
   794 	test_KErrNone(r);
   792 	test_KErrNone(r);
   795 	file.Close();
   793 	file.Close();
   796 
   794 
   797 	User::WaitForRequest(reqStat);
   795 	User::WaitForRequest(reqStat);
   798 	test(reqStat==KErrNone);
   796 	test_KErrNone(reqStat.Int());
   799 
   797 
   800 	r=TheFs.Delete(path);
   798 	r=TheFs.Delete(path);
   801 	test_KErrNone(r);
   799 	test_KErrNone(r);
   802 
   800 
   803 	TheFs.NotifyChange(ENotifyFile,reqStat,path);
   801 	TheFs.NotifyChange(ENotifyFile,reqStat,path);
   804 	test(reqStat==KRequestPending);
   802 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   805 //	Now cancel the outstanding request
   803 //	Now cancel the outstanding request
   806 	TheFs.NotifyChangeCancel(reqStat);
   804 	TheFs.NotifyChangeCancel(reqStat);
   807 	User::WaitForRequest(reqStat);
   805 	User::WaitForRequest(reqStat);
   808 	test(reqStat==KErrCancel);
   806 	test_Value(reqStat.Int(), reqStat==KErrCancel);
   809 
   807 
   810 //	Repeat with an ENotifyAttributes request
   808 //	Repeat with an ENotifyAttributes request
   811 	TheFs.NotifyChange(ENotifyAttributes,reqStat,path);
   809 	TheFs.NotifyChange(ENotifyAttributes,reqStat,path);
   812 	test(reqStat==KRequestPending);
   810 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   813 
   811 
   814 	r=file.Replace(TheFs,path,EFileStream);
   812 	r=file.Replace(TheFs,path,EFileStream);
   815 	test_KErrNone(r);
   813 	test_KErrNone(r);
   816 	file.Close();
   814 	file.Close();
   817 
   815 
   818 	User::WaitForRequest(reqStat);
   816 	User::WaitForRequest(reqStat);
   819 	test(reqStat==KErrNone);	//	Monitoring attributes but informed anyway
   817 	test_KErrNone(reqStat.Int());	//	Monitoring attributes but informed anyway
   820 
   818 
   821 	r=TheFs.Delete(path);
   819 	r=TheFs.Delete(path);
   822 	test_KErrNone(r);
   820 	test_KErrNone(r);
   823 
   821 
   824 	TheFs.NotifyChange(ENotifyAttributes,reqStat,path);
   822 	TheFs.NotifyChange(ENotifyAttributes,reqStat,path);
   825 	test(reqStat==KRequestPending);
   823 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   826 //	Now cancel the outstanding request
   824 //	Now cancel the outstanding request
   827 	TheFs.NotifyChangeCancel(reqStat);
   825 	TheFs.NotifyChangeCancel(reqStat);
   828 	User::WaitForRequest(reqStat);
   826 	User::WaitForRequest(reqStat);
   829 	test(reqStat==KErrCancel);
   827 	test_Value(reqStat.Int(), reqStat==KErrCancel);
   830 
   828 
   831 //	Repeat with an ENotifyWrite request
   829 //	Repeat with an ENotifyWrite request
   832 	TheFs.NotifyChange(ENotifyWrite,reqStat,path);
   830 	TheFs.NotifyChange(ENotifyWrite,reqStat,path);
   833 	test(reqStat==KRequestPending);
   831 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   834 
   832 
   835 	r=file.Replace(TheFs,path,EFileStream);
   833 	r=file.Replace(TheFs,path,EFileStream);
   836 	test_KErrNone(r);
   834 	test_KErrNone(r);
   837 	file.Close();
   835 	file.Close();
   838 
   836 
   839 	User::WaitForRequest(reqStat);
   837 	User::WaitForRequest(reqStat);
   840 	test(reqStat==KErrNone);	//	Monitoring file writing but informed anyway
   838 	test_KErrNone(reqStat.Int());	//	Monitoring file writing but informed anyway
   841 
   839 
   842 	r=TheFs.Delete(path);
   840 	r=TheFs.Delete(path);
   843 	test_KErrNone(r);
   841 	test_KErrNone(r);
   844 
   842 
   845 	TheFs.NotifyChange(ENotifyWrite,reqStat,path);
   843 	TheFs.NotifyChange(ENotifyWrite,reqStat,path);
   846 	test(reqStat==KRequestPending);
   844 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   847 //	Now cancel the outstanding request
   845 //	Now cancel the outstanding request
   848 	TheFs.NotifyChangeCancel(reqStat);
   846 	TheFs.NotifyChangeCancel(reqStat);
   849 	User::WaitForRequest(reqStat);
   847 	User::WaitForRequest(reqStat);
   850 	test(reqStat==KErrCancel);
   848 	test_Value(reqStat.Int(), reqStat==KErrCancel);
   851 
   849 
   852 //	Repeat with an ENotifyDisk request
   850 //	Repeat with an ENotifyDisk request
   853 	TheFs.NotifyChange(ENotifyDisk,reqStat,path);
   851 	TheFs.NotifyChange(ENotifyDisk,reqStat,path);
   854 	test(reqStat==KRequestPending);
   852 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   855 
   853 
   856 	r=file.Replace(TheFs,path,EFileStream);
   854 	r=file.Replace(TheFs,path,EFileStream);
   857 	test_KErrNone(r);
   855 	test_KErrNone(r);
   858 	file.Close();
   856 	file.Close();
   859 
   857 
   860 	User::WaitForRequest(reqStat);
   858 	User::WaitForRequest(reqStat);
   861 	test(reqStat==KErrNone);	//	Monitoring disk activity but informed anyway
   859 	test_KErrNone(reqStat.Int());	//	Monitoring disk activity but informed anyway
   862 
   860 
   863 	r=TheFs.Delete(path);
   861 	r=TheFs.Delete(path);
   864 	test_KErrNone(r);
   862 	test_KErrNone(r);
   865 
   863 
   866 	TheFs.NotifyChange(ENotifyAttributes,reqStat,path);
   864 	TheFs.NotifyChange(ENotifyAttributes,reqStat,path);
   867 	test(reqStat==KRequestPending);
   865 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   868 //	Now cancel the outstanding request
   866 //	Now cancel the outstanding request
   869 	TheFs.NotifyChangeCancel(reqStat);
   867 	TheFs.NotifyChangeCancel(reqStat);
   870 	User::WaitForRequest(reqStat);
   868 	User::WaitForRequest(reqStat);
   871 	test(reqStat==KErrCancel);
   869 	test_Value(reqStat.Int(), reqStat==KErrCancel);
   872 
   870 
   873 //	Now do much the same with directory monitoring
   871 //	Now do much the same with directory monitoring
   874 	path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
   872 	path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
   875 	TheFs.RmDir(path);
   873 	TheFs.RmDir(path);
   876 
   874 
   877 	TheFs.NotifyChange(ENotifyDir,reqStat,path);
   875 	TheFs.NotifyChange(ENotifyDir,reqStat,path);
   878 	test(reqStat==KRequestPending);
   876 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   879 
   877 
   880 	TheFs.MkDir(path);
   878 	TheFs.MkDir(path);
   881 	test_KErrNone(r);
   879 	test_KErrNone(r);
   882 
   880 
   883 	User::WaitForRequest(reqStat);
   881 	User::WaitForRequest(reqStat);
   884 	test(reqStat==KErrNone);
   882 	test_KErrNone(reqStat.Int());
   885 
   883 
   886 	TheFs.RmDir(path);
   884 	TheFs.RmDir(path);
   887 	test_KErrNone(r);
   885 	test_KErrNone(r);
   888 
   886 
   889 	TheFs.NotifyChange(ENotifyDir,reqStat,path);
   887 	TheFs.NotifyChange(ENotifyDir,reqStat,path);
   890 	test_KErrNone(r);
   888 	test_KErrNone(r);
   891 	test(reqStat==KRequestPending);
   889 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   892 
   890 
   893 //	Now cancel the outstanding request
   891 //	Now cancel the outstanding request
   894 	TheFs.NotifyChangeCancel(reqStat);
   892 	TheFs.NotifyChangeCancel(reqStat);
   895 	User::WaitForRequest(reqStat);
   893 	User::WaitForRequest(reqStat);
   896 	test(reqStat==KErrCancel);
   894 	test_Value(reqStat.Int(), reqStat==KErrCancel);
   897 
   895 
   898 	TheFs.NotifyChange(ENotifyDir,reqStat,path);
   896 	TheFs.NotifyChange(ENotifyDir,reqStat,path);
   899 	test_KErrNone(r);
   897 	test_KErrNone(r);
   900 	test(reqStat==KRequestPending);
   898 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   901 
   899 
   902 //	Get a separate thread to create the directory
   900 //	Get a separate thread to create the directory
   903 	RThread thread;
   901 	RThread thread;
   904 	thread.Create(_L("RequestAheadyThready"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest10);
   902 	thread.Create(_L("RequestAheadyThready"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest10);
   905 	TRequestStatus thrdStat(KRequestPending);
   903 	TRequestStatus thrdStat(KRequestPending);
   906 	thread.Logon(thrdStat);
   904 	thread.Logon(thrdStat);
   907 	thread.Resume();
   905 	thread.Resume();
   908 	thread.Close();
   906 	thread.Close();
   909 
   907 
   910 	User::WaitForRequest(thrdStat);
   908 	User::WaitForRequest(thrdStat);
   911 	test(thrdStat==KErrNone);
   909 	test_KErrNone(thrdStat.Int());
   912 	User::WaitForRequest(reqStat);
   910 	User::WaitForRequest(reqStat);
   913 	test(reqStat==KErrNone);
   911 	test_KErrNone(reqStat.Int());
   914 
   912 
   915 	TheFs.RmDir(path);
   913 	TheFs.RmDir(path);
   916 	test_KErrNone(r);
   914 	test_KErrNone(r);
   917 
   915 
   918 //	Check that notification is not received for a non-existent file if only the previously
   916 //	Check that notification is not received for a non-existent file if only the previously
   919 //	non existent directory that contains it is created
   917 //	non existent directory that contains it is created
   920 	path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man");
   918 	path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man");
   921 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   919 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   922 	test_KErrNone(r);
   920 	test_KErrNone(r);
   923 	test(reqStat==KRequestPending);
   921 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   924 
   922 
   925 	thread.Create(_L("RequestAheadThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest10);
   923 	thread.Create(_L("RequestAheadThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest10);
   926 	thread.Logon(thrdStat);
   924 	thread.Logon(thrdStat);
   927 	thread.Resume();
   925 	thread.Resume();
   928 	thread.Close();
   926 	thread.Close();
   929 
   927 
   930 	User::WaitForRequest(thrdStat);
   928 	User::WaitForRequest(thrdStat);
   931 	test(thrdStat==KErrNone);
   929 	test_KErrNone(thrdStat.Int());
   932 	test(reqStat==KRequestPending);
   930 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   933 
   931 
   934 //	Now get a thread to create the file
   932 //	Now get a thread to create the file
   935 	thread.Create(_L("RequestAhead"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest11);
   933 	thread.Create(_L("RequestAhead"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest11);
   936 	thread.Logon(thrdStat);
   934 	thread.Logon(thrdStat);
   937 	thread.Resume();
   935 	thread.Resume();
   938 	User::WaitForRequest(thrdStat);
   936 	User::WaitForRequest(thrdStat);
   939 	test(thrdStat==KErrNone);
   937 	test_KErrNone(thrdStat.Int());
   940 	thread.Close();
   938 	thread.Close();
   941 
   939 
   942 	User::WaitForRequest(reqStat);
   940 	User::WaitForRequest(reqStat);
   943 	test(reqStat==KErrNone);
   941 	test_KErrNone(reqStat.Int());
   944 
   942 
   945 	TheFs.Delete(path);
   943 	TheFs.Delete(path);
   946 	test_KErrNone(r);
   944 	test_KErrNone(r);
   947 
   945 
   948 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   946 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   949 	test_KErrNone(r);
   947 	test_KErrNone(r);
   950 	test(reqStat==KRequestPending);
   948 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   951 
   949 
   952 //	Now cancel the outstanding request
   950 //	Now cancel the outstanding request
   953 	TheFs.NotifyChangeCancel(reqStat);
   951 	TheFs.NotifyChangeCancel(reqStat);
   954 	User::WaitForRequest(reqStat);
   952 	User::WaitForRequest(reqStat);
   955 	test(reqStat==KErrCancel);
   953 	test_Value(reqStat.Int(), reqStat==KErrCancel);
   956 
   954 
   957 	path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
   955 	path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
   958 	TheFs.RmDir(path);
   956 	TheFs.RmDir(path);
   959 	test_KErrNone(r);
   957 	test_KErrNone(r);
   960 	}
   958 	}
   970 	TRequestStatus reqStat(KRequestPending);
   968 	TRequestStatus reqStat(KRequestPending);
   971 	TRequestStatus thrdStat(KRequestPending);
   969 	TRequestStatus thrdStat(KRequestPending);
   972 	TFileName path=(_L("\\F32-TST\\"));
   970 	TFileName path=(_L("\\F32-TST\\"));
   973 
   971 
   974 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   972 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   975 	test(reqStat==KRequestPending);
   973 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   976 	RThread thread;
   974 	RThread thread;
   977 	TInt r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
   975 	TInt r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
   978 	test_KErrNone(r);
   976 	test_KErrNone(r);
   979 	thread.Logon(thrdStat);
   977 	thread.Logon(thrdStat);
   980 	thread.Resume();
   978 	thread.Resume();
   981 	User::WaitForRequest(thrdStat);
   979 	User::WaitForRequest(thrdStat);
   982 	test(thrdStat==KErrNone);
   980 	test_KErrNone(thrdStat.Int());
   983 	User::WaitForRequest(reqStat);
   981 	User::WaitForRequest(reqStat);
   984 	test(reqStat==KErrNone);
   982 	test_KErrNone(reqStat.Int());
   985 	thread.Close();
   983 	thread.Close();
   986 
   984 
   987 //	Repeat the test
   985 //	Repeat the test
   988 	test.Next(_L("Repeat Test notification of an entry change"));
   986 	test.Next(_L("Repeat Test notification of an entry change"));
   989 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   987 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
   990 	test(reqStat==KRequestPending);
   988 	test_Value(reqStat.Int(), reqStat==KRequestPending);
   991 	r=thread.Create(_L("MyThread2"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
   989 	r=thread.Create(_L("MyThread2"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
   992 	test_KErrNone(r);
   990 	test_KErrNone(r);
   993 	thread.Logon(thrdStat);
   991 	thread.Logon(thrdStat);
   994 	thread.Resume();
   992 	thread.Resume();
   995 	User::WaitForRequest(thrdStat);
   993 	User::WaitForRequest(thrdStat);
   996 	test(thrdStat==KErrNone);
   994 	test_KErrNone(thrdStat.Int());
   997 	User::WaitForRequest(reqStat);
   995 	User::WaitForRequest(reqStat);
   998 	test(reqStat==KErrNone);
   996 	test_KErrNone(reqStat.Int());
   999 	thread.Close();
   997 	thread.Close();
  1000 
   998 
  1001 //	Test it can be cancelled
   999 //	Test it can be cancelled
  1002 	test.Next(_L("Test Notify cancel"));
  1000 	test.Next(_L("Test Notify cancel"));
  1003 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1001 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1004 	test(reqStat==KRequestPending);
  1002 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1005 	TheFs.NotifyChangeCancel();
  1003 	TheFs.NotifyChangeCancel();
  1006 	User::WaitForRequest(reqStat);
  1004 	User::WaitForRequest(reqStat);
  1007 	test(reqStat==KErrCancel);
  1005 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  1008 
  1006 
  1009 //	Test it can be notified again
  1007 //	Test it can be notified again
  1010 	test.Next(_L("Test notification still works"));
  1008 	test.Next(_L("Test notification still works"));
  1011 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1009 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1012 	test(reqStat==KRequestPending);
  1010 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1013 	r=thread.Create(_L("MyThread3"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
  1011 	r=thread.Create(_L("MyThread3"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
  1014 	test_KErrNone(r);
  1012 	test_KErrNone(r);
  1015 	thread.Logon(thrdStat);
  1013 	thread.Logon(thrdStat);
  1016 	thread.Resume();
  1014 	thread.Resume();
  1017 	User::WaitForRequest(thrdStat);
  1015 	User::WaitForRequest(thrdStat);
  1018 	test(thrdStat==KErrNone);
  1016 	test_KErrNone(thrdStat.Int());
  1019 	User::WaitForRequest(reqStat);
  1017 	User::WaitForRequest(reqStat);
  1020 	test(reqStat==KErrNone);
  1018 	test_KErrNone(reqStat.Int());
  1021 	thread.Close();
  1019 	thread.Close();
  1022 
  1020 
  1023 //	Test notification doesn't occur when a change occurs above the directory monitored
  1021 //	Test notification doesn't occur when a change occurs above the directory monitored
  1024 //	(Notification of rename events occurring above the directory which affect the path
  1022 //	(Notification of rename events occurring above the directory which affect the path
  1025 //	will occur - this is tested for in Test18())
  1023 //	will occur - this is tested for in Test18())
  1026 	test.Next(_L("Test changing above monitored directory"));
  1024 	test.Next(_L("Test changing above monitored directory"));
  1027 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
  1025 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
  1028 	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
  1026 	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
  1029 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
  1027 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
  1030 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1028 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1031 	test(reqStat==KRequestPending);
  1029 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1032 	r=thread.Create(_L("MyThread4"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
  1030 	r=thread.Create(_L("MyThread4"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
  1033 	test_KErrNone(r);
  1031 	test_KErrNone(r);
  1034 	thread.Logon(thrdStat);
  1032 	thread.Logon(thrdStat);
  1035 	thread.Resume();
  1033 	thread.Resume();
  1036 	User::WaitForRequest(thrdStat);
  1034 	User::WaitForRequest(thrdStat);
  1037 	test(thrdStat==KErrNone);
  1035 	test_KErrNone(thrdStat.Int());
  1038 	User::After(500000);
  1036 	User::After(500000);
  1039 	thread.Close();
  1037 	thread.Close();
  1040 	test(reqStat==KRequestPending);
  1038 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1041 	TheFs.NotifyChangeCancel();
  1039 	TheFs.NotifyChangeCancel();
  1042 	User::WaitForRequest(reqStat);
  1040 	User::WaitForRequest(reqStat);
  1043 	test(reqStat==KErrCancel);
  1041 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  1044 
  1042 
  1045 //	Test notification occurs when a change is made to the subdirectory monitored
  1043 //	Test notification occurs when a change is made to the subdirectory monitored
  1046 	test.Next(_L("Create a file in monitored subdirectory"));
  1044 	test.Next(_L("Create a file in monitored subdirectory"));
  1047 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1045 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1048 	test(reqStat==KRequestPending);
  1046 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1049 	r=thread.Create(_L("MyThread5"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest2);
  1047 	r=thread.Create(_L("MyThread5"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest2);
  1050 	test_KErrNone(r);
  1048 	test_KErrNone(r);
  1051 	thread.Logon(thrdStat);
  1049 	thread.Logon(thrdStat);
  1052 	thread.Resume();
  1050 	thread.Resume();
  1053 	User::WaitForRequest(thrdStat);
  1051 	User::WaitForRequest(thrdStat);
  1054 	test(thrdStat==KErrNone);
  1052 	test_KErrNone(thrdStat.Int());
  1055 	User::WaitForRequest(reqStat);
  1053 	User::WaitForRequest(reqStat);
  1056 	test(reqStat==KErrNone);
  1054 	test_KErrNone(reqStat.Int());
  1057 	thread.Close();
  1055 	thread.Close();
  1058 
  1056 
  1059 	test.Next(_L("Create a directory in monitored subdirectory"));
  1057 	test.Next(_L("Create a directory in monitored subdirectory"));
  1060 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1058 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1061 	test(reqStat==KRequestPending);
  1059 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1062 	r=thread.Create(_L("MyThread6"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest3);
  1060 	r=thread.Create(_L("MyThread6"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest3);
  1063 	test_KErrNone(r);
  1061 	test_KErrNone(r);
  1064 	thread.Logon(thrdStat);
  1062 	thread.Logon(thrdStat);
  1065 	thread.Resume();
  1063 	thread.Resume();
  1066 	User::WaitForRequest(thrdStat);
  1064 	User::WaitForRequest(thrdStat);
  1067 	test(thrdStat==KErrNone);
  1065 	test_KErrNone(thrdStat.Int());
  1068 	User::WaitForRequest(reqStat);
  1066 	User::WaitForRequest(reqStat);
  1069 	test(reqStat==KErrNone);
  1067 	test_KErrNone(reqStat.Int());
  1070 	thread.Close();
  1068 	thread.Close();
  1071 
  1069 
  1072 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1070 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1073 	test(reqStat==KRequestPending);
  1071 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1074 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\TINMAN\\"));
  1072 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\TINMAN\\"));
  1075 	test_KErrNone(r);
  1073 	test_KErrNone(r);
  1076 	User::WaitForRequest(reqStat);
  1074 	User::WaitForRequest(reqStat);
  1077 	test(reqStat==KErrNone);
  1075 	test_KErrNone(reqStat.Int());
  1078 
  1076 
  1079 
  1077 
  1080 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\TINMAN\\"));
  1078 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\TINMAN\\"));
  1081 	test_KErrNone(r);
  1079 	test_KErrNone(r);
  1082 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\"));
  1080 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\"));
  1087 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
  1085 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
  1088 	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
  1086 	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
  1089 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
  1087 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
  1090 
  1088 
  1091 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1089 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1092 	test(reqStat==KRequestPending);
  1090 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1093 	r=thread.Create(_L("MyThread7"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
  1091 	r=thread.Create(_L("MyThread7"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
  1094 	test_KErrNone(r);
  1092 	test_KErrNone(r);
  1095 	thread.Logon(thrdStat);
  1093 	thread.Logon(thrdStat);
  1096 	thread.Resume();
  1094 	thread.Resume();
  1097 	User::WaitForRequest(thrdStat);
  1095 	User::WaitForRequest(thrdStat);
  1098 	test(thrdStat==KErrNone);
  1096 	test_KErrNone(thrdStat.Int());
  1099 	User::After(500000);
  1097 	User::After(500000);
  1100 	thread.Close();
  1098 	thread.Close();
  1101 	test(reqStat==KRequestPending);
  1099 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1102 	TheFs.NotifyChangeCancel();
  1100 	TheFs.NotifyChangeCancel();
  1103 	User::WaitForRequest(reqStat);
  1101 	User::WaitForRequest(reqStat);
  1104 	test(reqStat==KErrCancel);
  1102 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  1105 
  1103 
  1106 //	Test notification occurs when a change is made to the subdirectory monitored
  1104 //	Test notification occurs when a change is made to the subdirectory monitored
  1107 	test.Next(_L("Delete a file in monitored subdirectory"));
  1105 	test.Next(_L("Delete a file in monitored subdirectory"));
  1108 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1106 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1109 	test(reqStat==KRequestPending);
  1107 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1110 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"));
  1108 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"));
  1111 	test_KErrNone(r);
  1109 	test_KErrNone(r);
  1112 	User::WaitForRequest(reqStat);
  1110 	User::WaitForRequest(reqStat);
  1113 	test(reqStat==KErrNone);
  1111 	test_KErrNone(reqStat.Int());
  1114 
  1112 
  1115 	RFile file;
  1113 	RFile file;
  1116 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.msg"),EFileStream);
  1114 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.msg"),EFileStream);
  1117 	test_KErrNone(r);
  1115 	test_KErrNone(r);
  1118 	file.Close();
  1116 	file.Close();
  1119 
  1117 
  1120 //	Test notification on a specific file
  1118 //	Test notification on a specific file
  1121 	test.Next(_L("Monitor changes to a specific file"));
  1119 	test.Next(_L("Monitor changes to a specific file"));
  1122 	path+=_L("WickedWitch.msg");
  1120 	path+=_L("WickedWitch.msg");
  1123 	TheFs.NotifyChange(ENotifyAll,reqStat,path);
  1121 	TheFs.NotifyChange(ENotifyAll,reqStat,path);
  1124 	test(reqStat==KRequestPending);
  1122 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1125 	r=thread.Create(_L("MyThread8"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest8);
  1123 	r=thread.Create(_L("MyThread8"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest8);
  1126 	test_KErrNone(r);
  1124 	test_KErrNone(r);
  1127 	thread.Logon(thrdStat);
  1125 	thread.Logon(thrdStat);
  1128 	thread.Resume();
  1126 	thread.Resume();
  1129 	User::WaitForRequest(thrdStat);
  1127 	User::WaitForRequest(thrdStat);
  1130 	test(thrdStat==KErrNone);
  1128 	test_KErrNone(thrdStat.Int());
  1131 	User::WaitForRequest(reqStat);
  1129 	User::WaitForRequest(reqStat);
  1132 	test(reqStat==KErrNone);
  1130 	test_KErrNone(reqStat.Int());
  1133 	thread.Close();
  1131 	thread.Close();
  1134 
  1132 
  1135 //	Test notification does not occur if a change is made above the file
  1133 //	Test notification does not occur if a change is made above the file
  1136 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1134 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1137 	test(reqStat==KRequestPending);
  1135 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1138 	thread.Create(_L("MyThread9"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest2);
  1136 	thread.Create(_L("MyThread9"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest2);
  1139 	thread.Logon(thrdStat);
  1137 	thread.Logon(thrdStat);
  1140 	thread.Resume();
  1138 	thread.Resume();
  1141 	User::WaitForRequest(thrdStat);
  1139 	User::WaitForRequest(thrdStat);
  1142 	test(thrdStat==KErrNone);
  1140 	test_KErrNone(thrdStat.Int());
  1143 	User::After(500000);
  1141 	User::After(500000);
  1144 	thread.Close();
  1142 	thread.Close();
  1145 	test(reqStat==KRequestPending);
  1143 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1146 	TheFs.NotifyChangeCancel();
  1144 	TheFs.NotifyChangeCancel();
  1147 	User::WaitForRequest(reqStat);
  1145 	User::WaitForRequest(reqStat);
  1148 	test(reqStat==KErrCancel);
  1146 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  1149 
  1147 
  1150 //	Test notification occurs when a change is made to the file
  1148 //	Test notification occurs when a change is made to the file
  1151 	test.Next(_L("Delete monitored file"));
  1149 	test.Next(_L("Delete monitored file"));
  1152 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1150 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1153 	test(reqStat==KRequestPending);
  1151 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1154 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.Msg"));
  1152 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.Msg"));
  1155 	test_KErrNone(r);
  1153 	test_KErrNone(r);
  1156 	User::WaitForRequest(reqStat);
  1154 	User::WaitForRequest(reqStat);
  1157 	test(reqStat==KErrNone);
  1155 	test_KErrNone(reqStat.Int());
  1158 
  1156 
  1159 //	Test notification request is now submitted on the non existent path successfully
  1157 //	Test notification request is now submitted on the non existent path successfully
  1160 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1158 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1161 	test(reqStat==KRequestPending);
  1159 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1162 	TheFs.NotifyChangeCancel(reqStat);
  1160 	TheFs.NotifyChangeCancel(reqStat);
  1163 	User::WaitForRequest(reqStat);
  1161 	User::WaitForRequest(reqStat);
  1164 	test(reqStat==KErrCancel);
  1162 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  1165 
  1163 
  1166 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.Doc");
  1164 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.Doc");
  1167 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1165 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1168 	test(reqStat==KRequestPending);
  1166 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1169 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.Doc"));
  1167 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.Doc"));
  1170 	test_KErrNone(r);
  1168 	test_KErrNone(r);
  1171 	User::WaitForRequest(reqStat);
  1169 	User::WaitForRequest(reqStat);
  1172 	test(reqStat==KErrNone);
  1170 	test_KErrNone(reqStat.Int());
  1173 
  1171 
  1174 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
  1172 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
  1175 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1173 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1176 	test(reqStat==KRequestPending);
  1174 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1177 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
  1175 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
  1178 	test_KErrNone(r);
  1176 	test_KErrNone(r);
  1179 	User::WaitForRequest(reqStat);
  1177 	User::WaitForRequest(reqStat);
  1180 	test(reqStat==KErrNone);
  1178 	test_KErrNone(reqStat.Int());
  1181 
  1179 
  1182 //	Submit a request for a path which does not yet exist
  1180 //	Submit a request for a path which does not yet exist
  1183 	path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\");
  1181 	path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\");
  1184 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1182 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1185 	test(reqStat==KRequestPending);
  1183 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1186 //	Now create the directory we are waiting on
  1184 //	Now create the directory we are waiting on
  1187 	r=TheFs.MkDir(path);
  1185 	r=TheFs.MkDir(path);
  1188 	test_KErrNone(r);
  1186 	test_KErrNone(r);
  1189 //	Make sure the notification has now been received
  1187 //	Make sure the notification has now been received
  1190 	User::WaitForRequest(reqStat);
  1188 	User::WaitForRequest(reqStat);
  1191 	test(reqStat==KErrNone);
  1189 	test_KErrNone(reqStat.Int());
  1192 
  1190 
  1193 //	Submit a request for a file which does not yet exist
  1191 //	Submit a request for a file which does not yet exist
  1194 	path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\Red-Shoes.red");
  1192 	path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\Red-Shoes.red");
  1195 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1193 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1196 	test(reqStat==KRequestPending);
  1194 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1197 //	Now create the file we are waiting on
  1195 //	Now create the file we are waiting on
  1198 	r=file.Replace(TheFs,path,EFileStream);
  1196 	r=file.Replace(TheFs,path,EFileStream);
  1199 	test_KErrNone(r);
  1197 	test_KErrNone(r);
  1200 	file.Close();
  1198 	file.Close();
  1201 //	Make sure the notification has now been received
  1199 //	Make sure the notification has now been received
  1202 	User::WaitForRequest(reqStat);
  1200 	User::WaitForRequest(reqStat);
  1203 	test(reqStat==KErrNone);
  1201 	test_KErrNone(reqStat.Int());
  1204 //	Submit another notification request and delete the file
  1202 //	Submit another notification request and delete the file
  1205 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1203 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1206 	test(reqStat==KRequestPending);
  1204 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1207 	r=TheFs.Delete(path);
  1205 	r=TheFs.Delete(path);
  1208 	test_KErrNone(r);
  1206 	test_KErrNone(r);
  1209 	User::WaitForRequest(reqStat);
  1207 	User::WaitForRequest(reqStat);
  1210 	test(reqStat==KErrNone);
  1208 	test_KErrNone(reqStat.Int());
  1211 	path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\");
  1209 	path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\");
  1212 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1210 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
  1213 	test(reqStat==KRequestPending);
  1211 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1214 	r=TheFs.RmDir(path);
  1212 	r=TheFs.RmDir(path);
  1215 	test_KErrNone(r);
  1213 	test_KErrNone(r);
  1216 	User::WaitForRequest(reqStat);
  1214 	User::WaitForRequest(reqStat);
  1217 	test(reqStat==KErrNone);
  1215 	test_KErrNone(reqStat.Int());
  1218 	// test passing in an empty string
  1216 	// test passing in an empty string
  1219 	TheFs.NotifyChange(ENotifyEntry,reqStat,_L(""));
  1217 	TheFs.NotifyChange(ENotifyEntry,reqStat,_L(""));
  1220 	User::WaitForRequest(reqStat);
  1218 	User::WaitForRequest(reqStat);
  1221 	test(reqStat==KErrArgument);
  1219 	test_Value(reqStat.Int(), reqStat==KErrArgument);
  1222 	}
  1220 	}
  1223 
  1221 
  1224 static void Test9()
  1222 static void Test9()
  1225 //
  1223 //
  1226 // Test notify for multiple clients
  1224 // Test notify for multiple clients
  1294 	test_KErrNone(r);
  1292 	test_KErrNone(r);
  1295 	r=fs6.SetSessionPath(gSessionPath);
  1293 	r=fs6.SetSessionPath(gSessionPath);
  1296 	test_KErrNone(r);
  1294 	test_KErrNone(r);
  1297 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1295 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1298 
  1296 
  1299 	test(reqStat1==KRequestPending);
  1297 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  1300 	test(reqStat2==KRequestPending);
  1298 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  1301 	test(reqStat3==KRequestPending);
  1299 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  1302 	test(reqStat4==KRequestPending);
  1300 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  1303 	test(reqStat5==KRequestPending);
  1301 	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
  1304 	test(reqStat6==KRequestPending);
  1302 	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
  1305 
  1303 
  1306 //	Make a change a the top level and check that only the session monitoring
  1304 //	Make a change a the top level and check that only the session monitoring
  1307 //	that level is notified
  1305 //	that level is notified
  1308 	test.Next(_L("Test only client monitoring top level is notified"));
  1306 	test.Next(_L("Test only client monitoring top level is notified"));
  1309 	r=file.Replace(TheFs,_L("\\F32-TST\\NewFile.txt"),EFileStream);
  1307 	r=file.Replace(TheFs,_L("\\F32-TST\\NewFile.txt"),EFileStream);
  1310 	test_KErrNone(r);
  1308 	test_KErrNone(r);
  1311 	file.Close();
  1309 	file.Close();
  1312 	User::WaitForRequest(reqStat1);
  1310 	User::WaitForRequest(reqStat1);
  1313 	test(reqStat1==KErrNone);
  1311 	test_KErrNone(reqStat1.Int());
  1314 	test(reqStat2==KRequestPending);
  1312 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  1315 	test(reqStat3==KRequestPending);
  1313 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  1316 	test(reqStat4==KRequestPending);
  1314 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  1317 	test(reqStat5==KRequestPending);
  1315 	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
  1318 	User::WaitForRequest(reqStat6);
  1316 	User::WaitForRequest(reqStat6);
  1319 	test(reqStat6==KErrNone);
  1317 	test_KErrNone(reqStat6.Int());
  1320 
  1318 
  1321 	r=TheFs.Delete(_L("\\F32-TST\\NewFile.txt"));
  1319 	r=TheFs.Delete(_L("\\F32-TST\\NewFile.txt"));
  1322 	test_KErrNone(r);
  1320 	test_KErrNone(r);
  1323 
  1321 
  1324 //	Renew the notify request at the top level and make a change one step lower
  1322 //	Renew the notify request at the top level and make a change one step lower
  1325 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
  1323 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
  1326 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1324 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1327 	test(reqStat1==KRequestPending);
  1325 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  1328 	test(reqStat6==KRequestPending);
  1326 	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
  1329 
  1327 
  1330 	test.Next(_L("Test clients monitoring levels 1 and 2 are notified"));
  1328 	test.Next(_L("Test clients monitoring levels 1 and 2 are notified"));
  1331 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileStream);
  1329 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileStream);
  1332 	test_KErrNone(r);
  1330 	test_KErrNone(r);
  1333 	file.Close();
  1331 	file.Close();
  1334 
  1332 
  1335 	User::WaitForRequest(reqStat1);
  1333 	User::WaitForRequest(reqStat1);
  1336 	User::WaitForRequest(reqStat2);
  1334 	User::WaitForRequest(reqStat2);
  1337 	test(reqStat1==KErrNone);
  1335 	test_KErrNone(reqStat1.Int());
  1338 	test(reqStat2==KErrNone);
  1336 	test_KErrNone(reqStat2.Int());
  1339 	test(reqStat3==KRequestPending);
  1337 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  1340 	test(reqStat4==KRequestPending);
  1338 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  1341 	test(reqStat5==KRequestPending);
  1339 	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
  1342 	User::WaitForRequest(reqStat6);
  1340 	User::WaitForRequest(reqStat6);
  1343 	test(reqStat6==KErrNone);
  1341 	test_KErrNone(reqStat6.Int());
  1344 
  1342 
  1345 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NewFile.txt"));
  1343 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NewFile.txt"));
  1346 	test_KErrNone(r);
  1344 	test_KErrNone(r);
  1347 
  1345 
  1348 //	Renew the notify request at the top and second levels and make a change
  1346 //	Renew the notify request at the top and second levels and make a change
  1349 //	one step lower still
  1347 //	one step lower still
  1350 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
  1348 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
  1351 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
  1349 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
  1352 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1350 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1353 	test(reqStat1==KRequestPending);
  1351 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  1354 	test(reqStat2==KRequestPending);
  1352 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  1355 	test(reqStat6==KRequestPending);
  1353 	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
  1356 
  1354 
  1357 	test.Next(_L("Test clients monitoring levels 1,2 and 3 are notified"));
  1355 	test.Next(_L("Test clients monitoring levels 1,2 and 3 are notified"));
  1358 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\ANIMAL\\NewFile.txt"),EFileStream);
  1356 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\ANIMAL\\NewFile.txt"),EFileStream);
  1359 	test_KErrNone(r);
  1357 	test_KErrNone(r);
  1360 	file.Close();
  1358 	file.Close();
  1361 
  1359 
  1362 	User::WaitForRequest(reqStat1);
  1360 	User::WaitForRequest(reqStat1);
  1363 	User::WaitForRequest(reqStat2);
  1361 	User::WaitForRequest(reqStat2);
  1364 	User::WaitForRequest(reqStat3);
  1362 	User::WaitForRequest(reqStat3);
  1365 	test(reqStat1==KErrNone);
  1363 	test_KErrNone(reqStat1.Int());
  1366 	test(reqStat2==KErrNone);
  1364 	test_KErrNone(reqStat2.Int());
  1367 	test(reqStat3==KErrNone);
  1365 	test_KErrNone(reqStat3.Int());
  1368 	test(reqStat4==KRequestPending);
  1366 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  1369 	test(reqStat5==KRequestPending);
  1367 	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
  1370 	User::WaitForRequest(reqStat6);
  1368 	User::WaitForRequest(reqStat6);
  1371 	test(reqStat6==KErrNone);
  1369 	test_KErrNone(reqStat6.Int());
  1372 
  1370 
  1373 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\NewFile.txt"));
  1371 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\NewFile.txt"));
  1374 	test_KErrNone(r);
  1372 	test_KErrNone(r);
  1375 
  1373 
  1376 //	Renew the notify request at the top, second and third levels and make a change
  1374 //	Renew the notify request at the top, second and third levels and make a change
  1377 //	one step lower still
  1375 //	one step lower still
  1378 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
  1376 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
  1379 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
  1377 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
  1380 	fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
  1378 	fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
  1381 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1379 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1382 	test(reqStat1==KRequestPending);
  1380 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  1383 	test(reqStat2==KRequestPending);
  1381 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  1384 	test(reqStat3==KRequestPending);
  1382 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  1385 	test(reqStat6==KRequestPending);
  1383 	test_Value(reqStat4.Int(), reqStat6==KRequestPending);
  1386 
  1384 
  1387 	test.Next(_L("Test clients monitoring levels 1 - 4 are notified"));
  1385 	test.Next(_L("Test clients monitoring levels 1 - 4 are notified"));
  1388 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\cat.txt"));
  1386 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\cat.txt"));
  1389 	test_KErrNone(r);
  1387 	test_KErrNone(r);
  1390 	User::WaitForRequest(reqStat1);
  1388 	User::WaitForRequest(reqStat1);
  1391 	User::WaitForRequest(reqStat2);
  1389 	User::WaitForRequest(reqStat2);
  1392 	User::WaitForRequest(reqStat3);
  1390 	User::WaitForRequest(reqStat3);
  1393 	User::WaitForRequest(reqStat4);
  1391 	User::WaitForRequest(reqStat4);
  1394 	test(reqStat1==KErrNone);
  1392 	test_KErrNone(reqStat1.Int());
  1395 	test(reqStat2==KErrNone);
  1393 	test_KErrNone(reqStat2.Int());
  1396 	test(reqStat3==KErrNone);
  1394 	test_KErrNone(reqStat3.Int());
  1397 	test(reqStat4==KErrNone);
  1395 	test_KErrNone(reqStat4.Int());
  1398 	test(reqStat5==KRequestPending);
  1396 	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
  1399 	User::WaitForRequest(reqStat6);
  1397 	User::WaitForRequest(reqStat6);
  1400 	test(reqStat6==KErrNone);
  1398 	test_KErrNone(reqStat6.Int());
  1401 
  1399 
  1402 //	Renew the notify request at the top, second and third levels and on the file deleted above
  1400 //	Renew the notify request at the top, second and third levels and on the file deleted above
  1403 //	which will be successful, but will not complete (for obvious reasons)
  1401 //	which will be successful, but will not complete (for obvious reasons)
  1404 
  1402 
  1405 //	Make a change one step lower still
  1403 //	Make a change one step lower still
  1406 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
  1404 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
  1407 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
  1405 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
  1408 	fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
  1406 	fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
  1409 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1407 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1410 	fs4.NotifyChange(ENotifyEntry,reqStat4,path4);
  1408 	fs4.NotifyChange(ENotifyEntry,reqStat4,path4);
  1411 	test(reqStat1==KRequestPending);
  1409 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  1412 	test(reqStat2==KRequestPending);
  1410 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  1413 	test(reqStat3==KRequestPending);
  1411 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  1414 	test(reqStat4==KRequestPending);
  1412 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  1415 	test(reqStat6==KRequestPending);
  1413 	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
  1416 
  1414 
  1417 	test.Next(_L("Test clients monitoring levels 1 - 3 and 5 are notified"));
  1415 	test.Next(_L("Test clients monitoring levels 1 - 3 and 5 are notified"));
  1418 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\dog.txt"));
  1416 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\dog.txt"));
  1419 	test_KErrNone(r);
  1417 	test_KErrNone(r);
  1420 	User::WaitForRequest(reqStat1);
  1418 	User::WaitForRequest(reqStat1);
  1421 	User::WaitForRequest(reqStat2);
  1419 	User::WaitForRequest(reqStat2);
  1422 	User::WaitForRequest(reqStat3);
  1420 	User::WaitForRequest(reqStat3);
  1423 //	Don't wait for reqStat4
  1421 //	Don't wait for reqStat4
  1424 	User::WaitForRequest(reqStat5);
  1422 	User::WaitForRequest(reqStat5);
  1425 	User::WaitForRequest(reqStat6);
  1423 	User::WaitForRequest(reqStat6);
  1426 	test(reqStat1==KErrNone);
  1424 	test_KErrNone(reqStat1.Int());
  1427 	test(reqStat2==KErrNone);
  1425 	test_KErrNone(reqStat2.Int());
  1428 	test(reqStat3==KErrNone);
  1426 	test_KErrNone(reqStat3.Int());
  1429 	test(reqStat4==KRequestPending);	//	File does not exist
  1427 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	File does not exist
  1430 	test(reqStat5==KErrNone);
  1428 	test_KErrNone(reqStat5.Int());
  1431 	test(reqStat6==KErrNone);
  1429 	test_KErrNone(reqStat6.Int());
  1432 
  1430 
  1433 	fs4.NotifyChangeCancel(reqStat4);
  1431 	fs4.NotifyChangeCancel(reqStat4);
  1434 	User::WaitForRequest(reqStat4);
  1432 	User::WaitForRequest(reqStat4);
  1435 	test(reqStat4==KErrCancel);
  1433 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  1436 //	Renew the notify request at the top, second and third levels and attempt to renew
  1434 //	Renew the notify request at the top, second and third levels and attempt to renew
  1437 //	the request on the files deleted above (which will fail).
  1435 //	the request on the files deleted above (which will fail).
  1438 
  1436 
  1439 	test.Next(_L("Test clients monitoring levels 1 - 3 are notified"));
  1437 	test.Next(_L("Test clients monitoring levels 1 - 3 are notified"));
  1440 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
  1438 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
  1441 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
  1439 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
  1442 	fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
  1440 	fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
  1443 	fs4.NotifyChange(ENotifyEntry,reqStat4,path4);
  1441 	fs4.NotifyChange(ENotifyEntry,reqStat4,path4);
  1444 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1442 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1445 	fs5.NotifyChange(ENotifyEntry,reqStat5,path5);
  1443 	fs5.NotifyChange(ENotifyEntry,reqStat5,path5);
  1446 	test(reqStat1==KRequestPending);
  1444 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  1447 	test(reqStat2==KRequestPending);
  1445 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  1448 	test(reqStat3==KRequestPending);
  1446 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  1449 	test(reqStat4==KRequestPending);
  1447 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  1450 	test(reqStat5==KRequestPending);
  1448 	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
  1451 	test(reqStat6==KRequestPending);
  1449 	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
  1452 
  1450 
  1453 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\ANIMAL\\"));
  1451 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\ANIMAL\\"));
  1454 	test_KErrNone(r);
  1452 	test_KErrNone(r);
  1455 	User::WaitForRequest(reqStat1);
  1453 	User::WaitForRequest(reqStat1);
  1456 	User::WaitForRequest(reqStat2);
  1454 	User::WaitForRequest(reqStat2);
  1457 	User::WaitForRequest(reqStat3);
  1455 	User::WaitForRequest(reqStat3);
  1458 	test(reqStat1==KErrNone);
  1456 	test_KErrNone(reqStat1.Int());
  1459 	test(reqStat2==KErrNone);
  1457 	test_KErrNone(reqStat2.Int());
  1460 	test(reqStat3==KErrNone);
  1458 	test_KErrNone(reqStat3.Int());
  1461 	test(reqStat4==KRequestPending);
  1459 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  1462 	test(reqStat5==KRequestPending);
  1460 	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
  1463 	User::WaitForRequest(reqStat6);
  1461 	User::WaitForRequest(reqStat6);
  1464 	test(reqStat6==KErrNone);
  1462 	test_KErrNone(reqStat6.Int());
  1465 
  1463 
  1466 //	Renew the notify request at the top and second levels on the third level
  1464 //	Renew the notify request at the top and second levels on the third level
  1467 //	which was removed - it'll succeed but won't complete.
  1465 //	which was removed - it'll succeed but won't complete.
  1468 
  1466 
  1469 	test.Next(_L("Test clients monitoring levels 1 and 2 are notified"));
  1467 	test.Next(_L("Test clients monitoring levels 1 and 2 are notified"));
  1471 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
  1469 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
  1472 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
  1470 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
  1473 	fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
  1471 	fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
  1474 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1472 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
  1475 
  1473 
  1476 	test(reqStat1==KRequestPending);
  1474 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  1477 	test(reqStat2==KRequestPending);
  1475 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  1478 	test(reqStat3==KRequestPending);
  1476 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  1479 	test(reqStat4==KRequestPending);
  1477 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  1480 	test(reqStat5==KRequestPending);
  1478 	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
  1481 	test(reqStat6==KRequestPending);
  1479 	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
  1482 
  1480 
  1483 	fs1.NotifyChangeCancel();
  1481 	fs1.NotifyChangeCancel();
  1484 	fs2.NotifyChangeCancel();
  1482 	fs2.NotifyChangeCancel();
  1485 
  1483 
  1486 	fs1.Close();
  1484 	fs1.Close();
  1523 	fs1.NotifyChange(ENotifyAll,status1,path);
  1521 	fs1.NotifyChange(ENotifyAll,status1,path);
  1524 	fs1.NotifyChange(ENotifyAll,status2,path);
  1522 	fs1.NotifyChange(ENotifyAll,status2,path);
  1525 	fs1.NotifyChange(ENotifyAll,status3,path);
  1523 	fs1.NotifyChange(ENotifyAll,status3,path);
  1526 	fs1.NotifyChange(ENotifyAll,status4,path);
  1524 	fs1.NotifyChange(ENotifyAll,status4,path);
  1527 	fs1.NotifyChange(ENotifyAll,status5,path);
  1525 	fs1.NotifyChange(ENotifyAll,status5,path);
  1528 	test(status1==KRequestPending);
  1526 	test_Value(status1.Int(), status1==KRequestPending);
  1529 	test(status2==KRequestPending);
  1527 	test_Value(status2.Int(), status2==KRequestPending);
  1530 	test(status3==KRequestPending);
  1528 	test_Value(status3.Int(), status3==KRequestPending);
  1531 	test(status4==KRequestPending);
  1529 	test_Value(status4.Int(), status4==KRequestPending);
  1532 	test(status5==KRequestPending);
  1530 	test_Value(status5.Int(), status5==KRequestPending);
  1533 
  1531 
  1534 	test.Next(_L("RFs::NotifyCancel()"));
  1532 	test.Next(_L("RFs::NotifyCancel()"));
  1535 //	Test that one call to RFs::NotifyCancel() cancels all outstanding requests
  1533 //	Test that one call to RFs::NotifyCancel() cancels all outstanding requests
  1536 	fs1.NotifyChangeCancel();
  1534 	fs1.NotifyChangeCancel();
  1537 	User::WaitForRequest(status1);
  1535 	User::WaitForRequest(status1);
  1538 	test(status1==KErrCancel);
  1536 	test_Value(status1.Int(), status1==KErrCancel);
  1539 	User::WaitForRequest(status2);
  1537 	User::WaitForRequest(status2);
  1540 	test(status2==KErrCancel);
  1538 	test_Value(status2.Int(), status2==KErrCancel);
  1541 	User::WaitForRequest(status3);
  1539 	User::WaitForRequest(status3);
  1542 	test(status3==KErrCancel);
  1540 	test_Value(status3.Int(), status3==KErrCancel);
  1543 	User::WaitForRequest(status4);
  1541 	User::WaitForRequest(status4);
  1544 	test(status4==KErrCancel);
  1542 	test_Value(status4.Int(), status4==KErrCancel);
  1545 	User::WaitForRequest(status5);
  1543 	User::WaitForRequest(status5);
  1546 	test(status5==KErrCancel);
  1544 	test_Value(status5.Int(), status5==KErrCancel);
  1547 //	Call the cancel function again to check no further action
  1545 //	Call the cancel function again to check no further action
  1548 	fs1.NotifyChangeCancel();
  1546 	fs1.NotifyChangeCancel();
  1549 
  1547 
  1550 //	Test overloaded function to cancel a single request
  1548 //	Test overloaded function to cancel a single request
  1551 	test.Next(_L("Cancel notification request using function overload"));
  1549 	test.Next(_L("Cancel notification request using function overload"));
  1552 	fs1.NotifyChange(ENotifyAll,status1,path);
  1550 	fs1.NotifyChange(ENotifyAll,status1,path);
  1553 	fs1.NotifyChange(ENotifyAll,status2,path);
  1551 	fs1.NotifyChange(ENotifyAll,status2,path);
  1554 	fs1.NotifyChange(ENotifyAll,status3,path);
  1552 	fs1.NotifyChange(ENotifyAll,status3,path);
  1555 	fs1.NotifyChange(ENotifyAll,status4,path);
  1553 	fs1.NotifyChange(ENotifyAll,status4,path);
  1556 	fs1.NotifyChange(ENotifyAll,status5,path);
  1554 	fs1.NotifyChange(ENotifyAll,status5,path);
  1557 	test(status1==KRequestPending);
  1555 	test_Value(status1.Int(), status1==KRequestPending);
  1558 	test(status2==KRequestPending);
  1556 	test_Value(status2.Int(), status2==KRequestPending);
  1559 	test(status3==KRequestPending);
  1557 	test_Value(status3.Int(), status3==KRequestPending);
  1560 	test(status4==KRequestPending);
  1558 	test_Value(status4.Int(), status4==KRequestPending);
  1561 	test(status5==KRequestPending);
  1559 	test_Value(status5.Int(), status5==KRequestPending);
  1562 
  1560 
  1563 //	Cancel the outstanding request with status5
  1561 //	Cancel the outstanding request with status5
  1564 	test.Next(_L("RFs::NotifyCancel()"));
  1562 	test.Next(_L("RFs::NotifyCancel()"));
  1565 	fs1.NotifyChangeCancel(status5);
  1563 	fs1.NotifyChangeCancel(status5);
  1566 	User::WaitForRequest(status5);
  1564 	User::WaitForRequest(status5);
  1567 	test(status1==KRequestPending);
  1565 	test_Value(status1.Int(), status1==KRequestPending);
  1568 	test(status2==KRequestPending);
  1566 	test_Value(status2.Int(), status2==KRequestPending);
  1569 	test(status3==KRequestPending);
  1567 	test_Value(status3.Int(), status3==KRequestPending);
  1570 	test(status4==KRequestPending);
  1568 	test_Value(status4.Int(), status4==KRequestPending);
  1571 	test(status5==KErrCancel);
  1569 	test_Value(status5.Int(), status5==KErrCancel);
  1572 
  1570 
  1573 	r=TheFs.MkDir(_L("\\F32-TST\\TROPICANA\\"));
  1571 	r=TheFs.MkDir(_L("\\F32-TST\\TROPICANA\\"));
  1574 	test_KErrNone(r);
  1572 	test_KErrNone(r);
  1575 	test(status1==KRequestPending);
  1573 	test_Value(status1.Int(), status1==KRequestPending);
  1576 	test(status2==KRequestPending);
  1574 	test_Value(status2.Int(), status2==KRequestPending);
  1577 	test(status3==KRequestPending);
  1575 	test_Value(status3.Int(), status3==KRequestPending);
  1578 	test(status4==KRequestPending);
  1576 	test_Value(status4.Int(), status4==KRequestPending);
  1579 
  1577 
  1580 	fs1.NotifyChangeCancel(status2);
  1578 	fs1.NotifyChangeCancel(status2);
  1581 	User::WaitForRequest(status2);
  1579 	User::WaitForRequest(status2);
  1582 
  1580 
  1583 	test(status1==KRequestPending);
  1581 	test_Value(status1.Int(), status1==KRequestPending);
  1584 	test(status2==KErrCancel);
  1582 	test_Value(status2.Int(), status2==KErrCancel);
  1585 	test(status3==KRequestPending);
  1583 	test_Value(status3.Int(), status3==KRequestPending);
  1586 	test(status4==KRequestPending);
  1584 	test_Value(status4.Int(), status4==KRequestPending);
  1587 
  1585 
  1588 	r=TheFs.RmDir(_L("\\F32-TST\\TROPICANA\\"));
  1586 	r=TheFs.RmDir(_L("\\F32-TST\\TROPICANA\\"));
  1589 	test_KErrNone(r);
  1587 	test_KErrNone(r);
  1590 	test(status1==KRequestPending);
  1588 	test_Value(status1.Int(), status1==KRequestPending);
  1591 	test(status3==KRequestPending);
  1589 	test_Value(status3.Int(), status3==KRequestPending);
  1592 	test(status4==KRequestPending);
  1590 	test_Value(status4.Int(), status4==KRequestPending);
  1593 
  1591 
  1594 	fs1.NotifyChangeCancel(status4);
  1592 	fs1.NotifyChangeCancel(status4);
  1595 	User::WaitForRequest(status4);
  1593 	User::WaitForRequest(status4);
  1596 	test(status1==KRequestPending);
  1594 	test_Value(status1.Int(), status1==KRequestPending);
  1597 	test(status3==KRequestPending);
  1595 	test_Value(status3.Int(), status3==KRequestPending);
  1598 	test(status4==KErrCancel);
  1596 	test_Value(status4.Int(), status4==KErrCancel);
  1599 
  1597 
  1600 	fs1.NotifyChangeCancel(status4);	//	Test no side effects on trying to cancel a request
  1598 	fs1.NotifyChangeCancel(status4);	//	Test no side effects on trying to cancel a request
  1601 	test(status4==KErrCancel);			//	that has already been cancelled
  1599 	test_Value(status4.Int(), status4==KErrCancel);			//	that has already been cancelled
  1602 
  1600 
  1603 	fs1.NotifyChangeCancel(status1);
  1601 	fs1.NotifyChangeCancel(status1);
  1604 	User::WaitForRequest(status1);
  1602 	User::WaitForRequest(status1);
  1605 	test(status1==KErrCancel);
  1603 	test_Value(status1.Int(), status1==KErrCancel);
  1606 	test(status3==KRequestPending);
  1604 	test_Value(status3.Int(), status3==KRequestPending);
  1607 	fs1.NotifyChangeCancel(status1);	//	Test no side effects on trying to cancel a request
  1605 	fs1.NotifyChangeCancel(status1);	//	Test no side effects on trying to cancel a request
  1608 	test(status1==KErrCancel);			//	that has already been cancelled
  1606 	test_Value(status1.Int(), status1==KErrCancel);			//	that has already been cancelled
  1609 
  1607 
  1610 	fs1.NotifyChangeCancel(status3);
  1608 	fs1.NotifyChangeCancel(status3);
  1611 	User::WaitForRequest(status3);
  1609 	User::WaitForRequest(status3);
  1612 	test(status3==KErrCancel);
  1610 	test_Value(status3.Int(), status3==KErrCancel);
  1613 
  1611 
  1614 	fs1.Close();
  1612 	fs1.Close();
  1615 	}
  1613 	}
  1616 
  1614 
  1617 static void Test11()
  1615 static void Test11()
  1691 	test_KErrNone(r);
  1689 	test_KErrNone(r);
  1692 	r=fs3.SetSessionPath(gSessionPath);
  1690 	r=fs3.SetSessionPath(gSessionPath);
  1693 	test_KErrNone(r);
  1691 	test_KErrNone(r);
  1694 	fs3.NotifyChange(ENotifyEntry,reqStat3,path);
  1692 	fs3.NotifyChange(ENotifyEntry,reqStat3,path);
  1695 
  1693 
  1696 	test(reqStat1==KRequestPending);
  1694 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  1697 	test(reqStat2==KRequestPending);
  1695 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  1698 	test(reqStat3==KRequestPending);
  1696 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  1699 
  1697 
  1700 	r=gSleepThread.CreateLocal(0);
  1698 	r=gSleepThread.CreateLocal(0);
  1701 	test_KErrNone(r);
  1699 	test_KErrNone(r);
  1702 	RThread thread1;
  1700 	RThread thread1;
  1703 	r=thread1.Create(_L("TestThread1"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
  1701 	r=thread1.Create(_L("TestThread1"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
  1704 	test_KErrNone(r);
  1702 	test_KErrNone(r);
  1705 	thread1.Resume();
  1703 	thread1.Resume();
  1706 	gSleepThread.Wait();
  1704 	gSleepThread.Wait();
  1707 
  1705 
  1708 	test(reqStat1==KRequestPending);
  1706 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  1709 	test(reqStat2==KRequestPending);
  1707 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  1710 	test(reqStat3==KRequestPending);
  1708 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  1711 
  1709 
  1712 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
  1710 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
  1713 	test_KErrNone(r);
  1711 	test_KErrNone(r);
  1714 	User::WaitForRequest(reqStat1);
  1712 	User::WaitForRequest(reqStat1);
  1715 	User::WaitForRequest(reqStat2);
  1713 	User::WaitForRequest(reqStat2);
  1716 	User::WaitForRequest(reqStat3);
  1714 	User::WaitForRequest(reqStat3);
  1717 	test(reqStat1==KErrNone);	//	All three notifications occur because they
  1715 	test_KErrNone(reqStat1.Int());	//	All three notifications occur because they
  1718 	test(reqStat2==KErrNone);	//	are all monitoring the top level directory
  1716 	test_KErrNone(reqStat2.Int());	//	are all monitoring the top level directory
  1719 	test(reqStat3==KErrNone);	//	Later, we'll test monitoring individual files...
  1717 	test_KErrNone(reqStat3.Int());	//	Later, we'll test monitoring individual files...
  1720 
  1718 
  1721 	gSleepThread.Close();
  1719 	gSleepThread.Close();
  1722 	thread1.Close();
  1720 	thread1.Close();
  1723 
  1721 
  1724 	test.Next(_L("Test reads and writes do cause notification under ENotifyAll"));
  1722 	test.Next(_L("Test reads and writes do cause notification under ENotifyAll"));
  1728 
  1726 
  1729 	fs1.NotifyChange(ENotifyAll,reqStat1,path);
  1727 	fs1.NotifyChange(ENotifyAll,reqStat1,path);
  1730 	fs2.NotifyChange(ENotifyAll,reqStat2,path);
  1728 	fs2.NotifyChange(ENotifyAll,reqStat2,path);
  1731 	fs3.NotifyChange(ENotifyAll,reqStat3,path);
  1729 	fs3.NotifyChange(ENotifyAll,reqStat3,path);
  1732 
  1730 
  1733 	test(reqStat1==KRequestPending);
  1731 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  1734 	test(reqStat2==KRequestPending);
  1732 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  1735 	test(reqStat3==KRequestPending);
  1733 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  1736 
  1734 
  1737 	r=gSleepThread.CreateLocal(0);
  1735 	r=gSleepThread.CreateLocal(0);
  1738 	test_KErrNone(r);
  1736 	test_KErrNone(r);
  1739 	RThread thread2;
  1737 	RThread thread2;
  1740 	r=thread2.Create(_L("TestThread2"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
  1738 	r=thread2.Create(_L("TestThread2"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
  1743 	gSleepThread.Wait();
  1741 	gSleepThread.Wait();
  1744 
  1742 
  1745 	User::WaitForRequest(reqStat1);
  1743 	User::WaitForRequest(reqStat1);
  1746 	User::WaitForRequest(reqStat2);
  1744 	User::WaitForRequest(reqStat2);
  1747 	User::WaitForRequest(reqStat3);
  1745 	User::WaitForRequest(reqStat3);
  1748 	test(reqStat1==KErrNone);
  1746 	test_KErrNone(reqStat1.Int());
  1749 	test(reqStat2==KErrNone);
  1747 	test_KErrNone(reqStat2.Int());
  1750 	test(reqStat3==KErrNone);
  1748 	test_KErrNone(reqStat3.Int());
  1751 
  1749 
  1752 	gSleepThread.Close();
  1750 	gSleepThread.Close();
  1753 	thread2.Close();
  1751 	thread2.Close();
  1754 
  1752 
  1755 	test.Next(_L("Monitor reads and writes on specific files with either TNotifyType"));
  1753 	test.Next(_L("Monitor reads and writes on specific files with either TNotifyType"));
  1762 
  1760 
  1763 	fs1.NotifyChange(ENotifyAll,reqStat1,path1);
  1761 	fs1.NotifyChange(ENotifyAll,reqStat1,path1);
  1764 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
  1762 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
  1765 	fs3.NotifyChange(ENotifyAll,reqStat3,path3);
  1763 	fs3.NotifyChange(ENotifyAll,reqStat3,path3);
  1766 
  1764 
  1767 	test(reqStat1==KRequestPending);
  1765 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  1768 	test(reqStat2==KRequestPending);
  1766 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  1769 	test(reqStat3==KRequestPending);
  1767 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  1770 
  1768 
  1771 	r=gSleepThread.CreateLocal(0);
  1769 	r=gSleepThread.CreateLocal(0);
  1772 	test_KErrNone(r);
  1770 	test_KErrNone(r);
  1773 	RThread thread3;
  1771 	RThread thread3;
  1774 	r=thread3.Create(_L("TestThread3"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
  1772 	r=thread3.Create(_L("TestThread3"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
  1775 	test_KErrNone(r);
  1773 	test_KErrNone(r);
  1776 	thread3.Resume();
  1774 	thread3.Resume();
  1777 	gSleepThread.Wait();
  1775 	gSleepThread.Wait();
  1778 
  1776 
  1779 	User::WaitForRequest(reqStat1);
  1777 	User::WaitForRequest(reqStat1);
  1780 	test(reqStat1==KErrNone);
  1778 	test_KErrNone(reqStat1.Int());
  1781 	test(reqStat2==KRequestPending);	//	Monitoring with ENotifyEntry
  1779 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);	//	Monitoring with ENotifyEntry
  1782 	User::WaitForRequest(reqStat3);
  1780 	User::WaitForRequest(reqStat3);
  1783 	test(reqStat3==KErrNone);
  1781 	test_KErrNone(reqStat3.Int());
  1784 
  1782 
  1785 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\koala.txt"));
  1783 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\koala.txt"));
  1786 	test_KErrNone(r);
  1784 	test_KErrNone(r);
  1787 	User::WaitForRequest(reqStat2);
  1785 	User::WaitForRequest(reqStat2);
  1788 	test(reqStat2==KErrNone);
  1786 	test_KErrNone(reqStat2.Int());
  1789 
  1787 
  1790 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
  1788 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
  1791 	test_KErrNone(r);
  1789 	test_KErrNone(r);
  1792 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\dingo.txt"));
  1790 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\dingo.txt"));
  1793 	test_KErrNone(r);
  1791 	test_KErrNone(r);
  1824 	test.Next(_L("Monitor changes to a specific file"));
  1822 	test.Next(_L("Monitor changes to a specific file"));
  1825 	TFileName path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.msg");
  1823 	TFileName path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.msg");
  1826 	TRequestStatus reqStat(KRequestPending);
  1824 	TRequestStatus reqStat(KRequestPending);
  1827 	TRequestStatus thrdStat(KRequestPending);
  1825 	TRequestStatus thrdStat(KRequestPending);
  1828 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1826 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1829 	test(reqStat==KRequestPending);
  1827 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1830 	RThread thread;
  1828 	RThread thread;
  1831 	r=thread.Create(_L("MyThread7"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest8);
  1829 	r=thread.Create(_L("MyThread7"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest8);
  1832 	test_KErrNone(r);
  1830 	test_KErrNone(r);
  1833 	thread.Logon(thrdStat);
  1831 	thread.Logon(thrdStat);
  1834 	thread.Resume();
  1832 	thread.Resume();
  1835 	User::WaitForRequest(thrdStat);
  1833 	User::WaitForRequest(thrdStat);
  1836 	test(thrdStat==KErrNone);
  1834 	test_KErrNone(thrdStat.Int());
  1837 	User::WaitForRequest(reqStat);
  1835 	User::WaitForRequest(reqStat);
  1838 	test(reqStat==KErrNone);
  1836 	test_KErrNone(reqStat.Int());
  1839 	thread.Close();
  1837 	thread.Close();
  1840 //	Test notification does not occur if a change is made above the file
  1838 //	Test notification does not occur if a change is made above the file
  1841 	fs.NotifyChange(ENotifyEntry,reqStat,path);
  1839 	fs.NotifyChange(ENotifyEntry,reqStat,path);
  1842 	test(reqStat==KRequestPending);
  1840 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1843 	r=thread.Create(_L("MyThread8"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
  1841 	r=thread.Create(_L("MyThread8"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
  1844 	test_KErrNone(r);
  1842 	test_KErrNone(r);
  1845 	thread.Logon(thrdStat);
  1843 	thread.Logon(thrdStat);
  1846 	thread.Resume();
  1844 	thread.Resume();
  1847 	User::WaitForRequest(thrdStat);
  1845 	User::WaitForRequest(thrdStat);
  1848 	test(thrdStat==KErrNone);
  1846 	test_KErrNone(thrdStat.Int());
  1849 	User::After(500000);
  1847 	User::After(500000);
  1850 	thread.Close();
  1848 	thread.Close();
  1851 	test(reqStat==KRequestPending);
  1849 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1852 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NEWFILE.TXT"));
  1850 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NEWFILE.TXT"));
  1853 	test_KErrNone(r);
  1851 	test_KErrNone(r);
  1854 
  1852 
  1855 //	Test notification does not occur if a change is made to another file
  1853 //	Test notification does not occur if a change is made to another file
  1856 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Lion.log"),EFileStream);
  1854 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Lion.log"),EFileStream);
  1857 	test_KErrNone(r);
  1855 	test_KErrNone(r);
  1858 	test(reqStat==KRequestPending);
  1856 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1859 	file.Close();
  1857 	file.Close();
  1860 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Lion.log"));
  1858 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Lion.log"));
  1861 	test_KErrNone(r);
  1859 	test_KErrNone(r);
  1862 	test(reqStat==KRequestPending);
  1860 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1863 
  1861 
  1864 
  1862 
  1865 //	Test notification occurs when a change is made to the file
  1863 //	Test notification occurs when a change is made to the file
  1866 	test.Next(_L("Delete monitored file"));
  1864 	test.Next(_L("Delete monitored file"));
  1867 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.Msg"));
  1865 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.Msg"));
  1868 	test_KErrNone(r);
  1866 	test_KErrNone(r);
  1869 	User::WaitForRequest(reqStat);
  1867 	User::WaitForRequest(reqStat);
  1870 	test(reqStat==KErrNone);
  1868 	test_KErrNone(reqStat.Int());
  1871 
  1869 
  1872 	fs.Close();
  1870 	fs.Close();
  1873 	}
  1871 	}
  1874 
  1872 
  1875 static void Test14()
  1873 static void Test14()
  1891 	TRequestStatus reqStat(KRequestPending);
  1889 	TRequestStatus reqStat(KRequestPending);
  1892 
  1890 
  1893 	RFile file;
  1891 	RFile file;
  1894 
  1892 
  1895 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1893 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1896 	test(reqStat==KRequestPending);
  1894 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1897 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  1895 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  1898 	test_KErrNone(r);
  1896 	test_KErrNone(r);
  1899 	User::WaitForRequest(reqStat);
  1897 	User::WaitForRequest(reqStat);
  1900 	test(reqStat==KErrNone);
  1898 	test_KErrNone(reqStat.Int());
  1901 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1899 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1902 	test(reqStat==KRequestPending);
  1900 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1903 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
  1901 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
  1904 	test_KErrNone(r);
  1902 	test_KErrNone(r);
  1905 	file.Close();
  1903 	file.Close();
  1906 	User::WaitForRequest(reqStat);
  1904 	User::WaitForRequest(reqStat);
  1907 	test(reqStat==KErrNone);
  1905 	test_KErrNone(reqStat.Int());
  1908 
  1906 
  1909 //	RFile::Read() a file within the monitored directory - no notification for reads
  1907 //	RFile::Read() a file within the monitored directory - no notification for reads
  1910 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
  1908 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
  1911 	TBuf8<100> temp;
  1909 	TBuf8<100> temp;
  1912 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1910 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1913 	test(reqStat==KRequestPending);
  1911 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1914 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  1912 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  1915 	test_KErrNone(r);
  1913 	test_KErrNone(r);
  1916 	test(reqStat==KRequestPending);
  1914 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1917 	r=file.Read(0,temp,100);
  1915 	r=file.Read(0,temp,100);
  1918 	test(reqStat==KRequestPending);
  1916 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1919 
  1917 
  1920 //	RFile::SetAtt() of a file within the monitored directory
  1918 //	RFile::SetAtt() of a file within the monitored directory
  1921 	test.Next(_L("RFile::SetAtt()"));
  1919 	test.Next(_L("RFile::SetAtt()"));
  1922 	r=file.SetAtt(KEntryAttSystem,KEntryAttNormal);
  1920 	r=file.SetAtt(KEntryAttSystem,KEntryAttNormal);
  1923 	test_KErrNone(r);
  1921 	test_KErrNone(r);
  1924 	User::WaitForRequest(reqStat);
  1922 	User::WaitForRequest(reqStat);
  1925 	test(reqStat==KErrNone);
  1923 	test_KErrNone(reqStat.Int());
  1926 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1924 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1927 	test(reqStat==KRequestPending);
  1925 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1928 
  1926 
  1929 //	RFile::SetSize() of a file within the monitored directory
  1927 //	RFile::SetSize() of a file within the monitored directory
  1930 	test.Next(_L("RFile::SetSize()"));
  1928 	test.Next(_L("RFile::SetSize()"));
  1931 	r=file.SetSize(256);
  1929 	r=file.SetSize(256);
  1932 	test_KErrNone(r);
  1930 	test_KErrNone(r);
  1933 	User::WaitForRequest(reqStat);
  1931 	User::WaitForRequest(reqStat);
  1934 	test(reqStat==KErrNone);
  1932 	test_KErrNone(reqStat.Int());
  1935 	file.Close();
  1933 	file.Close();
  1936 
  1934 
  1937 //	RFile::Temp() to create a temp file within the monitored directory
  1935 //	RFile::Temp() to create a temp file within the monitored directory
  1938 	test.Next(_L("RFile::Temp()"));
  1936 	test.Next(_L("RFile::Temp()"));
  1939 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1937 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1940 	test(reqStat==KRequestPending);
  1938 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1941 	TFileName fileName;
  1939 	TFileName fileName;
  1942 	r=file.Temp(TheFs,path,fileName,EFileWrite);
  1940 	r=file.Temp(TheFs,path,fileName,EFileWrite);
  1943 	test_KErrNone(r);
  1941 	test_KErrNone(r);
  1944 	User::WaitForRequest(reqStat);
  1942 	User::WaitForRequest(reqStat);
  1945 	test(reqStat==KErrNone);
  1943 	test_KErrNone(reqStat.Int());
  1946 	file.Close();
  1944 	file.Close();
  1947 
  1945 
  1948 //	RFile::SetModified() to change modification time of a file within monitored dir
  1946 //	RFile::SetModified() to change modification time of a file within monitored dir
  1949 	test.Next(_L("RFile::SetModified()"));
  1947 	test.Next(_L("RFile::SetModified()"));
  1950 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1948 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1951 	test(reqStat==KRequestPending);
  1949 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1952 	TTime now;
  1950 	TTime now;
  1953 	now.HomeTime();
  1951 	now.HomeTime();
  1954 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  1952 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  1955 	test_KErrNone(r);
  1953 	test_KErrNone(r);
  1956 	test(reqStat==KRequestPending);
  1954 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1957 	file.SetModified(now);
  1955 	file.SetModified(now);
  1958 	file.Close();
  1956 	file.Close();
  1959 	User::WaitForRequest(reqStat);
  1957 	User::WaitForRequest(reqStat);
  1960 	test(reqStat==KErrNone);
  1958 	test_KErrNone(reqStat.Int());
  1961 
  1959 
  1962 //	RFs::SetEntry() to change a directory entry within the monitored directory
  1960 //	RFs::SetEntry() to change a directory entry within the monitored directory
  1963 	test.Next(_L("RFs::SetEntry()"));
  1961 	test.Next(_L("RFs::SetEntry()"));
  1964 	TEntry entry;
  1962 	TEntry entry;
  1965 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1963 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1966 	r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry);
  1964 	r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry);
  1967 	test(reqStat==KRequestPending);
  1965 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1968 	now.HomeTime();
  1966 	now.HomeTime();
  1969 	r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal);
  1967 	r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal);
  1970 	test_KErrNone(r);
  1968 	test_KErrNone(r);
  1971 	User::WaitForRequest(reqStat);
  1969 	User::WaitForRequest(reqStat);
  1972 	test(reqStat==KErrNone);
  1970 	test_KErrNone(reqStat.Int());
  1973 
  1971 
  1974 //	RFile::Set() to change file's modification time and attributes
  1972 //	RFile::Set() to change file's modification time and attributes
  1975 	test.Next(_L("RFile::Set()"));
  1973 	test.Next(_L("RFile::Set()"));
  1976 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1974 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1977 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  1975 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  1978 	test_KErrNone(r);
  1976 	test_KErrNone(r);
  1979 	test(reqStat==KRequestPending);
  1977 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1980 	now.HomeTime();
  1978 	now.HomeTime();
  1981 	r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
  1979 	r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
  1982 	file.Close();
  1980 	file.Close();
  1983 	User::WaitForRequest(reqStat);
  1981 	User::WaitForRequest(reqStat);
  1984 	test(reqStat==KErrNone);
  1982 	test_KErrNone(reqStat.Int());
  1985 
  1983 
  1986 //	RFs::SetDriveName()
  1984 //	RFs::SetDriveName()
  1987 	test.Next(_L("RFs::SetDriveName()"));
  1985 	test.Next(_L("RFs::SetDriveName()"));
  1988 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1986 	fs.NotifyChange(ENotifyAll,reqStat,path);
  1989 	test(reqStat==KRequestPending);
  1987 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  1990 	User::After(KNotifyChangeAfter);
  1988 	User::After(KNotifyChangeAfter);
  1991 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
  1989 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
  1992 	test_KErrNone(r);
  1990 	test_KErrNone(r);
  1993 	User::WaitForRequest(reqStat);
  1991 	User::WaitForRequest(reqStat);
  1994 	test(reqStat==KErrNone);
  1992 	test_KErrNone(reqStat.Int());
  1995 	fs.NotifyChange(ENotifyEntry,reqStat,path);
  1993 	fs.NotifyChange(ENotifyEntry,reqStat,path);
  1996 	User::After(KNotifyChangeAfter);
  1994 	User::After(KNotifyChangeAfter);
  1997 	r=TheFs.SetDriveName(KDefaultDrive,_L("TEST"));
  1995 	r=TheFs.SetDriveName(KDefaultDrive,_L("TEST"));
  1998 	test_KErrNone(r);
  1996 	test_KErrNone(r);
  1999 	test(reqStat==KRequestPending);
  1997 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2000 	fs.NotifyChangeCancel(reqStat);
  1998 	fs.NotifyChangeCancel(reqStat);
  2001 	User::WaitForRequest(reqStat);
  1999 	User::WaitForRequest(reqStat);
  2002 	test(reqStat==KErrCancel);
  2000 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  2003 	fs.NotifyChange(ENotifyDisk,reqStat,path);
  2001 	fs.NotifyChange(ENotifyDisk,reqStat,path);
  2004 	User::After(KNotifyChangeAfter);
  2002 	User::After(KNotifyChangeAfter);
  2005 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE"));
  2003 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE"));
  2006 	test_KErrNone(r);
  2004 	test_KErrNone(r);
  2007 	test(reqStat==KRequestPending);
  2005 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2008 	fs.NotifyChangeCancel(reqStat);
  2006 	fs.NotifyChangeCancel(reqStat);
  2009 	User::WaitForRequest(reqStat);
  2007 	User::WaitForRequest(reqStat);
  2010 	test(reqStat==KErrCancel);
  2008 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  2011 
  2009 
  2012 
  2010 
  2013 //	RFs::MkDir()
  2011 //	RFs::MkDir()
  2014 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2012 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2015 	test(reqStat==KRequestPending);
  2013 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2016 	test.Next(_L("RFs::MkDir()"));
  2014 	test.Next(_L("RFs::MkDir()"));
  2017 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
  2015 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
  2018 	test_KErrNone(r);
  2016 	test_KErrNone(r);
  2019 	User::WaitForRequest(reqStat);
  2017 	User::WaitForRequest(reqStat);
  2020 	test(reqStat==KErrNone);
  2018 	test_KErrNone(reqStat.Int());
  2021 
  2019 
  2022 //	RFs::RmDir()
  2020 //	RFs::RmDir()
  2023 	test.Next(_L("RFs::RmDir()"));
  2021 	test.Next(_L("RFs::RmDir()"));
  2024 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2022 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2025 	test(reqStat==KRequestPending);
  2023 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2026 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
  2024 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
  2027 	test_KErrNone(r);
  2025 	test_KErrNone(r);
  2028 	User::WaitForRequest(reqStat);
  2026 	User::WaitForRequest(reqStat);
  2029 	test(reqStat==KErrNone);
  2027 	test_KErrNone(reqStat.Int());
  2030 
  2028 
  2031 //	RFile::Create()
  2029 //	RFile::Create()
  2032 	test.Next(_L("RFile::Create()"));
  2030 	test.Next(_L("RFile::Create()"));
  2033 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2031 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2034 	test(reqStat==KRequestPending);
  2032 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2035 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
  2033 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
  2036 	test_KErrNone(r);
  2034 	test_KErrNone(r);
  2037 	User::WaitForRequest(reqStat);
  2035 	User::WaitForRequest(reqStat);
  2038 	test(reqStat==KErrNone);
  2036 	test_KErrNone(reqStat.Int());
  2039 	file.Close();
  2037 	file.Close();
  2040 
  2038 
  2041 //	RFs::Delete()
  2039 //	RFs::Delete()
  2042 	test.Next(_L("RFs::Delete()"));
  2040 	test.Next(_L("RFs::Delete()"));
  2043 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2041 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2044 	test(reqStat==KRequestPending);
  2042 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2045 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
  2043 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
  2046 	test_KErrNone(r);
  2044 	test_KErrNone(r);
  2047 	User::WaitForRequest(reqStat);
  2045 	User::WaitForRequest(reqStat);
  2048 	test(reqStat==KErrNone);
  2046 	test_KErrNone(reqStat.Int());
  2049 
  2047 
  2050 //	RFile::Replace()
  2048 //	RFile::Replace()
  2051 	test.Next(_L("RFile::Replace()"));
  2049 	test.Next(_L("RFile::Replace()"));
  2052 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2050 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2053 	test(reqStat==KRequestPending);
  2051 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2054 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
  2052 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
  2055 	test_KErrNone(r);
  2053 	test_KErrNone(r);
  2056 	User::WaitForRequest(reqStat);
  2054 	User::WaitForRequest(reqStat);
  2057 	test(reqStat==KErrNone);
  2055 	test_KErrNone(reqStat.Int());
  2058 	file.Close();
  2056 	file.Close();
  2059 
  2057 
  2060 //	RFs::Delete()
  2058 //	RFs::Delete()
  2061 	test.Next(_L("RFs::Delete()"));
  2059 	test.Next(_L("RFs::Delete()"));
  2062 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2060 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2063 	test(reqStat==KRequestPending);
  2061 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2064 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
  2062 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
  2065 	test_KErrNone(r);
  2063 	test_KErrNone(r);
  2066 	User::WaitForRequest(reqStat);
  2064 	User::WaitForRequest(reqStat);
  2067 	test(reqStat==KErrNone);
  2065 	test_KErrNone(reqStat.Int());
  2068 
  2066 
  2069 //	RFs::SetVolumeLabel() - should only be notification when monitoring relevant TNotifyTypes
  2067 //	RFs::SetVolumeLabel() - should only be notification when monitoring relevant TNotifyTypes
  2070 	test.Next(_L("RFs::SetVolumeLabel"));
  2068 	test.Next(_L("RFs::SetVolumeLabel"));
  2071 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2069 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2072 
  2070 
  2074 	TVolumeInfo volInfo;
  2072 	TVolumeInfo volInfo;
  2075 	TFileName currentVolName;
  2073 	TFileName currentVolName;
  2076 
  2074 
  2077 	r=TheFs.Volume(volInfo,driveNum);
  2075 	r=TheFs.Volume(volInfo,driveNum);
  2078 	test_KErrNone(r);
  2076 	test_KErrNone(r);
  2079 	test(reqStat==KRequestPending);
  2077 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2080 	currentVolName=volInfo.iName;
  2078 	currentVolName=volInfo.iName;
  2081 
  2079 
  2082 	r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
  2080 	r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
  2083 	if (r==KErrNone)
  2081 	if (r==KErrNone)
  2084 		{
  2082 		{
  2085 		User::WaitForRequest(reqStat);
  2083 		User::WaitForRequest(reqStat);
  2086 		test(reqStat==KErrNone);
  2084 		test_KErrNone(reqStat.Int());
  2087 		r=TheFs.Volume(volInfo,driveNum);
  2085 		r=TheFs.Volume(volInfo,driveNum);
  2088 		test_KErrNone(r);
  2086 		test_KErrNone(r);
  2089 		test(volInfo.iName==_L("VOL"));
  2087 		test(volInfo.iName==_L("VOL"));
  2090 	//	Test notification occurs under ENotifyDisk
  2088 	//	Test notification occurs under ENotifyDisk
  2091 		fs.NotifyChange(ENotifyDisk,reqStat,path);
  2089 		fs.NotifyChange(ENotifyDisk,reqStat,path);
  2092 		test(reqStat==KRequestPending);
  2090 		test_Value(reqStat.Int(), reqStat==KRequestPending);
  2093 		r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum);
  2091 		r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum);
  2094 		test_KErrNone(r);
  2092 		test_KErrNone(r);
  2095 		User::WaitForRequest(reqStat);
  2093 		User::WaitForRequest(reqStat);
  2096 		test(reqStat==KErrNone);
  2094 		test_KErrNone(reqStat.Int());
  2097 		r=TheFs.Volume(volInfo,driveNum);
  2095 		r=TheFs.Volume(volInfo,driveNum);
  2098 		test_KErrNone(r);
  2096 		test_KErrNone(r);
  2099 
  2097 
  2100 		test(volInfo.iName==_L("ABCDEFGHIJK"));
  2098 		test(volInfo.iName==_L("ABCDEFGHIJK"));
  2101 
  2099 
  2102 	//	Test notification does not occur under ENotifyAttributes
  2100 	//	Test notification does not occur under ENotifyAttributes
  2103 		fs.NotifyChange(ENotifyAttributes,reqStat,path);
  2101 		fs.NotifyChange(ENotifyAttributes,reqStat,path);
  2104 		r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum);
  2102 		r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum);
  2105 		test_KErrNone(r);
  2103 		test_KErrNone(r);
  2106 		test(reqStat==KRequestPending);
  2104 		test_Value(reqStat.Int(), reqStat==KRequestPending);
  2107 		r=TheFs.Volume(volInfo,driveNum);
  2105 		r=TheFs.Volume(volInfo,driveNum);
  2108 		test_KErrNone(r);
  2106 		test_KErrNone(r);
  2109 
  2107 
  2110 		test(volInfo.iName==_L("TROPICANA"));
  2108 		test(volInfo.iName==_L("TROPICANA"));
  2111 
  2109 
  2112 		fs.NotifyChangeCancel(reqStat);
  2110 		fs.NotifyChangeCancel(reqStat);
  2113 		User::WaitForRequest(reqStat);
  2111 		User::WaitForRequest(reqStat);
  2114 		test(reqStat==KErrCancel);
  2112 		test_Value(reqStat.Int(), reqStat==KErrCancel);
  2115 	//	Test notification occurs under ENotifyEntry
  2113 	//	Test notification occurs under ENotifyEntry
  2116 		fs.NotifyChange(ENotifyEntry,reqStat,path);
  2114 		fs.NotifyChange(ENotifyEntry,reqStat,path);
  2117 		test(reqStat==KRequestPending);
  2115 		test_Value(reqStat.Int(), reqStat==KRequestPending);
  2118 		r=TheFs.SetVolumeLabel(currentVolName,driveNum);
  2116 		r=TheFs.SetVolumeLabel(currentVolName,driveNum);
  2119 		test_KErrNone(r);
  2117 		test_KErrNone(r);
  2120 		User::WaitForRequest(reqStat);
  2118 		User::WaitForRequest(reqStat);
  2121 		test(reqStat==KErrNone);
  2119 		test_KErrNone(reqStat.Int());
  2122 		r=TheFs.Volume(volInfo,driveNum);
  2120 		r=TheFs.Volume(volInfo,driveNum);
  2123 		test_KErrNone(r);
  2121 		test_KErrNone(r);
  2124 		test(volInfo.iName==currentVolName);
  2122 		test(volInfo.iName==currentVolName);
  2125 		}
  2123 		}
  2126 
  2124 
  2134 
  2132 
  2135 //	RFs::Rename()
  2133 //	RFs::Rename()
  2136 
  2134 
  2137 	test.Next(_L("RFs::Rename()"));
  2135 	test.Next(_L("RFs::Rename()"));
  2138 	fs.NotifyChange(ENotifyEntry,reqStat,path);
  2136 	fs.NotifyChange(ENotifyEntry,reqStat,path);
  2139 	test(reqStat==KRequestPending);
  2137 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2140 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Toto.doc"));
  2138 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Toto.doc"));
  2141 	test_KErrNone(r);
  2139 	test_KErrNone(r);
  2142 	User::WaitForRequest(reqStat);
  2140 	User::WaitForRequest(reqStat);
  2143 	test(reqStat==KErrNone);
  2141 	test_KErrNone(reqStat.Int());
  2144 
  2142 
  2145 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Toto.doc"),_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"));
  2143 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Toto.doc"),_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"));
  2146 	test_KErrNone(r);
  2144 	test_KErrNone(r);
  2147 
  2145 
  2148 #if defined(__WINS__)
  2146 	if(!Is_SimulatedSystemDrive(TheFs,driveNum))
  2149 	if(gSessionPath[0]=='Y'||gSessionPath[0]=='X')
  2147 		{// Skip emulator/PlatSim drive C:
  2150 #endif
       
  2151 		{
       
  2152 		test.Next(_L("RFs::Rename() with max path length"));
  2148 		test.Next(_L("RFs::Rename() with max path length"));
  2153 		TFileName longName=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
  2149 		TFileName longName=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
  2154 		while(longName.Length()<(KMaxFileName-2))
  2150 		while(longName.Length()<(KMaxFileName-2))
  2155 			longName+=_L("a");
  2151 			longName+=_L("a");
  2156 		r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),longName);
  2152 		r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),longName);
  2157 		test_KErrNone(r);
  2153 		test_KErrNone(r);
  2158 		fs.NotifyChange(ENotifyEntry,reqStat,longName);
  2154 		fs.NotifyChange(ENotifyEntry,reqStat,longName);
  2159 		test(reqStat==KRequestPending);
  2155 		test_Value(reqStat.Int(), reqStat==KRequestPending);
  2160 		r=TheFs.Rename(longName,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"));
  2156 		r=TheFs.Rename(longName,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"));
  2161 		test_KErrNone(r);
  2157 		test_KErrNone(r);
  2162 		User::WaitForRequest(reqStat);
  2158 		User::WaitForRequest(reqStat);
  2163 		test(reqStat==KErrNone);
  2159 		test_KErrNone(reqStat.Int());
  2164 		}
  2160 		}
  2165 
  2161 
  2166 	fs.Close();
  2162 	fs.Close();
  2167 	}
  2163 	}
  2168 
  2164 
  2187 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2183 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2188 
  2184 
  2189 	RFile file;
  2185 	RFile file;
  2190 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2186 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2191 	test_KErrNone(r);
  2187 	test_KErrNone(r);
  2192 	test(reqStat==KRequestPending);
  2188 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2193 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
  2189 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
  2194 	file.Close();
  2190 	file.Close();
  2195 	User::WaitForRequest(reqStat);
  2191 	User::WaitForRequest(reqStat);
  2196 	test(reqStat==KErrNone);
  2192 	test_KErrNone(reqStat.Int());
  2197 
  2193 
  2198 //	RFile::Read() a file within the monitored directory - no notification for reads
  2194 //	RFile::Read() a file within the monitored directory - no notification for reads
  2199 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2195 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2200 	TBuf8<100> temp;
  2196 	TBuf8<100> temp;
  2201 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2197 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2202 	test_KErrNone(r);
  2198 	test_KErrNone(r);
  2203 	test(reqStat==KRequestPending);
  2199 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2204 	r=file.Read(0,temp,100);
  2200 	r=file.Read(0,temp,100);
  2205 	test(reqStat==KRequestPending);
  2201 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2206 
  2202 
  2207 //	RFile::SetAtt() of a file within the monitored directory
  2203 //	RFile::SetAtt() of a file within the monitored directory
  2208 	test.Next(_L("RFile::SetAtt()"));
  2204 	test.Next(_L("RFile::SetAtt()"));
  2209 	r=file.SetAtt(KEntryAttNormal,KEntryAttHidden);
  2205 	r=file.SetAtt(KEntryAttNormal,KEntryAttHidden);
  2210 	test_KErrNone(r);
  2206 	test_KErrNone(r);
  2211 	User::WaitForRequest(reqStat);
  2207 	User::WaitForRequest(reqStat);
  2212 	test(reqStat==KErrNone);
  2208 	test_KErrNone(reqStat.Int());
  2213 
  2209 
  2214 //	RFile::SetSize() of a file within the monitored directory
  2210 //	RFile::SetSize() of a file within the monitored directory
  2215 	test.Next(_L("RFile::SetSize()"));
  2211 	test.Next(_L("RFile::SetSize()"));
  2216 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2212 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2217 	test(reqStat==KRequestPending);
  2213 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2218 	r=file.SetSize(256);
  2214 	r=file.SetSize(256);
  2219 	test_KErrNone(r);
  2215 	test_KErrNone(r);
  2220 	User::WaitForRequest(reqStat);
  2216 	User::WaitForRequest(reqStat);
  2221 	test(reqStat==KErrNone);
  2217 	test_KErrNone(reqStat.Int());
  2222 	file.Close();
  2218 	file.Close();
  2223 
  2219 
  2224 //	RFile::Temp() to create a temp file in the subtree
  2220 //	RFile::Temp() to create a temp file in the subtree
  2225 	test.Next(_L("RFile::Temp()"));
  2221 	test.Next(_L("RFile::Temp()"));
  2226 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2222 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2227 	test(reqStat==KRequestPending);
  2223 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2228 	TFileName fileName;
  2224 	TFileName fileName;
  2229 	r=file.Temp(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"),fileName,EFileWrite);
  2225 	r=file.Temp(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"),fileName,EFileWrite);
  2230 	test_KErrNone(r);
  2226 	test_KErrNone(r);
  2231 	User::WaitForRequest(reqStat);
  2227 	User::WaitForRequest(reqStat);
  2232 	test(reqStat==KErrNone);
  2228 	test_KErrNone(reqStat.Int());
  2233 	file.Close();
  2229 	file.Close();
  2234 
  2230 
  2235 //	RFile::SetModified() to change modification time of a file within monitored dir
  2231 //	RFile::SetModified() to change modification time of a file within monitored dir
  2236 	test.Next(_L("RFile::SetModified()"));
  2232 	test.Next(_L("RFile::SetModified()"));
  2237 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2233 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2238 	TTime now;
  2234 	TTime now;
  2239 	now.HomeTime();
  2235 	now.HomeTime();
  2240 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2236 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2241 	test_KErrNone(r);
  2237 	test_KErrNone(r);
  2242 	test(reqStat==KRequestPending);
  2238 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2243 	file.SetModified(now);
  2239 	file.SetModified(now);
  2244 	file.Close();
  2240 	file.Close();
  2245 	User::WaitForRequest(reqStat);
  2241 	User::WaitForRequest(reqStat);
  2246 	test(reqStat==KErrNone);
  2242 	test_KErrNone(reqStat.Int());
  2247 
  2243 
  2248 //	RFs::Entry() to change a directory entry within the monitored directory
  2244 //	RFs::Entry() to change a directory entry within the monitored directory
  2249 	test.Next(_L("RFs::Entry()"));
  2245 	test.Next(_L("RFs::Entry()"));
  2250 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2246 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2251 	TEntry entry;
  2247 	TEntry entry;
  2252 	r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry);
  2248 	r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry);
  2253 	test(reqStat==KRequestPending);
  2249 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2254 	now.HomeTime();
  2250 	now.HomeTime();
  2255 	r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal);
  2251 	r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal);
  2256 	test_KErrNone(r);
  2252 	test_KErrNone(r);
  2257 	User::WaitForRequest(reqStat);
  2253 	User::WaitForRequest(reqStat);
  2258 	test(reqStat==KErrNone);
  2254 	test_KErrNone(reqStat.Int());
  2259 
  2255 
  2260 //	RFile::Set() to change file's modification time and attributes
  2256 //	RFile::Set() to change file's modification time and attributes
  2261 	test.Next(_L("RFile::Set()"));
  2257 	test.Next(_L("RFile::Set()"));
  2262 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2258 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2263 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2259 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2264 	test_KErrNone(r);
  2260 	test_KErrNone(r);
  2265 	test(reqStat==KRequestPending);
  2261 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2266 	now.HomeTime();
  2262 	now.HomeTime();
  2267 	r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
  2263 	r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
  2268 	file.Close();
  2264 	file.Close();
  2269 	User::WaitForRequest(reqStat);
  2265 	User::WaitForRequest(reqStat);
  2270 	test(reqStat==KErrNone);
  2266 	test_KErrNone(reqStat.Int());
  2271 
  2267 
  2272 //	RFs::SetDriveName()
  2268 //	RFs::SetDriveName()
  2273 	test.Next(_L("RFs::SetDriveName()"));
  2269 	test.Next(_L("RFs::SetDriveName()"));
  2274 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2270 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2275 	test(reqStat==KRequestPending);
  2271 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2276 	User::After(KNotifyChangeAfter);
  2272 	User::After(KNotifyChangeAfter);
  2277 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
  2273 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
  2278 	test_KErrNone(r);
  2274 	test_KErrNone(r);
  2279 	User::WaitForRequest(reqStat);
  2275 	User::WaitForRequest(reqStat);
  2280 	test(reqStat==KErrNone);
  2276 	test_KErrNone(reqStat.Int());
  2281 	fs.NotifyChange(ENotifyEntry,reqStat,path);
  2277 	fs.NotifyChange(ENotifyEntry,reqStat,path);
  2282 	r=TheFs.SetDriveName(KDefaultDrive,_L("TEST"));
  2278 	r=TheFs.SetDriveName(KDefaultDrive,_L("TEST"));
  2283 	test_KErrNone(r);
  2279 	test_KErrNone(r);
  2284 	test(reqStat==KRequestPending);
  2280 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2285 	User::After(KNotifyChangeAfter);
  2281 	User::After(KNotifyChangeAfter);
  2286 	fs.NotifyChangeCancel(reqStat);
  2282 	fs.NotifyChangeCancel(reqStat);
  2287 	User::WaitForRequest(reqStat);
  2283 	User::WaitForRequest(reqStat);
  2288 	test(reqStat==KErrCancel);
  2284 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  2289 	fs.NotifyChange(ENotifyDisk,reqStat,path);
  2285 	fs.NotifyChange(ENotifyDisk,reqStat,path);
  2290 	User::After(KNotifyChangeAfter);
  2286 	User::After(KNotifyChangeAfter);
  2291 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE"));
  2287 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE"));
  2292 	test_KErrNone(r);
  2288 	test_KErrNone(r);
  2293 	test(reqStat==KRequestPending);
  2289 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2294 	fs.NotifyChangeCancel(reqStat);
  2290 	fs.NotifyChangeCancel(reqStat);
  2295 	User::WaitForRequest(reqStat);
  2291 	User::WaitForRequest(reqStat);
  2296 	test(reqStat==KErrCancel);
  2292 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  2297 
  2293 
  2298 //	RFs::MkDir()
  2294 //	RFs::MkDir()
  2299 	test.Next(_L("RFs::MkDir()"));
  2295 	test.Next(_L("RFs::MkDir()"));
  2300 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2296 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2301 	test(reqStat==KRequestPending);
  2297 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2302 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
  2298 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
  2303 	test_KErrNone(r);
  2299 	test_KErrNone(r);
  2304 	User::WaitForRequest(reqStat);
  2300 	User::WaitForRequest(reqStat);
  2305 	test(reqStat==KErrNone);
  2301 	test_KErrNone(reqStat.Int());
  2306 
  2302 
  2307 //	RFs::RmDir()
  2303 //	RFs::RmDir()
  2308 	test.Next(_L("RFs::RmDir()"));
  2304 	test.Next(_L("RFs::RmDir()"));
  2309 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2305 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2310 	test(reqStat==KRequestPending);
  2306 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2311 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
  2307 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
  2312 	test_KErrNone(r);
  2308 	test_KErrNone(r);
  2313 	User::WaitForRequest(reqStat);
  2309 	User::WaitForRequest(reqStat);
  2314 	test(reqStat==KErrNone);
  2310 	test_KErrNone(reqStat.Int());
  2315 
  2311 
  2316 //	RFile::Create()
  2312 //	RFile::Create()
  2317 	test.Next(_L("RFile::Create()"));
  2313 	test.Next(_L("RFile::Create()"));
  2318 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2314 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2319 	test(reqStat==KRequestPending);
  2315 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2320 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
  2316 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
  2321 	test_KErrNone(r);
  2317 	test_KErrNone(r);
  2322 	User::WaitForRequest(reqStat);
  2318 	User::WaitForRequest(reqStat);
  2323 	test(reqStat==KErrNone);
  2319 	test_KErrNone(reqStat.Int());
  2324 	file.Close();
  2320 	file.Close();
  2325 
  2321 
  2326 //	RFs::Delete()
  2322 //	RFs::Delete()
  2327 	test.Next(_L("RFs::Delete()"));
  2323 	test.Next(_L("RFs::Delete()"));
  2328 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2324 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2329 	test(reqStat==KRequestPending);
  2325 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2330 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
  2326 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
  2331 	test_KErrNone(r);
  2327 	test_KErrNone(r);
  2332 	User::WaitForRequest(reqStat);
  2328 	User::WaitForRequest(reqStat);
  2333 	test(reqStat==KErrNone);
  2329 	test_KErrNone(reqStat.Int());
  2334 
  2330 
  2335 //	RFile::Replace()
  2331 //	RFile::Replace()
  2336 	test.Next(_L("RFile::Replace()"));
  2332 	test.Next(_L("RFile::Replace()"));
  2337 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2333 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2338 	test(reqStat==KRequestPending);
  2334 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2339 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
  2335 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
  2340 	test_KErrNone(r);
  2336 	test_KErrNone(r);
  2341 	User::WaitForRequest(reqStat);
  2337 	User::WaitForRequest(reqStat);
  2342 	test(reqStat==KErrNone);
  2338 	test_KErrNone(reqStat.Int());
  2343 	file.Close();
  2339 	file.Close();
  2344 
  2340 
  2345 //	RFs::Delete()
  2341 //	RFs::Delete()
  2346 	test.Next(_L("RFs::Delete()"));
  2342 	test.Next(_L("RFs::Delete()"));
  2347 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2343 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2348 	test(reqStat==KRequestPending);
  2344 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2349 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
  2345 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
  2350 	test_KErrNone(r);
  2346 	test_KErrNone(r);
  2351 	User::WaitForRequest(reqStat);
  2347 	User::WaitForRequest(reqStat);
  2352 	test(reqStat==KErrNone);
  2348 	test_KErrNone(reqStat.Int());
  2353 
  2349 
  2354 //	RFs::SetVolumeLabel() - should be notification under relevant TNotifyType monitoring
  2350 //	RFs::SetVolumeLabel() - should be notification under relevant TNotifyType monitoring
  2355 //	The operation is non-path specific so all outstanding interested requests are notified
  2351 //	The operation is non-path specific so all outstanding interested requests are notified
  2356 	test.Next(_L("RFs::SetVolumeLabel()"));
  2352 	test.Next(_L("RFs::SetVolumeLabel()"));
  2357 
  2353 
  2360 	TInt driveNum=CurrentDrive();
  2356 	TInt driveNum=CurrentDrive();
  2361 	TVolumeInfo volInfo;
  2357 	TVolumeInfo volInfo;
  2362 	TFileName currentVolName;
  2358 	TFileName currentVolName;
  2363 	r=TheFs.Volume(volInfo,driveNum);
  2359 	r=TheFs.Volume(volInfo,driveNum);
  2364 	test_KErrNone(r);
  2360 	test_KErrNone(r);
  2365 	test(reqStat==KRequestPending);
  2361 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2366 	currentVolName=volInfo.iName;
  2362 	currentVolName=volInfo.iName;
  2367 
  2363 
  2368 	r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
  2364 	r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
  2369 	if (r==KErrNone)
  2365 	if (r==KErrNone)
  2370 		{
  2366 		{
  2371 		User::WaitForRequest(reqStat);
  2367 		User::WaitForRequest(reqStat);
  2372 		test(reqStat==KErrNone);
  2368 		test_KErrNone(reqStat.Int());
  2373 		r=TheFs.Volume(volInfo,driveNum);
  2369 		r=TheFs.Volume(volInfo,driveNum);
  2374 		test_KErrNone(r);
  2370 		test_KErrNone(r);
  2375 		test(volInfo.iName==_L("VOL"));
  2371 		test(volInfo.iName==_L("VOL"));
  2376 	//	Test notification occurs under ENotifyDisk
  2372 	//	Test notification occurs under ENotifyDisk
  2377 		fs.NotifyChange(ENotifyDisk,reqStat,path);
  2373 		fs.NotifyChange(ENotifyDisk,reqStat,path);
  2378 		test(reqStat==KRequestPending);
  2374 		test_Value(reqStat.Int(), reqStat==KRequestPending);
  2379 		r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum);
  2375 		r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum);
  2380 		test_KErrNone(r);
  2376 		test_KErrNone(r);
  2381 		User::WaitForRequest(reqStat);
  2377 		User::WaitForRequest(reqStat);
  2382 		test(reqStat==KErrNone);
  2378 		test_KErrNone(reqStat.Int());
  2383 		r=TheFs.Volume(volInfo,driveNum);
  2379 		r=TheFs.Volume(volInfo,driveNum);
  2384 		test_KErrNone(r);
  2380 		test_KErrNone(r);
  2385 
  2381 
  2386 		test(volInfo.iName==_L("ABCDEFGHIJK"));
  2382 		test(volInfo.iName==_L("ABCDEFGHIJK"));
  2387 
  2383 
  2388 	//	Test notification does not occur under ENotifyAttributes
  2384 	//	Test notification does not occur under ENotifyAttributes
  2389 		fs.NotifyChange(ENotifyAttributes,reqStat,path);
  2385 		fs.NotifyChange(ENotifyAttributes,reqStat,path);
  2390 		r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum);
  2386 		r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum);
  2391 		test_KErrNone(r);
  2387 		test_KErrNone(r);
  2392 		test(reqStat==KRequestPending);
  2388 		test_Value(reqStat.Int(), reqStat==KRequestPending);
  2393 		r=TheFs.Volume(volInfo,driveNum);
  2389 		r=TheFs.Volume(volInfo,driveNum);
  2394 		test_KErrNone(r);
  2390 		test_KErrNone(r);
  2395 
  2391 
  2396 		test(volInfo.iName==_L("TROPICANA"));
  2392 		test(volInfo.iName==_L("TROPICANA"));
  2397 
  2393 
  2398 		fs.NotifyChangeCancel(reqStat);
  2394 		fs.NotifyChangeCancel(reqStat);
  2399 		User::WaitForRequest(reqStat);
  2395 		User::WaitForRequest(reqStat);
  2400 		test(reqStat==KErrCancel);
  2396 		test_Value(reqStat.Int(), reqStat==KErrCancel);
  2401 	//	Test notification occurs under ENotifyEntry
  2397 	//	Test notification occurs under ENotifyEntry
  2402 		fs.NotifyChange(ENotifyEntry,reqStat,path);
  2398 		fs.NotifyChange(ENotifyEntry,reqStat,path);
  2403 		test(reqStat==KRequestPending);
  2399 		test_Value(reqStat.Int(), reqStat==KRequestPending);
  2404 		r=TheFs.SetVolumeLabel(currentVolName,driveNum);
  2400 		r=TheFs.SetVolumeLabel(currentVolName,driveNum);
  2405 		test_KErrNone(r);
  2401 		test_KErrNone(r);
  2406 		User::WaitForRequest(reqStat);
  2402 		User::WaitForRequest(reqStat);
  2407 		test(reqStat==KErrNone);
  2403 		test_KErrNone(reqStat.Int());
  2408 		r=TheFs.Volume(volInfo,driveNum);
  2404 		r=TheFs.Volume(volInfo,driveNum);
  2409 		test_KErrNone(r);
  2405 		test_KErrNone(r);
  2410 		test(volInfo.iName==currentVolName);
  2406 		test(volInfo.iName==currentVolName);
  2411 		}
  2407 		}
  2412 
  2408 
  2419 
  2415 
  2420 
  2416 
  2421 
  2417 
  2422 //	Test that notification is made when change is made to monitored directory
  2418 //	Test that notification is made when change is made to monitored directory
  2423 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2419 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2424 	test(reqStat==KRequestPending);
  2420 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2425 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
  2421 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
  2426 	test_KErrNone(r);
  2422 	test_KErrNone(r);
  2427 	User::WaitForRequest(reqStat);
  2423 	User::WaitForRequest(reqStat);
  2428 	test(reqStat==KErrNone);
  2424 	test_KErrNone(reqStat.Int());
  2429 
  2425 
  2430 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2426 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2431 	test(reqStat==KRequestPending);
  2427 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2432 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
  2428 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
  2433 	test_KErrNone(r);
  2429 	test_KErrNone(r);
  2434 	User::WaitForRequest(reqStat);
  2430 	User::WaitForRequest(reqStat);
  2435 	test(reqStat==KErrNone);
  2431 	test_KErrNone(reqStat.Int());
  2436 	fs.Close();
  2432 	fs.Close();
  2437 	}
  2433 	}
  2438 
  2434 
  2439 
  2435 
  2440 static void Test16()
  2436 static void Test16()
  2456 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2452 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2457 
  2453 
  2458 	RFile file;
  2454 	RFile file;
  2459 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2455 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2460 	test_KErrNone(r);
  2456 	test_KErrNone(r);
  2461 	test(reqStat==KRequestPending);
  2457 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2462 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
  2458 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
  2463 	file.Close();
  2459 	file.Close();
  2464 	User::WaitForRequest(reqStat);
  2460 	User::WaitForRequest(reqStat);
  2465 	test(reqStat==KErrNone);
  2461 	test_KErrNone(reqStat.Int());
  2466 
  2462 
  2467 //	RFile::Read() a file within the monitored directory - no notification for reads
  2463 //	RFile::Read() a file within the monitored directory - no notification for reads
  2468 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2464 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2469 	TBuf8<100> temp;
  2465 	TBuf8<100> temp;
  2470 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2466 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2471 	test_KErrNone(r);
  2467 	test_KErrNone(r);
  2472 	test(reqStat==KRequestPending);
  2468 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2473 	r=file.Read(0,temp,100);
  2469 	r=file.Read(0,temp,100);
  2474 	test(reqStat==KRequestPending);
  2470 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2475 
  2471 
  2476 //	RFile::SetAtt() of a file within the monitored directory
  2472 //	RFile::SetAtt() of a file within the monitored directory
  2477 	r=file.SetAtt(KEntryAttNormal,KEntryAttHidden);
  2473 	r=file.SetAtt(KEntryAttNormal,KEntryAttHidden);
  2478 	test_KErrNone(r);
  2474 	test_KErrNone(r);
  2479 	User::WaitForRequest(reqStat);
  2475 	User::WaitForRequest(reqStat);
  2480 	test(reqStat==KErrNone);
  2476 	test_KErrNone(reqStat.Int());
  2481 
  2477 
  2482 //	RFile::SetSize() of a file within the monitored directory
  2478 //	RFile::SetSize() of a file within the monitored directory
  2483 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2479 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2484 	test(reqStat==KRequestPending);
  2480 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2485 	r=file.SetSize(256);
  2481 	r=file.SetSize(256);
  2486 	test_KErrNone(r);
  2482 	test_KErrNone(r);
  2487 	User::WaitForRequest(reqStat);
  2483 	User::WaitForRequest(reqStat);
  2488 	test(reqStat==KErrNone);
  2484 	test_KErrNone(reqStat.Int());
  2489 	file.Close();
  2485 	file.Close();
  2490 
  2486 
  2491 
  2487 
  2492 //	RFile::SetModified() to change modification time of a file within monitored dir
  2488 //	RFile::SetModified() to change modification time of a file within monitored dir
  2493 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2489 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2494 	TTime now;
  2490 	TTime now;
  2495 	now.HomeTime();
  2491 	now.HomeTime();
  2496 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2492 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2497 	test_KErrNone(r);
  2493 	test_KErrNone(r);
  2498 	test(reqStat==KRequestPending);
  2494 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2499 	file.SetModified(now);
  2495 	file.SetModified(now);
  2500 	file.Close();
  2496 	file.Close();
  2501 	User::WaitForRequest(reqStat);
  2497 	User::WaitForRequest(reqStat);
  2502 	test(reqStat==KErrNone);
  2498 	test_KErrNone(reqStat.Int());
  2503 
  2499 
  2504 //	RFs::Entry() to change a directory entry within the monitored directory
  2500 //	RFs::Entry() to change a directory entry within the monitored directory
  2505 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2501 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2506 	TEntry entry;
  2502 	TEntry entry;
  2507 	r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry);
  2503 	r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry);
  2508 	test(reqStat==KRequestPending);
  2504 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2509 	now.HomeTime();
  2505 	now.HomeTime();
  2510 	r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal);
  2506 	r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal);
  2511 	test_KErrNone(r);
  2507 	test_KErrNone(r);
  2512 	User::WaitForRequest(reqStat);
  2508 	User::WaitForRequest(reqStat);
  2513 	test(reqStat==KErrNone);
  2509 	test_KErrNone(reqStat.Int());
  2514 
  2510 
  2515 //	RFile::Set() to change file's modification time and attributes
  2511 //	RFile::Set() to change file's modification time and attributes
  2516 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2512 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2517 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2513 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
  2518 	test_KErrNone(r);
  2514 	test_KErrNone(r);
  2519 	test(reqStat==KRequestPending);
  2515 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2520 	now.HomeTime();
  2516 	now.HomeTime();
  2521 	r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
  2517 	r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
  2522 	file.Close();
  2518 	file.Close();
  2523 	User::WaitForRequest(reqStat);
  2519 	User::WaitForRequest(reqStat);
  2524 	test(reqStat==KErrNone);
  2520 	test_KErrNone(reqStat.Int());
  2525 
  2521 
  2526 //	RFs::SetDriveName() - should be no notification ever with extended notification
  2522 //	RFs::SetDriveName() - should be no notification ever with extended notification
  2527 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2523 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2528 	test(reqStat==KRequestPending);
  2524 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2529 	User::After(KNotifyChangeAfter);
  2525 	User::After(KNotifyChangeAfter);
  2530 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
  2526 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
  2531 	test_KErrNone(r);
  2527 	test_KErrNone(r);
  2532 	User::WaitForRequest(reqStat);
  2528 	User::WaitForRequest(reqStat);
  2533 	test(reqStat==KErrNone);
  2529 	test_KErrNone(reqStat.Int());
  2534 	fs.NotifyChange(ENotifyEntry,reqStat,path);
  2530 	fs.NotifyChange(ENotifyEntry,reqStat,path);
  2535 	User::After(KNotifyChangeAfter);
  2531 	User::After(KNotifyChangeAfter);
  2536 	r=TheFs.SetDriveName(KDefaultDrive,_L("TEST"));
  2532 	r=TheFs.SetDriveName(KDefaultDrive,_L("TEST"));
  2537 	test_KErrNone(r);
  2533 	test_KErrNone(r);
  2538 	test(reqStat==KRequestPending);
  2534 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2539 	fs.NotifyChangeCancel(reqStat);
  2535 	fs.NotifyChangeCancel(reqStat);
  2540 	User::WaitForRequest(reqStat);
  2536 	User::WaitForRequest(reqStat);
  2541 	fs.NotifyChange(ENotifyDisk,reqStat,path);
  2537 	fs.NotifyChange(ENotifyDisk,reqStat,path);
  2542 	User::After(KNotifyChangeAfter);
  2538 	User::After(KNotifyChangeAfter);
  2543 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE"));
  2539 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE"));
  2544 	test_KErrNone(r);
  2540 	test_KErrNone(r);
  2545 	test(reqStat==KRequestPending);
  2541 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2546 	fs.NotifyChangeCancel(reqStat);
  2542 	fs.NotifyChangeCancel(reqStat);
  2547 	User::WaitForRequest(reqStat);
  2543 	User::WaitForRequest(reqStat);
  2548 	test(reqStat==KErrCancel);
  2544 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  2549 
  2545 
  2550 
  2546 
  2551 //	RFs::MkDir()
  2547 //	RFs::MkDir()
  2552 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2548 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2553 	test(reqStat==KRequestPending);
  2549 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2554 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
  2550 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
  2555 	test_KErrNone(r);
  2551 	test_KErrNone(r);
  2556 	User::WaitForRequest(reqStat);
  2552 	User::WaitForRequest(reqStat);
  2557 	test(reqStat==KErrNone);
  2553 	test_KErrNone(reqStat.Int());
  2558 
  2554 
  2559 //	RFs::RmDir()
  2555 //	RFs::RmDir()
  2560 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2556 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2561 	test(reqStat==KRequestPending);
  2557 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2562 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
  2558 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
  2563 	test_KErrNone(r);
  2559 	test_KErrNone(r);
  2564 	User::WaitForRequest(reqStat);
  2560 	User::WaitForRequest(reqStat);
  2565 	test(reqStat==KErrNone);
  2561 	test_KErrNone(reqStat.Int());
  2566 
  2562 
  2567 //	RFile::Create()
  2563 //	RFile::Create()
  2568 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2564 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2569 	test(reqStat==KRequestPending);
  2565 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2570 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
  2566 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
  2571 	test_KErrNone(r);
  2567 	test_KErrNone(r);
  2572 	User::WaitForRequest(reqStat);
  2568 	User::WaitForRequest(reqStat);
  2573 	test(reqStat==KErrNone);
  2569 	test_KErrNone(reqStat.Int());
  2574 	file.Close();
  2570 	file.Close();
  2575 
  2571 
  2576 //	RFs::Delete()
  2572 //	RFs::Delete()
  2577 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2573 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2578 	test(reqStat==KRequestPending);
  2574 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2579 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
  2575 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
  2580 	test_KErrNone(r);
  2576 	test_KErrNone(r);
  2581 	User::WaitForRequest(reqStat);
  2577 	User::WaitForRequest(reqStat);
  2582 	test(reqStat==KErrNone);
  2578 	test_KErrNone(reqStat.Int());
  2583 
  2579 
  2584 //	RFile::Replace()
  2580 //	RFile::Replace()
  2585 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2581 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2586 	test(reqStat==KRequestPending);
  2582 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2587 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
  2583 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
  2588 	test_KErrNone(r);
  2584 	test_KErrNone(r);
  2589 	User::WaitForRequest(reqStat);
  2585 	User::WaitForRequest(reqStat);
  2590 	test(reqStat==KErrNone);
  2586 	test_KErrNone(reqStat.Int());
  2591 	file.Close();
  2587 	file.Close();
  2592 
  2588 
  2593 //	RFs::Delete()
  2589 //	RFs::Delete()
  2594 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2590 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2595 	test(reqStat==KRequestPending);
  2591 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2596 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
  2592 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
  2597 	test_KErrNone(r);
  2593 	test_KErrNone(r);
  2598 	User::WaitForRequest(reqStat);
  2594 	User::WaitForRequest(reqStat);
  2599 	test(reqStat==KErrNone);
  2595 	test_KErrNone(reqStat.Int());
  2600 
  2596 
  2601 //	RFs::SetVolumeLabel()
  2597 //	RFs::SetVolumeLabel()
  2602 //	Not path specific, so all outstanding requests of correct TNotifyType are notified
  2598 //	Not path specific, so all outstanding requests of correct TNotifyType are notified
  2603 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2599 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2604 	TInt driveNum=CurrentDrive();
  2600 	TInt driveNum=CurrentDrive();
  2605 	TVolumeInfo volInfo;
  2601 	TVolumeInfo volInfo;
  2606 	TFileName currentVolName;
  2602 	TFileName currentVolName;
  2607 	r=TheFs.Volume(volInfo,driveNum);
  2603 	r=TheFs.Volume(volInfo,driveNum);
  2608 	test_KErrNone(r);
  2604 	test_KErrNone(r);
  2609 	test(reqStat==KRequestPending);
  2605 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2610 	currentVolName=volInfo.iName;
  2606 	currentVolName=volInfo.iName;
  2611 
  2607 
  2612 	r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
  2608 	r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
  2613 	if (r==KErrNone)
  2609 	if (r==KErrNone)
  2614 		{
  2610 		{
  2615 		User::WaitForRequest(reqStat);
  2611 		User::WaitForRequest(reqStat);
  2616 		test(reqStat==KErrNone);
  2612 		test_KErrNone(reqStat.Int());
  2617 		r=TheFs.Volume(volInfo,driveNum);
  2613 		r=TheFs.Volume(volInfo,driveNum);
  2618 		test_KErrNone(r);
  2614 		test_KErrNone(r);
  2619 		test(volInfo.iName==_L("VOL"));
  2615 		test(volInfo.iName==_L("VOL"));
  2620 	//	Test notification occurs under ENotifyDisk
  2616 	//	Test notification occurs under ENotifyDisk
  2621 		fs.NotifyChange(ENotifyDisk,reqStat,path);
  2617 		fs.NotifyChange(ENotifyDisk,reqStat,path);
  2622 		test(reqStat==KRequestPending);
  2618 		test_Value(reqStat.Int(), reqStat==KRequestPending);
  2623 		r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum);
  2619 		r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum);
  2624 		test_KErrNone(r);
  2620 		test_KErrNone(r);
  2625 		User::WaitForRequest(reqStat);
  2621 		User::WaitForRequest(reqStat);
  2626 		test(reqStat==KErrNone);
  2622 		test_KErrNone(reqStat.Int());
  2627 		r=TheFs.Volume(volInfo,driveNum);
  2623 		r=TheFs.Volume(volInfo,driveNum);
  2628 		test_KErrNone(r);
  2624 		test_KErrNone(r);
  2629 
  2625 
  2630 		test(volInfo.iName==_L("ABCDEFGHIJK"));
  2626 		test(volInfo.iName==_L("ABCDEFGHIJK"));
  2631 
  2627 
  2632 	//	Test notification does not occur under ENotifyAttributes
  2628 	//	Test notification does not occur under ENotifyAttributes
  2633 		fs.NotifyChange(ENotifyAttributes,reqStat,path);
  2629 		fs.NotifyChange(ENotifyAttributes,reqStat,path);
  2634 		r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum);
  2630 		r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum);
  2635 		test_KErrNone(r);
  2631 		test_KErrNone(r);
  2636 		test(reqStat==KRequestPending);
  2632 		test_Value(reqStat.Int(), reqStat==KRequestPending);
  2637 		r=TheFs.Volume(volInfo,driveNum);
  2633 		r=TheFs.Volume(volInfo,driveNum);
  2638 		test_KErrNone(r);
  2634 		test_KErrNone(r);
  2639 
  2635 
  2640 		test(volInfo.iName==_L("TROPICANA"));
  2636 		test(volInfo.iName==_L("TROPICANA"));
  2641 
  2637 
  2642 		fs.NotifyChangeCancel(reqStat);
  2638 		fs.NotifyChangeCancel(reqStat);
  2643 		User::WaitForRequest(reqStat);
  2639 		User::WaitForRequest(reqStat);
  2644 		test(reqStat==KErrCancel);
  2640 		test_Value(reqStat.Int(), reqStat==KErrCancel);
  2645 	//	Test notification occurs under ENotifyEntry
  2641 	//	Test notification occurs under ENotifyEntry
  2646 		fs.NotifyChange(ENotifyEntry,reqStat,path);
  2642 		fs.NotifyChange(ENotifyEntry,reqStat,path);
  2647 		test(reqStat==KRequestPending);
  2643 		test_Value(reqStat.Int(), reqStat==KRequestPending);
  2648 		r=TheFs.SetVolumeLabel(currentVolName,driveNum);
  2644 		r=TheFs.SetVolumeLabel(currentVolName,driveNum);
  2649 		test_KErrNone(r);
  2645 		test_KErrNone(r);
  2650 		User::WaitForRequest(reqStat);
  2646 		User::WaitForRequest(reqStat);
  2651 		test(reqStat==KErrNone);
  2647 		test_KErrNone(reqStat.Int());
  2652 		r=TheFs.Volume(volInfo,driveNum);
  2648 		r=TheFs.Volume(volInfo,driveNum);
  2653 		test_KErrNone(r);
  2649 		test_KErrNone(r);
  2654 		test(volInfo.iName==currentVolName);
  2650 		test(volInfo.iName==currentVolName);
  2655 		}
  2651 		}
  2656 
  2652 
  2661 		test.Printf(_L("Cannot set volume label on a substed drive\n"));
  2657 		test.Printf(_L("Cannot set volume label on a substed drive\n"));
  2662 		}
  2658 		}
  2663 
  2659 
  2664 //	RFs::Rename()
  2660 //	RFs::Rename()
  2665 	fs.NotifyChange(ENotifyEntry,reqStat,path);
  2661 	fs.NotifyChange(ENotifyEntry,reqStat,path);
  2666 	test(reqStat==KRequestPending);
  2662 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2667 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Toto.doc"));
  2663 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Toto.doc"));
  2668 	test_KErrNone(r);
  2664 	test_KErrNone(r);
  2669 	User::WaitForRequest(reqStat);
  2665 	User::WaitForRequest(reqStat);
  2670 	test(reqStat==KErrNone);
  2666 	test_KErrNone(reqStat.Int());
  2671 
  2667 
  2672 //	Test that notification is made when change is made to monitored directory
  2668 //	Test that notification is made when change is made to monitored directory
  2673 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2669 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2674 	test(reqStat==KRequestPending);
  2670 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2675 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
  2671 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
  2676 	test_KErrNone(r);
  2672 	test_KErrNone(r);
  2677 	User::WaitForRequest(reqStat);
  2673 	User::WaitForRequest(reqStat);
  2678 	test(reqStat==KErrNone);
  2674 	test_KErrNone(reqStat.Int());
  2679 
  2675 
  2680 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2676 	fs.NotifyChange(ENotifyAll,reqStat,path);
  2681 	test(reqStat==KRequestPending);
  2677 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2682 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
  2678 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
  2683 	test_KErrNone(r);
  2679 	test_KErrNone(r);
  2684 	User::WaitForRequest(reqStat);
  2680 	User::WaitForRequest(reqStat);
  2685 	test(reqStat==KErrNone);
  2681 	test_KErrNone(reqStat.Int());
  2686 	fs.Close();
  2682 	fs.Close();
  2687 	}
  2683 	}
  2688 
  2684 
  2689 
  2685 
  2690 static void Test17()
  2686 static void Test17()
  2765 	r=thread1.Create(_L("TestThread1"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
  2761 	r=thread1.Create(_L("TestThread1"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
  2766 	test_KErrNone(r);
  2762 	test_KErrNone(r);
  2767 	thread1.Resume();
  2763 	thread1.Resume();
  2768 	gSleepThread.Wait();
  2764 	gSleepThread.Wait();
  2769 
  2765 
  2770 	test(status1==KRequestPending);
  2766 	test_Value(status1.Int(), status1==KRequestPending);
  2771 	test(status2==KRequestPending);
  2767 	test_Value(status2.Int(), status2==KRequestPending);
  2772 	test(status3==KRequestPending);
  2768 	test_Value(status3.Int(), status3==KRequestPending);
  2773 	test(status4==KRequestPending);
  2769 	test_Value(status4.Int(), status4==KRequestPending);
  2774 	test(status5==KRequestPending);
  2770 	test_Value(status5.Int(), status5==KRequestPending);
  2775 	test(status6==KRequestPending);
  2771 	test_Value(status6.Int(), status6==KRequestPending);
  2776 
  2772 
  2777 	test(statusExtended1==KRequestPending);
  2773 	test_Value(statusExtended1.Int(), statusExtended1==KRequestPending);
  2778 	test(statusExtended2==KRequestPending);
  2774 	test_Value(statusExtended2.Int(), statusExtended2==KRequestPending);
  2779 	test(statusExtended3==KRequestPending);
  2775 	test_Value(statusExtended3.Int(), statusExtended3==KRequestPending);
  2780 	test(statusExtended4==KRequestPending);
  2776 	test_Value(statusExtended4.Int(), statusExtended4==KRequestPending);
  2781 	test(statusExtended5==KRequestPending);
  2777 	test_Value(statusExtended5.Int(), statusExtended5==KRequestPending);
  2782 	test(statusExtended6==KRequestPending);
  2778 	test_Value(statusExtended6.Int(), statusExtended6==KRequestPending);
  2783 
  2779 
  2784 	test(reqStat1==KRequestPending);
  2780 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  2785 	test(reqStat2==KRequestPending);
  2781 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  2786 	test(reqStat3==KRequestPending);
  2782 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  2787 	test(reqStat4==KRequestPending);
  2783 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  2788 
  2784 
  2789 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
  2785 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
  2790 	test_KErrNone(r);
  2786 	test_KErrNone(r);
  2791 	User::WaitForRequest(reqStat1);
  2787 	User::WaitForRequest(reqStat1);
  2792 	test(reqStat1==KErrNone);
  2788 	test_KErrNone(reqStat1.Int());
  2793 	User::WaitForRequest(status1);
  2789 	User::WaitForRequest(status1);
  2794 	test(status1==KErrNone);
  2790 	test_KErrNone(status1.Int());
  2795 	User::WaitForRequest(status2);
  2791 	User::WaitForRequest(status2);
  2796 	test(status2==KErrNone);
  2792 	test_KErrNone(status2.Int());
  2797 	User::WaitForRequest(status3);
  2793 	User::WaitForRequest(status3);
  2798 	test(status3==KErrNone);
  2794 	test_KErrNone(status3.Int());
  2799 	User::WaitForRequest(status4);
  2795 	User::WaitForRequest(status4);
  2800 	test(status4==KErrNone);
  2796 	test_KErrNone(status4.Int());
  2801 	User::WaitForRequest(status5);
  2797 	User::WaitForRequest(status5);
  2802 	test(status5==KErrNone);
  2798 	test_KErrNone(status5.Int());
  2803 	User::WaitForRequest(status6);
  2799 	User::WaitForRequest(status6);
  2804 	test(status6==KErrNone);
  2800 	test_KErrNone(status6.Int());
  2805 
  2801 
  2806 	User::WaitForRequest(statusExtended1);
  2802 	User::WaitForRequest(statusExtended1);
  2807 	test(statusExtended1==KErrNone);
  2803 	test_KErrNone(statusExtended1.Int());
  2808 	User::WaitForRequest(statusExtended2);
  2804 	User::WaitForRequest(statusExtended2);
  2809 	test(statusExtended2==KErrNone);
  2805 	test_KErrNone(statusExtended2.Int());
  2810 	User::WaitForRequest(statusExtended3);
  2806 	User::WaitForRequest(statusExtended3);
  2811 	test(statusExtended3==KErrNone);
  2807 	test_KErrNone(statusExtended3.Int());
  2812 	User::WaitForRequest(statusExtended4);
  2808 	User::WaitForRequest(statusExtended4);
  2813 	test(statusExtended4==KErrNone);
  2809 	test_KErrNone(statusExtended4.Int());
  2814 	User::WaitForRequest(statusExtended5);
  2810 	User::WaitForRequest(statusExtended5);
  2815 	test(statusExtended5==KErrNone);
  2811 	test_KErrNone(statusExtended5.Int());
  2816 	User::WaitForRequest(statusExtended6);
  2812 	User::WaitForRequest(statusExtended6);
  2817 	test(statusExtended6==KErrNone);
  2813 	test_KErrNone(statusExtended6.Int());
  2818 
  2814 
  2819 	User::WaitForRequest(reqStat2);
  2815 	User::WaitForRequest(reqStat2);
  2820 	test(reqStat2==KErrNone);
  2816 	test_KErrNone(reqStat2.Int());
  2821 	test(reqStat3==KRequestPending);
  2817 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  2822 	test(reqStat4==KRequestPending);
  2818 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  2823 	fs.NotifyChangeCancel();	//	Cancels both remaining notification requests
  2819 	fs.NotifyChangeCancel();	//	Cancels both remaining notification requests
  2824 
  2820 
  2825 	User::WaitForRequest(reqStat3);
  2821 	User::WaitForRequest(reqStat3);
  2826 	User::WaitForRequest(reqStat4);
  2822 	User::WaitForRequest(reqStat4);
  2827 
  2823 
  2835 
  2831 
  2836 	fs.NotifyChange(ENotifyAll,reqStat1,path1);
  2832 	fs.NotifyChange(ENotifyAll,reqStat1,path1);
  2837 	fs.NotifyChange(ENotifyEntry,reqStat2,path2);
  2833 	fs.NotifyChange(ENotifyEntry,reqStat2,path2);
  2838 	fs.NotifyChange(ENotifyAll,reqStat3,path3);
  2834 	fs.NotifyChange(ENotifyAll,reqStat3,path3);
  2839 	fs.NotifyChange(ENotifyEntry,reqStat4,path4);
  2835 	fs.NotifyChange(ENotifyEntry,reqStat4,path4);
  2840 	test(reqStat1==KRequestPending);
  2836 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  2841 	test(reqStat2==KRequestPending);
  2837 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  2842 	test(reqStat3==KRequestPending);
  2838 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  2843 	test(reqStat4==KRequestPending);
  2839 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  2844 
  2840 
  2845 	r=gSleepThread.CreateLocal(0);
  2841 	r=gSleepThread.CreateLocal(0);
  2846 	test_KErrNone(r);
  2842 	test_KErrNone(r);
  2847 	RThread thread2;
  2843 	RThread thread2;
  2848 	r=thread2.Create(_L("TestThread2"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
  2844 	r=thread2.Create(_L("TestThread2"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
  2849 	test_KErrNone(r);
  2845 	test_KErrNone(r);
  2850 	thread2.Resume();
  2846 	thread2.Resume();
  2851 	gSleepThread.Wait();
  2847 	gSleepThread.Wait();
  2852 
  2848 
  2853 	User::WaitForRequest(reqStat1);
  2849 	User::WaitForRequest(reqStat1);
  2854 	test(reqStat1==KErrNone);
  2850 	test_KErrNone(reqStat1.Int());
  2855 	test(reqStat2==KRequestPending);
  2851 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  2856 	User::WaitForRequest(reqStat3);
  2852 	User::WaitForRequest(reqStat3);
  2857 	test(reqStat3==KErrNone);
  2853 	test_KErrNone(reqStat3.Int());
  2858 	test(reqStat4==KRequestPending);
  2854 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  2859 
  2855 
  2860 	gSleepThread.Close();
  2856 	gSleepThread.Close();
  2861 	thread2.Close();
  2857 	thread2.Close();
  2862 
  2858 
  2863 	fs.NotifyChange(ENotifyAll,reqStat1,path1);
  2859 	fs.NotifyChange(ENotifyAll,reqStat1,path1);
  2864 	fs.NotifyChange(ENotifyAll,reqStat3,path3);
  2860 	fs.NotifyChange(ENotifyAll,reqStat3,path3);
  2865 
  2861 
  2866 	test(reqStat1==KRequestPending);
  2862 	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
  2867 	test(reqStat2==KRequestPending);
  2863 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  2868 	test(reqStat3==KRequestPending);
  2864 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  2869 	test(reqStat4==KRequestPending);
  2865 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  2870 
  2866 
  2871 	r=gSleepThread.CreateLocal(0);
  2867 	r=gSleepThread.CreateLocal(0);
  2872 	test_KErrNone(r);
  2868 	test_KErrNone(r);
  2873 	RThread thread3;
  2869 	RThread thread3;
  2874 	r=thread3.Create(_L("TestThread3"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
  2870 	r=thread3.Create(_L("TestThread3"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
  2875 	test_KErrNone(r);
  2871 	test_KErrNone(r);
  2876 	thread3.Resume();
  2872 	thread3.Resume();
  2877 	gSleepThread.Wait();
  2873 	gSleepThread.Wait();
  2878 
  2874 
  2879 	User::WaitForRequest(reqStat1);
  2875 	User::WaitForRequest(reqStat1);
  2880 	test(reqStat1==KErrNone);
  2876 	test_KErrNone(reqStat1.Int());
  2881 	test(reqStat2==KRequestPending);	//	Monitoring with ENotifyEntry
  2877 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);	//	Monitoring with ENotifyEntry
  2882 	User::WaitForRequest(reqStat3);
  2878 	User::WaitForRequest(reqStat3);
  2883 	test(reqStat3==KErrNone);
  2879 	test_KErrNone(reqStat3.Int());
  2884 	test(reqStat4==KRequestPending);	//	Monitoring with ENotifyEntry
  2880 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	Monitoring with ENotifyEntry
  2885 
  2881 
  2886 	RFs fs2;
  2882 	RFs fs2;
  2887 	r=fs2.Connect();
  2883 	r=fs2.Connect();
  2888 	test_KErrNone(r);
  2884 	test_KErrNone(r);
  2889 	r=fs2.SetSessionPath(gSessionPath);
  2885 	r=fs2.SetSessionPath(gSessionPath);
  2890 	test_KErrNone(r);
  2886 	test_KErrNone(r);
  2891 
  2887 
  2892 	TRequestStatus reqStat(KRequestPending);
  2888 	TRequestStatus reqStat(KRequestPending);
  2893 	fs2.NotifyChange(ENotifyEntry,reqStat);
  2889 	fs2.NotifyChange(ENotifyEntry,reqStat);
  2894 	test(reqStat==KRequestPending);
  2890 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2895 
  2891 
  2896 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
  2892 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
  2897 	test_KErrNone(r);
  2893 	test_KErrNone(r);
  2898 	User::WaitForRequest(reqStat2);
  2894 	User::WaitForRequest(reqStat2);
  2899 	test(reqStat2==KErrNone);
  2895 	test_KErrNone(reqStat2.Int());
  2900 	test(reqStat4==KRequestPending);
  2896 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  2901 	User::WaitForRequest(reqStat);
  2897 	User::WaitForRequest(reqStat);
  2902 	test(reqStat==KErrNone);
  2898 	test_KErrNone(reqStat.Int());
  2903 
  2899 
  2904 	fs2.NotifyChange(ENotifyAll,reqStat);
  2900 	fs2.NotifyChange(ENotifyAll,reqStat);
  2905 	test(reqStat==KRequestPending);
  2901 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2906 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\koala.txt"));
  2902 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\koala.txt"));
  2907 	test_KErrNone(r);
  2903 	test_KErrNone(r);
  2908 	User::WaitForRequest(reqStat);
  2904 	User::WaitForRequest(reqStat);
  2909 	test(reqStat==KErrNone);
  2905 	test_KErrNone(reqStat.Int());
  2910 	test(reqStat4==KRequestPending);
  2906 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  2911 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\dingo.txt"));
  2907 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\dingo.txt"));
  2912 	test_KErrNone(r);
  2908 	test_KErrNone(r);
  2913 	User::WaitForRequest(reqStat4);
  2909 	User::WaitForRequest(reqStat4);
  2914 	test(reqStat4==KErrNone);
  2910 	test_KErrNone(reqStat4.Int());
  2915 
  2911 
  2916 	gSleepThread.Close();
  2912 	gSleepThread.Close();
  2917 	thread3.Close();
  2913 	thread3.Close();
  2918 	fs.Close();
  2914 	fs.Close();
  2919 	}
  2915 	}
  2956 	fs.NotifyChange(ENotifyEntry,reqStat5,path);
  2952 	fs.NotifyChange(ENotifyEntry,reqStat5,path);
  2957 	fs.NotifyChange(ENotifyAttributes,reqStat6,path);
  2953 	fs.NotifyChange(ENotifyAttributes,reqStat6,path);
  2958 	fs.NotifyChange(ENotifyDisk,reqStat7,path);
  2954 	fs.NotifyChange(ENotifyDisk,reqStat7,path);
  2959 
  2955 
  2960 
  2956 
  2961 	test(reqStat==KRequestPending);
  2957 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  2962 	test(reqStat2==KRequestPending);
  2958 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  2963 	test(reqStat3==KRequestPending);
  2959 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  2964 	User::WaitForRequest(reqStat4);
  2960 	User::WaitForRequest(reqStat4);
  2965 	test(reqStat4==KErrArgument); //	Cannot monitor a file with ENotifyDir
  2961 	test_Value(reqStat4.Int(), reqStat4==KErrArgument); //	Cannot monitor a file with ENotifyDir
  2966 	test(reqStat5==KRequestPending);
  2962 	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
  2967 	test(reqStat6==KRequestPending);
  2963 	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
  2968 	fs.NotifyChange(ENotifyEntry,reqStat4,path);
  2964 	fs.NotifyChange(ENotifyEntry,reqStat4,path);
  2969 	test(reqStat4==KRequestPending);
  2965 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  2970 
  2966 
  2971 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
  2967 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
  2972 	file.Close();
  2968 	file.Close();
  2973 
  2969 
  2974 	User::WaitForRequest(reqStat);
  2970 	User::WaitForRequest(reqStat);
  2975 	test(reqStat==KErrNone);
  2971 	test_KErrNone(reqStat.Int());
  2976 	test(reqStat2==KRequestPending);	//	Monitoring with ENotifyFile
  2972 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);	//	Monitoring with ENotifyFile
  2977 	User::WaitForRequest(reqStat3);
  2973 	User::WaitForRequest(reqStat3);
  2978 	test(reqStat3==KErrNone);
  2974 	test_KErrNone(reqStat3.Int());
  2979 	test(reqStat4==KRequestPending);	//	Monitoring with ENotifyEntry
  2975 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	Monitoring with ENotifyEntry
  2980 	test(reqStat5==KRequestPending);
  2976 	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
  2981 	test(reqStat6==KRequestPending);
  2977 	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
  2982 	test(reqStat7==KRequestPending);
  2978 	test_Value(reqStat7.Int(), reqStat7==KRequestPending);
  2983 	fs.NotifyChangeCancel();			//	Cancels all outstanding notification requests
  2979 	fs.NotifyChangeCancel();			//	Cancels all outstanding notification requests
  2984 
  2980 
  2985 	User::WaitForRequest(reqStat2);
  2981 	User::WaitForRequest(reqStat2);
  2986 	test(reqStat2==KErrCancel);
  2982 	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
  2987 	User::WaitForRequest(reqStat4);
  2983 	User::WaitForRequest(reqStat4);
  2988 	test(reqStat4==KErrCancel);
  2984 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  2989 	User::WaitForRequest(reqStat5);
  2985 	User::WaitForRequest(reqStat5);
  2990 	test(reqStat5==KErrCancel);
  2986 	test_Value(reqStat5.Int(), reqStat5==KErrCancel);
  2991 	User::WaitForRequest(reqStat6);
  2987 	User::WaitForRequest(reqStat6);
  2992 	test(reqStat6==KErrCancel);
  2988 	test_Value(reqStat6.Int(), reqStat6==KErrCancel);
  2993 	User::WaitForRequest(reqStat7);
  2989 	User::WaitForRequest(reqStat7);
  2994 	test(reqStat7==KErrCancel);
  2990 	test_Value(reqStat7.Int(), reqStat7==KErrCancel);
  2995 
  2991 
  2996 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
  2992 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
  2997 	test_KErrNone(r);
  2993 	test_KErrNone(r);
  2998 
  2994 
  2999 //	RFile::SetAtt() of a file within the monitored directory
  2995 //	RFile::SetAtt() of a file within the monitored directory
  3003 	fs.NotifyChange(ENotifyAttributes,reqStat4,path);
  2999 	fs.NotifyChange(ENotifyAttributes,reqStat4,path);
  3004 	fs.NotifyChange(ENotifyDir,reqStat5,path);
  3000 	fs.NotifyChange(ENotifyDir,reqStat5,path);
  3005 	fs.NotifyChange(ENotifyWrite,reqStat6,path);
  3001 	fs.NotifyChange(ENotifyWrite,reqStat6,path);
  3006 	fs.NotifyChange(ENotifyDisk,reqStat7,path);
  3002 	fs.NotifyChange(ENotifyDisk,reqStat7,path);
  3007 
  3003 
  3008 	test(reqStat==KRequestPending);
  3004 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3009 	test(reqStat2==KRequestPending);
  3005 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3010 	test(reqStat3==KRequestPending);
  3006 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3011 	test(reqStat4==KRequestPending);
  3007 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3012 	User::WaitForRequest(reqStat5);
  3008 	User::WaitForRequest(reqStat5);
  3013 	test(reqStat5==KErrArgument);
  3009 	test_Value(reqStat5.Int(), reqStat5==KErrArgument);
  3014 	test(reqStat6==KRequestPending);
  3010 	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
  3015 	test(reqStat7==KRequestPending);
  3011 	test_Value(reqStat7.Int(), reqStat7==KRequestPending);
  3016 
  3012 
  3017 	test.Next(_L("RFile::SetAtt()"));
  3013 	test.Next(_L("RFile::SetAtt()"));
  3018 	r=file.SetAtt(KEntryAttSystem,KEntryAttNormal);
  3014 	r=file.SetAtt(KEntryAttSystem,KEntryAttNormal);
  3019 	test_KErrNone(r);
  3015 	test_KErrNone(r);
  3020 	User::WaitForRequest(reqStat);
  3016 	User::WaitForRequest(reqStat);
  3021 	User::WaitForRequest(reqStat4);
  3017 	User::WaitForRequest(reqStat4);
  3022 	test(reqStat==KErrNone);
  3018 	test_KErrNone(reqStat.Int());
  3023 	test(reqStat2==KRequestPending);	//	Monitoring with ENotifyFile
  3019 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);	//	Monitoring with ENotifyFile
  3024 	test(reqStat3==KRequestPending);	//	Monitoring with ENotifyEntry
  3020 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);	//	Monitoring with ENotifyEntry
  3025 	test(reqStat4==KErrNone);				//	Monitoring a file - can't use ENotifyDir
  3021 	test_KErrNone(reqStat4.Int());				//	Monitoring a file - can't use ENotifyDir
  3026 	test(reqStat6==KRequestPending);
  3022 	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
  3027 	test(reqStat7==KRequestPending);
  3023 	test_Value(reqStat7.Int(), reqStat7==KRequestPending);
  3028 
  3024 
  3029 	fs.NotifyChange(ENotifyWrite,reqStat,path);
  3025 	fs.NotifyChange(ENotifyWrite,reqStat,path);
  3030 	test(reqStat==KRequestPending);
  3026 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3031 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3027 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3032 	User::WaitForRequest(reqStat4);
  3028 	User::WaitForRequest(reqStat4);
  3033 	test(reqStat4==KErrArgument);
  3029 	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
  3034 	r=file.SetAtt(KEntryAttNormal,KEntryAttSystem);
  3030 	r=file.SetAtt(KEntryAttNormal,KEntryAttSystem);
  3035 	test_KErrNone(r);
  3031 	test_KErrNone(r);
  3036 	test(reqStat==KRequestPending);		//	Monitoring with ENotifyWrite
  3032 	test_Value(reqStat.Int(), reqStat==KRequestPending);		//	Monitoring with ENotifyWrite
  3037 	fs.NotifyChangeCancel();	//	Cancel outstanding notification request
  3033 	fs.NotifyChangeCancel();	//	Cancel outstanding notification request
  3038 
  3034 
  3039 	User::WaitForRequest(reqStat);
  3035 	User::WaitForRequest(reqStat);
  3040 	test(reqStat==KErrCancel);
  3036 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  3041 	User::WaitForRequest(reqStat2);
  3037 	User::WaitForRequest(reqStat2);
  3042 	test(reqStat2==KErrCancel);
  3038 	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
  3043 	User::WaitForRequest(reqStat3);
  3039 	User::WaitForRequest(reqStat3);
  3044 	test(reqStat3==KErrCancel);
  3040 	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
  3045 	User::WaitForRequest(reqStat6);
  3041 	User::WaitForRequest(reqStat6);
  3046 	test(reqStat6==KErrCancel);
  3042 	test_Value(reqStat6.Int(), reqStat6==KErrCancel);
  3047 	User::WaitForRequest(reqStat7);
  3043 	User::WaitForRequest(reqStat7);
  3048 	test(reqStat7==KErrCancel);
  3044 	test_Value(reqStat7.Int(), reqStat7==KErrCancel);
  3049 
  3045 
  3050 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3046 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3051 	fs.NotifyChange(ENotifyFile,reqStat2,path);
  3047 	fs.NotifyChange(ENotifyFile,reqStat2,path);
  3052 	fs.NotifyChange(ENotifyEntry,reqStat3,path);
  3048 	fs.NotifyChange(ENotifyEntry,reqStat3,path);
  3053 	fs.NotifyChange(ENotifyAttributes,reqStat4,path);
  3049 	fs.NotifyChange(ENotifyAttributes,reqStat4,path);
  3054 
  3050 
  3055 	test(reqStat==KRequestPending);
  3051 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3056 	test(reqStat2==KRequestPending);
  3052 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3057 	test(reqStat3==KRequestPending);
  3053 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3058 	test(reqStat4==KRequestPending);
  3054 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3059 
  3055 
  3060 //	RFile::SetSize() of a file within the monitored directory
  3056 //	RFile::SetSize() of a file within the monitored directory
  3061 	test.Next(_L("RFile::SetSize()"));
  3057 	test.Next(_L("RFile::SetSize()"));
  3062 	r=file.SetSize(256);
  3058 	r=file.SetSize(256);
  3063 	test_KErrNone(r);
  3059 	test_KErrNone(r);
  3064 	User::WaitForRequest(reqStat);
  3060 	User::WaitForRequest(reqStat);
  3065 	User::WaitForRequest(reqStat4);
  3061 	User::WaitForRequest(reqStat4);
  3066 	test(reqStat==KErrNone);
  3062 	test_KErrNone(reqStat.Int());
  3067 	test(reqStat2==KRequestPending);	//	Monitoring with ENotifyFile
  3063 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);	//	Monitoring with ENotifyFile
  3068 	test(reqStat3==KRequestPending);	//	Monitoring with ENotifyEntry
  3064 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);	//	Monitoring with ENotifyEntry
  3069 	test(reqStat4==KErrNone);
  3065 	test_KErrNone(reqStat4.Int());
  3070 
  3066 
  3071 	fs.NotifyChange(ENotifyWrite,reqStat,path);
  3067 	fs.NotifyChange(ENotifyWrite,reqStat,path);
  3072 	test(reqStat==KRequestPending);
  3068 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3073 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3069 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3074 	User::WaitForRequest(reqStat4);
  3070 	User::WaitForRequest(reqStat4);
  3075 	test(reqStat4==KErrArgument);
  3071 	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
  3076 	r=file.SetSize(200);
  3072 	r=file.SetSize(200);
  3077 	test_KErrNone(r);
  3073 	test_KErrNone(r);
  3078 	User::After(1000000);
  3074 	User::After(1000000);
  3079 	test(reqStat==KRequestPending);		//	Monitoring with ENotifyWrite
  3075 	test_Value(reqStat.Int(), reqStat==KRequestPending);		//	Monitoring with ENotifyWrite
  3080 
  3076 
  3081 	file.Close();
  3077 	file.Close();
  3082 	fs.NotifyChangeCancel();			//	Cancels all outstanding notification requests
  3078 	fs.NotifyChangeCancel();			//	Cancels all outstanding notification requests
  3083 
  3079 
  3084 	User::WaitForRequest(reqStat);
  3080 	User::WaitForRequest(reqStat);
  3085 	test(reqStat==KErrCancel);
  3081 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  3086 	User::WaitForRequest(reqStat2);
  3082 	User::WaitForRequest(reqStat2);
  3087 	test(reqStat2==KErrCancel);
  3083 	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
  3088 	User::WaitForRequest(reqStat3);
  3084 	User::WaitForRequest(reqStat3);
  3089 	test(reqStat3==KErrCancel);
  3085 	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
  3090 
  3086 
  3091 //	RFile::Temp() to create a temp file within the monitored directory
  3087 //	RFile::Temp() to create a temp file within the monitored directory
  3092 	test.Next(_L("RFile::Temp()"));
  3088 	test.Next(_L("RFile::Temp()"));
  3093 	path=_L("\\F32-TST\\NOTIFY\\");
  3089 	path=_L("\\F32-TST\\NOTIFY\\");
  3094 
  3090 
  3095 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3091 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3096 	fs.NotifyChange(ENotifyDir,reqStat2,path);
  3092 	fs.NotifyChange(ENotifyDir,reqStat2,path);
  3097 	fs.NotifyChange(ENotifyEntry,reqStat3,path);
  3093 	fs.NotifyChange(ENotifyEntry,reqStat3,path);
  3098 	fs.NotifyChange(ENotifyAttributes,reqStat4,path);
  3094 	fs.NotifyChange(ENotifyAttributes,reqStat4,path);
  3099 
  3095 
  3100 	test(reqStat==KRequestPending);
  3096 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3101 	test(reqStat2==KRequestPending);
  3097 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3102 	test(reqStat3==KRequestPending);
  3098 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3103 	test(reqStat4==KRequestPending);
  3099 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3104 
  3100 
  3105 	TFileName fileName;
  3101 	TFileName fileName;
  3106 	r=file.Temp(TheFs,path,fileName,EFileWrite);
  3102 	r=file.Temp(TheFs,path,fileName,EFileWrite);
  3107 	test_KErrNone(r);
  3103 	test_KErrNone(r);
  3108 	User::WaitForRequest(reqStat);
  3104 	User::WaitForRequest(reqStat);
  3109 	test(reqStat==KErrNone);
  3105 	test_KErrNone(reqStat.Int());
  3110 	test(reqStat2==KRequestPending);
  3106 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3111 	test(reqStat3==KRequestPending);	//	Monitoring ENotifyEntry
  3107 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);	//	Monitoring ENotifyEntry
  3112 	test(reqStat4==KRequestPending);	//	Monitoring ENotifyAttributes
  3108 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	Monitoring ENotifyAttributes
  3113 	file.Close();
  3109 	file.Close();
  3114 	fs.NotifyChangeCancel();
  3110 	fs.NotifyChangeCancel();
  3115 
  3111 
  3116 	User::WaitForRequest(reqStat2);
  3112 	User::WaitForRequest(reqStat2);
  3117 	test(reqStat2==KErrCancel);
  3113 	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
  3118 	User::WaitForRequest(reqStat3);
  3114 	User::WaitForRequest(reqStat3);
  3119 	test(reqStat3==KErrCancel);
  3115 	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
  3120 	User::WaitForRequest(reqStat4);
  3116 	User::WaitForRequest(reqStat4);
  3121 	test(reqStat4==KErrCancel);
  3117 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3122 
  3118 
  3123 	fs.NotifyChange(ENotifyFile,reqStat,path);
  3119 	fs.NotifyChange(ENotifyFile,reqStat,path);
  3124 	fs.NotifyChange(ENotifyDisk,reqStat2,path);
  3120 	fs.NotifyChange(ENotifyDisk,reqStat2,path);
  3125 	fs.NotifyChange(ENotifyWrite,reqStat3,path);
  3121 	fs.NotifyChange(ENotifyWrite,reqStat3,path);
  3126 	r=file.Temp(TheFs,path,fileName,EFileWrite);
  3122 	r=file.Temp(TheFs,path,fileName,EFileWrite);
  3127 	test_KErrNone(r);
  3123 	test_KErrNone(r);
  3128 	test(reqStat==KRequestPending);		//	Monitoring ENotifyFile
  3124 	test_Value(reqStat.Int(), reqStat==KRequestPending);	//	Monitoring ENotifyFile
  3129 	test(reqStat2==KRequestPending);	//	Monitoring ENotifyDisk
  3125 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);	//	Monitoring ENotifyDisk
  3130 	test(reqStat3==KRequestPending);	//	Monitoring ENotifyWrite
  3126 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);	//	Monitoring ENotifyWrite
  3131 	file.Close();
  3127 	file.Close();
  3132 
  3128 
  3133 	fs.NotifyChangeCancel();	//	Cancels all outstanding notification requests
  3129 	fs.NotifyChangeCancel();	//	Cancels all outstanding notification requests
  3134 
  3130 
  3135 	User::WaitForRequest(reqStat);
  3131 	User::WaitForRequest(reqStat);
  3136 	test(reqStat==KErrCancel);
  3132 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  3137 	User::WaitForRequest(reqStat2);
  3133 	User::WaitForRequest(reqStat2);
  3138 	test(reqStat2==KErrCancel);
  3134 	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
  3139 	User::WaitForRequest(reqStat3);
  3135 	User::WaitForRequest(reqStat3);
  3140 	test(reqStat3==KErrCancel);
  3136 	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
  3141 
  3137 
  3142 //	RFile::SetModified() to change modification time of a file within monitored dir
  3138 //	RFile::SetModified() to change modification time of a file within monitored dir
  3143 	test.Next(_L("RFile::SetModified()"));
  3139 	test.Next(_L("RFile::SetModified()"));
  3144 	path=_L("\\F32-TST\\NOTIFY\\NewFile.txt");
  3140 	path=_L("\\F32-TST\\NOTIFY\\NewFile.txt");
  3145 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3141 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3146 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3142 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3147 	fs.NotifyChange(ENotifyAttributes,reqStat3,path);
  3143 	fs.NotifyChange(ENotifyAttributes,reqStat3,path);
  3148 	fs.NotifyChange(ENotifyFile,reqStat4,path);
  3144 	fs.NotifyChange(ENotifyFile,reqStat4,path);
  3149 
  3145 
  3150 	test(reqStat==KRequestPending);
  3146 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3151 	test(reqStat2==KRequestPending);
  3147 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3152 	test(reqStat3==KRequestPending);
  3148 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3153 	test(reqStat4==KRequestPending);
  3149 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3154 
  3150 
  3155 	TTime now;
  3151 	TTime now;
  3156 	now.HomeTime();
  3152 	now.HomeTime();
  3157 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
  3153 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
  3158 	test_KErrNone(r);
  3154 	test_KErrNone(r);
  3159 	test(reqStat==KRequestPending);
  3155 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3160 	file.SetModified(now);
  3156 	file.SetModified(now);
  3161 	file.Close();
  3157 	file.Close();
  3162 	User::WaitForRequest(reqStat);
  3158 	User::WaitForRequest(reqStat);
  3163 	test(reqStat==KErrNone);
  3159 	test_KErrNone(reqStat.Int());
  3164 	test(reqStat2==KRequestPending);
  3160 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3165 	User::WaitForRequest(reqStat3);
  3161 	User::WaitForRequest(reqStat3);
  3166 	test(reqStat3==KErrNone);
  3162 	test_KErrNone(reqStat3.Int());
  3167 	test(reqStat4==KRequestPending);
  3163 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3168 	fs.NotifyChangeCancel();
  3164 	fs.NotifyChangeCancel();
  3169 
  3165 
  3170 	User::WaitForRequest(reqStat2);
  3166 	User::WaitForRequest(reqStat2);
  3171 	test(reqStat2==KErrCancel);
  3167 	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
  3172 	User::WaitForRequest(reqStat4);
  3168 	User::WaitForRequest(reqStat4);
  3173 	test(reqStat4==KErrCancel);
  3169 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3174 
  3170 
  3175 //	RFs::SetEntry() to change a directory entry within the monitored directory
  3171 //	RFs::SetEntry() to change a directory entry within the monitored directory
  3176 	test.Next(_L("RFs::SetEntry()"));
  3172 	test.Next(_L("RFs::SetEntry()"));
  3177 	TEntry entry;
  3173 	TEntry entry;
  3178 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3174 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3179 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3175 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3180 	fs.NotifyChange(ENotifyAttributes,reqStat3,path);
  3176 	fs.NotifyChange(ENotifyAttributes,reqStat3,path);
  3181 	fs.NotifyChange(ENotifyDisk,reqStat4,path);
  3177 	fs.NotifyChange(ENotifyDisk,reqStat4,path);
  3182 
  3178 
  3183 	test(reqStat==KRequestPending);
  3179 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3184 	test(reqStat2==KRequestPending);
  3180 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3185 	test(reqStat3==KRequestPending);
  3181 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3186 	test(reqStat4==KRequestPending);
  3182 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3187 
  3183 
  3188 	r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\NewFile.txt"),entry);
  3184 	r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\NewFile.txt"),entry);
  3189 	test(reqStat==KRequestPending);
  3185 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3190 	now.HomeTime();
  3186 	now.HomeTime();
  3191 	r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\NewFile.txt"),now,KEntryAttHidden,KEntryAttNormal);
  3187 	r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\NewFile.txt"),now,KEntryAttHidden,KEntryAttNormal);
  3192 	test_KErrNone(r);
  3188 	test_KErrNone(r);
  3193 	User::WaitForRequest(reqStat);
  3189 	User::WaitForRequest(reqStat);
  3194 	User::WaitForRequest(reqStat3);
  3190 	User::WaitForRequest(reqStat3);
  3195 	test(reqStat==KErrNone);
  3191 	test_KErrNone(reqStat.Int());
  3196 	test(reqStat2==KRequestPending);
  3192 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3197 	test(reqStat3==KErrNone);
  3193 	test_KErrNone(reqStat3.Int());
  3198 	test(reqStat4==KRequestPending);
  3194 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3199 	fs.NotifyChangeCancel();
  3195 	fs.NotifyChangeCancel();
  3200 
  3196 
  3201 	User::WaitForRequest(reqStat2);
  3197 	User::WaitForRequest(reqStat2);
  3202 	test(reqStat2==KErrCancel);
  3198 	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
  3203 	User::WaitForRequest(reqStat4);
  3199 	User::WaitForRequest(reqStat4);
  3204 	test(reqStat4==KErrCancel);
  3200 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3205 
  3201 
  3206 //	RFile::Set() to change file's modification time and attributes
  3202 //	RFile::Set() to change file's modification time and attributes
  3207 	test.Next(_L("RFile::Set()"));
  3203 	test.Next(_L("RFile::Set()"));
  3208 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3204 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3209 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3205 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3210 	fs.NotifyChange(ENotifyAttributes,reqStat3,path);
  3206 	fs.NotifyChange(ENotifyAttributes,reqStat3,path);
  3211 	fs.NotifyChange(ENotifyWrite,reqStat4,path);
  3207 	fs.NotifyChange(ENotifyWrite,reqStat4,path);
  3212 
  3208 
  3213 	test(reqStat==KRequestPending);
  3209 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3214 	test(reqStat2==KRequestPending);
  3210 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3215 	test(reqStat3==KRequestPending);
  3211 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3216 	test(reqStat4==KRequestPending);
  3212 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3217 
  3213 
  3218 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
  3214 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
  3219 	test_KErrNone(r);
  3215 	test_KErrNone(r);
  3220 	test(reqStat==KRequestPending);
  3216 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3221 	now.HomeTime();
  3217 	now.HomeTime();
  3222 	r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
  3218 	r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
  3223 	file.Close();
  3219 	file.Close();
  3224 	User::WaitForRequest(reqStat);
  3220 	User::WaitForRequest(reqStat);
  3225 	User::WaitForRequest(reqStat3);
  3221 	User::WaitForRequest(reqStat3);
  3226 	test(reqStat==KErrNone);
  3222 	test_KErrNone(reqStat.Int());
  3227 	test(reqStat2==KRequestPending);
  3223 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3228 	test(reqStat3==KErrNone);
  3224 	test_KErrNone(reqStat3.Int());
  3229 	test(reqStat4==KRequestPending);
  3225 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3230 	fs.NotifyChangeCancel();
  3226 	fs.NotifyChangeCancel();
  3231 
  3227 
  3232 	User::WaitForRequest(reqStat2);
  3228 	User::WaitForRequest(reqStat2);
  3233 	test(reqStat2==KErrCancel);
  3229 	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
  3234 	User::WaitForRequest(reqStat4);
  3230 	User::WaitForRequest(reqStat4);
  3235 	test(reqStat4==KErrCancel);
  3231 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3236 
  3232 
  3237 //	RFs::SetDriveName()
  3233 //	RFs::SetDriveName()
  3238 
  3234 
  3239 	test.Next(_L("RFs::SetDriveName()"));
  3235 	test.Next(_L("RFs::SetDriveName()"));
  3240 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3236 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3241 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3237 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3242 	fs.NotifyChange(ENotifyDisk,reqStat3,path);
  3238 	fs.NotifyChange(ENotifyDisk,reqStat3,path);
  3243 	fs.NotifyChange(ENotifyAttributes,reqStat4,path);
  3239 	fs.NotifyChange(ENotifyAttributes,reqStat4,path);
  3244 
  3240 
  3245 	test(reqStat==KRequestPending);
  3241 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3246 	test(reqStat2==KRequestPending);
  3242 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3247 	test(reqStat3==KRequestPending);
  3243 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3248 	test(reqStat4==KRequestPending);
  3244 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3249 	User::After(KNotifyChangeAfter);
  3245 	User::After(KNotifyChangeAfter);
  3250 
  3246 
  3251 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
  3247 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
  3252 	test_KErrNone(r);
  3248 	test_KErrNone(r);
  3253 	User::WaitForRequest(reqStat);
  3249 	User::WaitForRequest(reqStat);
  3254 	test(reqStat==KErrNone);
  3250 	test_KErrNone(reqStat.Int());
  3255 	test(reqStat2==KRequestPending);
  3251 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3256 	test(reqStat3==KRequestPending);
  3252 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3257 	test(reqStat4==KRequestPending);
  3253 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3258 	fs.NotifyChangeCancel();
  3254 	fs.NotifyChangeCancel();
  3259 
  3255 
  3260 	User::WaitForRequest(reqStat2);
  3256 	User::WaitForRequest(reqStat2);
  3261 	test(reqStat2==KErrCancel);
  3257 	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
  3262 	User::WaitForRequest(reqStat3);
  3258 	User::WaitForRequest(reqStat3);
  3263 	test(reqStat3==KErrCancel);
  3259 	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
  3264 	User::WaitForRequest(reqStat4);
  3260 	User::WaitForRequest(reqStat4);
  3265 	test(reqStat4==KErrCancel);
  3261 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3266 
  3262 
  3267 //	RFs::MkDir()
  3263 //	RFs::MkDir()
  3268 	test.Next(_L("RFs::MkDir()"));
  3264 	test.Next(_L("RFs::MkDir()"));
  3269 	path=_L("\\F32-TST\\NOTIFY\\");
  3265 	path=_L("\\F32-TST\\NOTIFY\\");
  3270 
  3266 
  3271 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3267 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3272 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3268 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3273 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3269 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3274 	fs.NotifyChange(ENotifyFile,reqStat4,path);
  3270 	fs.NotifyChange(ENotifyFile,reqStat4,path);
  3275 
  3271 
  3276 	test(reqStat==KRequestPending);
  3272 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3277 	test(reqStat2==KRequestPending);
  3273 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3278 	test(reqStat3==KRequestPending);
  3274 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3279 	test(reqStat4==KRequestPending);
  3275 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3280 
  3276 
  3281 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
  3277 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
  3282 	test_KErrNone(r);
  3278 	test_KErrNone(r);
  3283 	User::WaitForRequest(reqStat);
  3279 	User::WaitForRequest(reqStat);
  3284 	User::WaitForRequest(reqStat2);
  3280 	User::WaitForRequest(reqStat2);
  3285 	User::WaitForRequest(reqStat3);
  3281 	User::WaitForRequest(reqStat3);
  3286 	test(reqStat==KErrNone);
  3282 	test_KErrNone(reqStat.Int());
  3287 	test(reqStat2==KErrNone);
  3283 	test_KErrNone(reqStat2.Int());
  3288 	test(reqStat3==KErrNone);
  3284 	test_KErrNone(reqStat3.Int());
  3289 	test(reqStat4==KRequestPending);
  3285 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3290 
  3286 
  3291 //	RFs::RmDir()
  3287 //	RFs::RmDir()
  3292 	test.Next(_L("RFs::RmDir()"));
  3288 	test.Next(_L("RFs::RmDir()"));
  3293 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3289 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3294 	fs.NotifyChange(ENotifyDir,reqStat2,path);
  3290 	fs.NotifyChange(ENotifyDir,reqStat2,path);
  3295 	fs.NotifyChange(ENotifyWrite,reqStat3,path);
  3291 	fs.NotifyChange(ENotifyWrite,reqStat3,path);
  3296 
  3292 
  3297 	test(reqStat==KRequestPending);
  3293 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3298 	test(reqStat2==KRequestPending);
  3294 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3299 	test(reqStat3==KRequestPending);
  3295 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3300 
  3296 
  3301 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
  3297 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
  3302 	test_KErrNone(r);
  3298 	test_KErrNone(r);
  3303 	User::WaitForRequest(reqStat);
  3299 	User::WaitForRequest(reqStat);
  3304 	User::WaitForRequest(reqStat2);
  3300 	User::WaitForRequest(reqStat2);
  3305 	test(reqStat==KErrNone);
  3301 	test_KErrNone(reqStat.Int());
  3306 	test(reqStat2==KErrNone);
  3302 	test_KErrNone(reqStat2.Int());
  3307 	test(reqStat3==KRequestPending);
  3303 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3308 	test(reqStat4==KRequestPending);
  3304 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3309 	fs.NotifyChangeCancel();
  3305 	fs.NotifyChangeCancel();
  3310 
  3306 
  3311 	User::WaitForRequest(reqStat3);
  3307 	User::WaitForRequest(reqStat3);
  3312 	test(reqStat3==KErrCancel);
  3308 	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
  3313 	User::WaitForRequest(reqStat4);
  3309 	User::WaitForRequest(reqStat4);
  3314 	test(reqStat4==KErrCancel);
  3310 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3315 
  3311 
  3316 //	RFile::Create()
  3312 //	RFile::Create()
  3317 	test.Next(_L("RFile::Create()"));
  3313 	test.Next(_L("RFile::Create()"));
  3318 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3314 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3319 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3315 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3320 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3316 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3321 	fs.NotifyChange(ENotifyFile,reqStat4,path);
  3317 	fs.NotifyChange(ENotifyFile,reqStat4,path);
  3322 
  3318 
  3323 	test(reqStat==KRequestPending);
  3319 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3324 	test(reqStat2==KRequestPending);
  3320 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3325 	test(reqStat3==KRequestPending);
  3321 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3326 	test(reqStat4==KRequestPending);
  3322 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3327 
  3323 
  3328 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"),EFileRead|EFileWrite);
  3324 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"),EFileRead|EFileWrite);
  3329 	test_KErrNone(r);
  3325 	test_KErrNone(r);
  3330 	User::WaitForRequest(reqStat);
  3326 	User::WaitForRequest(reqStat);
  3331 	User::WaitForRequest(reqStat2);
  3327 	User::WaitForRequest(reqStat2);
  3332 	User::WaitForRequest(reqStat4);
  3328 	User::WaitForRequest(reqStat4);
  3333 	test(reqStat==KErrNone);
  3329 	test_KErrNone(reqStat.Int());
  3334 	test(reqStat2==KErrNone);
  3330 	test_KErrNone(reqStat2.Int());
  3335 	test(reqStat3==KRequestPending);	//	Monitoring ENotifyDir
  3331 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);	//	Monitoring ENotifyDir
  3336 	test(reqStat4==KErrNone);
  3332 	test_KErrNone(reqStat4.Int());
  3337 	file.Close();
  3333 	file.Close();
  3338 	fs.NotifyChangeCancel(reqStat3);
  3334 	fs.NotifyChangeCancel(reqStat3);
  3339 	User::WaitForRequest(reqStat3);
  3335 	User::WaitForRequest(reqStat3);
  3340 
  3336 
  3341 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3337 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3342 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3338 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3343 	fs.NotifyChange(ENotifyDisk,reqStat3,path);
  3339 	fs.NotifyChange(ENotifyDisk,reqStat3,path);
  3344 	fs.NotifyChange(ENotifyWrite,reqStat4,path);
  3340 	fs.NotifyChange(ENotifyWrite,reqStat4,path);
  3345 
  3341 
  3346 	test(reqStat==KRequestPending);
  3342 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3347 	test(reqStat2==KRequestPending);
  3343 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3348 	test(reqStat3==KRequestPending);
  3344 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3349 	test(reqStat4==KRequestPending);
  3345 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3350 
  3346 
  3351 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Bad_Witch.bat"),EFileRead|EFileWrite);
  3347 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Bad_Witch.bat"),EFileRead|EFileWrite);
  3352 	test_KErrNone(r);
  3348 	test_KErrNone(r);
  3353 	User::WaitForRequest(reqStat);
  3349 	User::WaitForRequest(reqStat);
  3354 	User::WaitForRequest(reqStat2);
  3350 	User::WaitForRequest(reqStat2);
  3355 	test(reqStat==KErrNone);
  3351 	test_KErrNone(reqStat.Int());
  3356 	test(reqStat2==KErrNone);
  3352 	test_KErrNone(reqStat2.Int());
  3357 	test(reqStat3==KRequestPending);
  3353 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3358 	test(reqStat4==KRequestPending);
  3354 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3359 	file.Close();
  3355 	file.Close();
  3360 	fs.NotifyChangeCancel();
  3356 	fs.NotifyChangeCancel();
  3361 
  3357 
  3362 	User::WaitForRequest(reqStat3);
  3358 	User::WaitForRequest(reqStat3);
  3363 	test(reqStat3==KErrCancel);
  3359 	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
  3364 	User::WaitForRequest(reqStat4);
  3360 	User::WaitForRequest(reqStat4);
  3365 	test(reqStat4==KErrCancel);
  3361 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3366 
  3362 
  3367 //	RFs::Delete()
  3363 //	RFs::Delete()
  3368 	test.Next(_L("RFs::Delete()"));
  3364 	test.Next(_L("RFs::Delete()"));
  3369 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3365 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3370 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3366 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3371 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3367 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3372 	fs.NotifyChange(ENotifyFile,reqStat4,path);
  3368 	fs.NotifyChange(ENotifyFile,reqStat4,path);
  3373 
  3369 
  3374 	test(reqStat==KRequestPending);
  3370 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3375 	test(reqStat2==KRequestPending);
  3371 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3376 	test(reqStat3==KRequestPending);
  3372 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3377 	test(reqStat4==KRequestPending);
  3373 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3378 
  3374 
  3379 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"));
  3375 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"));
  3380 	test_KErrNone(r);
  3376 	test_KErrNone(r);
  3381 	User::WaitForRequest(reqStat);
  3377 	User::WaitForRequest(reqStat);
  3382 	User::WaitForRequest(reqStat2);
  3378 	User::WaitForRequest(reqStat2);
  3383 	User::WaitForRequest(reqStat4);
  3379 	User::WaitForRequest(reqStat4);
  3384 	test(reqStat==KErrNone);
  3380 	test_KErrNone(reqStat.Int());
  3385 	test(reqStat2==KErrNone);
  3381 	test_KErrNone(reqStat2.Int());
  3386 	test(reqStat3==KRequestPending);	//	Monitoring ENotifyDir
  3382 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);	//	Monitoring ENotifyDir
  3387 	test(reqStat4==KErrNone);
  3383 	test_KErrNone(reqStat4.Int());
  3388 	fs.NotifyChangeCancel(reqStat3);
  3384 	fs.NotifyChangeCancel(reqStat3);
  3389 	User::WaitForRequest(reqStat3);
  3385 	User::WaitForRequest(reqStat3);
  3390 	test(reqStat3==KErrCancel);
  3386 	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
  3391 
  3387 
  3392 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3388 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3393 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3389 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3394 	fs.NotifyChange(ENotifyAttributes,reqStat3,path);
  3390 	fs.NotifyChange(ENotifyAttributes,reqStat3,path);
  3395 	fs.NotifyChange(ENotifyAll,reqStat4,path);
  3391 	fs.NotifyChange(ENotifyAll,reqStat4,path);
  3396 
  3392 
  3397 	test(reqStat==KRequestPending);
  3393 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3398 	test(reqStat2==KRequestPending);
  3394 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3399 	test(reqStat3==KRequestPending);
  3395 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3400 	test(reqStat4==KRequestPending);
  3396 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3401 
  3397 
  3402 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Bad_Witch.bat"));
  3398 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Bad_Witch.bat"));
  3403 	test_KErrNone(r);
  3399 	test_KErrNone(r);
  3404 	User::WaitForRequest(reqStat);
  3400 	User::WaitForRequest(reqStat);
  3405 	User::WaitForRequest(reqStat2);
  3401 	User::WaitForRequest(reqStat2);
  3406 	User::WaitForRequest(reqStat4);
  3402 	User::WaitForRequest(reqStat4);
  3407 	test(reqStat==KErrNone);
  3403 	test_KErrNone(reqStat.Int());
  3408 	test(reqStat2==KErrNone);
  3404 	test_KErrNone(reqStat2.Int());
  3409 	test(reqStat3==KRequestPending);
  3405 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3410 	test(reqStat4==KErrNone);
  3406 	test_KErrNone(reqStat4.Int());
  3411 	fs.NotifyChangeCancel(reqStat3);
  3407 	fs.NotifyChangeCancel(reqStat3);
  3412 	User::WaitForRequest(reqStat3);
  3408 	User::WaitForRequest(reqStat3);
  3413 	test(reqStat3==KErrCancel);
  3409 	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
  3414 
  3410 
  3415 //	RFile::Replace()
  3411 //	RFile::Replace()
  3416 	test.Next(_L("RFile::Replace()"));
  3412 	test.Next(_L("RFile::Replace()"));
  3417 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3413 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3418 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3414 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3419 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3415 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3420 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3416 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3421 
  3417 
  3422 	test(reqStat==KRequestPending);
  3418 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3423 	test(reqStat2==KRequestPending);
  3419 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3424 	test(reqStat3==KRequestPending);
  3420 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3425 	test(reqStat4==KRequestPending);
  3421 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3426 
  3422 
  3427 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"),EFileRead|EFileWrite);
  3423 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"),EFileRead|EFileWrite);
  3428 	test_KErrNone(r);
  3424 	test_KErrNone(r);
  3429 	User::WaitForRequest(reqStat);
  3425 	User::WaitForRequest(reqStat);
  3430 	User::WaitForRequest(reqStat2);
  3426 	User::WaitForRequest(reqStat2);
  3431 	User::WaitForRequest(reqStat3);
  3427 	User::WaitForRequest(reqStat3);
  3432 	test(reqStat==KErrNone);
  3428 	test_KErrNone(reqStat.Int());
  3433 	test(reqStat2==KErrNone);
  3429 	test_KErrNone(reqStat2.Int());
  3434 	test(reqStat3==KErrNone);
  3430 	test_KErrNone(reqStat3.Int());
  3435 	test(reqStat4==KRequestPending);
  3431 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3436 	file.Close();
  3432 	file.Close();
  3437 	fs.NotifyChangeCancel();
  3433 	fs.NotifyChangeCancel();
  3438 
  3434 
  3439 	test(reqStat==KErrNone);
  3435 	test_KErrNone(reqStat.Int());
  3440 	test(reqStat2==KErrNone);
  3436 	test_KErrNone(reqStat2.Int());
  3441 	test(reqStat3==KErrNone);
  3437 	test_KErrNone(reqStat3.Int());
  3442 	User::WaitForRequest(reqStat4);
  3438 	User::WaitForRequest(reqStat4);
  3443 	test(reqStat4==KErrCancel);
  3439 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3444 
  3440 
  3445 //	RFs::Delete()
  3441 //	RFs::Delete()
  3446 	test.Next(_L("RFs::Delete()"));
  3442 	test.Next(_L("RFs::Delete()"));
  3447 	path=_L("\\F32-TST\\NOTIFY\\Good_Witch.bat");
  3443 	path=_L("\\F32-TST\\NOTIFY\\Good_Witch.bat");
  3448 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3444 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3449 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3445 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3450 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3446 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3451 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3447 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3452 
  3448 
  3453 	test(reqStat==KRequestPending);
  3449 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3454 	test(reqStat2==KRequestPending);
  3450 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3455 	test(reqStat3==KRequestPending);
  3451 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3456 	User::WaitForRequest(reqStat4);
  3452 	User::WaitForRequest(reqStat4);
  3457 	test(reqStat4==KErrArgument);
  3453 	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
  3458 
  3454 
  3459 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"));
  3455 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"));
  3460 	test_KErrNone(r);
  3456 	test_KErrNone(r);
  3461 	User::WaitForRequest(reqStat);
  3457 	User::WaitForRequest(reqStat);
  3462 	User::WaitForRequest(reqStat2);
  3458 	User::WaitForRequest(reqStat2);
  3463 	User::WaitForRequest(reqStat3);
  3459 	User::WaitForRequest(reqStat3);
  3464 	test(reqStat==KErrNone);
  3460 	test_KErrNone(reqStat.Int());
  3465 	test(reqStat2==KErrNone);
  3461 	test_KErrNone(reqStat2.Int());
  3466 	test(reqStat3==KErrNone);
  3462 	test_KErrNone(reqStat3.Int());
  3467 	test(reqStat4==KErrArgument);
  3463 	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
  3468 
  3464 
  3469 //	RFs::SetVolumeLabel()
  3465 //	RFs::SetVolumeLabel()
  3470 	test.Next(_L("RFs::SetVolumeLabel()"));
  3466 	test.Next(_L("RFs::SetVolumeLabel()"));
  3471 	path=_L("\\F32-TST\\NOTIFY\\");
  3467 	path=_L("\\F32-TST\\NOTIFY\\");
  3472 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3468 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3475 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3471 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3476 	fs.NotifyChange(ENotifyWrite,reqStat5,path);
  3472 	fs.NotifyChange(ENotifyWrite,reqStat5,path);
  3477 	fs.NotifyChange(ENotifyAttributes,reqStat6,path);
  3473 	fs.NotifyChange(ENotifyAttributes,reqStat6,path);
  3478 	fs.NotifyChange(ENotifyDisk,reqStat7,path);
  3474 	fs.NotifyChange(ENotifyDisk,reqStat7,path);
  3479 
  3475 
  3480 	test(reqStat==KRequestPending);
  3476 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3481 	test(reqStat2==KRequestPending);
  3477 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3482 	test(reqStat3==KRequestPending);
  3478 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3483 	test(reqStat4==KRequestPending);
  3479 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3484 	test(reqStat5==KRequestPending);
  3480 	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
  3485 	test(reqStat6==KRequestPending);
  3481 	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
  3486 	test(reqStat7==KRequestPending);
  3482 	test_Value(reqStat7.Int(), reqStat7==KRequestPending);
  3487 
  3483 
  3488 	TInt driveNum=CurrentDrive();
  3484 	TInt driveNum=CurrentDrive();
  3489 	TVolumeInfo volInfo;
  3485 	TVolumeInfo volInfo;
  3490 	TFileName currentVolName;
  3486 	TFileName currentVolName;
  3491 	r=TheFs.Volume(volInfo,driveNum);
  3487 	r=TheFs.Volume(volInfo,driveNum);
  3492 	test_KErrNone(r);
  3488 	test_KErrNone(r);
  3493 	test(reqStat==KRequestPending);
  3489 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3494 	currentVolName=volInfo.iName;
  3490 	currentVolName=volInfo.iName;
  3495 
  3491 
  3496 	r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
  3492 	r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
  3497 	if (r==KErrNone)
  3493 	if (r==KErrNone)
  3498 		{
  3494 		{
  3499 		User::WaitForRequest(reqStat);
  3495 		User::WaitForRequest(reqStat);
  3500 		User::WaitForRequest(reqStat2);
  3496 		User::WaitForRequest(reqStat2);
  3501 		User::WaitForRequest(reqStat7);
  3497 		User::WaitForRequest(reqStat7);
  3502 
  3498 
  3503 		test(reqStat==KErrNone);
  3499 		test_KErrNone(reqStat.Int());
  3504 		test(reqStat2==KErrNone);
  3500 		test_KErrNone(reqStat2.Int());
  3505 		test(reqStat3==KRequestPending);
  3501 		test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3506 		test(reqStat4==KRequestPending);
  3502 		test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3507 		test(reqStat5==KRequestPending);
  3503 		test_Value(reqStat5.Int(), reqStat5==KRequestPending);
  3508 		test(reqStat6==KRequestPending);
  3504 		test_Value(reqStat6.Int(), reqStat6==KRequestPending);
  3509 		test(reqStat7==KErrNone);
  3505 		test_KErrNone(reqStat7.Int());
  3510 
  3506 
  3511 		fs.NotifyChange(ENotifyAll,reqStat,path);
  3507 		fs.NotifyChange(ENotifyAll,reqStat,path);
  3512 		fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3508 		fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3513 		fs.NotifyChange(ENotifyDisk,reqStat7,path);
  3509 		fs.NotifyChange(ENotifyDisk,reqStat7,path);
  3514 
  3510 
  3515 		test(reqStat==KRequestPending);
  3511 		test_Value(reqStat.Int(), reqStat==KRequestPending);
  3516 		test(reqStat2==KRequestPending);
  3512 		test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3517 		test(reqStat7==KRequestPending);
  3513 		test_Value(reqStat7.Int(), reqStat7==KRequestPending);
  3518 
  3514 
  3519 		r=TheFs.SetVolumeLabel(currentVolName,driveNum);
  3515 		r=TheFs.SetVolumeLabel(currentVolName,driveNum);
  3520 		test_KErrNone(r);
  3516 		test_KErrNone(r);
  3521 
  3517 
  3522 		User::WaitForRequest(reqStat);
  3518 		User::WaitForRequest(reqStat);
  3523 		User::WaitForRequest(reqStat2);
  3519 		User::WaitForRequest(reqStat2);
  3524 		User::WaitForRequest(reqStat7);
  3520 		User::WaitForRequest(reqStat7);
  3525 
  3521 
  3526 		test(reqStat==KErrNone);
  3522 		test_KErrNone(reqStat.Int());
  3527 		test(reqStat2==KErrNone);
  3523 		test_KErrNone(reqStat2.Int());
  3528 		test(reqStat3==KRequestPending);
  3524 		test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3529 		test(reqStat4==KRequestPending);
  3525 		test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3530 		test(reqStat5==KRequestPending);
  3526 		test_Value(reqStat5.Int(), reqStat5==KRequestPending);
  3531 		test(reqStat6==KRequestPending);
  3527 		test_Value(reqStat6.Int(), reqStat6==KRequestPending);
  3532 		test(reqStat7==KErrNone);
  3528 		test_KErrNone(reqStat7.Int());
  3533 
  3529 
  3534 		r=TheFs.Volume(volInfo,driveNum);
  3530 		r=TheFs.Volume(volInfo,driveNum);
  3535 		test_KErrNone(r);
  3531 		test_KErrNone(r);
  3536 		test(volInfo.iName==currentVolName);
  3532 		test(volInfo.iName==currentVolName);
  3537 
  3533 
  3538 		fs.NotifyChangeCancel();
  3534 		fs.NotifyChangeCancel();
  3539 
  3535 
  3540 		User::WaitForRequest(reqStat3);
  3536 		User::WaitForRequest(reqStat3);
  3541 		test(reqStat3==KErrCancel);
  3537 		test_Value(reqStat3.Int(), reqStat3==KErrCancel);
  3542 		User::WaitForRequest(reqStat4);
  3538 		User::WaitForRequest(reqStat4);
  3543 		test(reqStat4==KErrCancel);
  3539 		test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3544 		User::WaitForRequest(reqStat5);
  3540 		User::WaitForRequest(reqStat5);
  3545 		test(reqStat5==KErrCancel);
  3541 		test_Value(reqStat5.Int(), reqStat5==KErrCancel);
  3546 		User::WaitForRequest(reqStat6);
  3542 		User::WaitForRequest(reqStat6);
  3547 		test(reqStat6==KErrCancel);
  3543 		test_Value(reqStat6.Int(), reqStat6==KErrCancel);
  3548 		}
  3544 		}
  3549 
  3545 
  3550 	else	//	RFs::SetVolumeLabel() doesn't work on subst drives
  3546 	else	//	RFs::SetVolumeLabel() doesn't work on subst drives
  3551 		{
  3547 		{
  3552 		fs.NotifyChangeCancel();
  3548 		fs.NotifyChangeCancel();
  3569 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3565 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3570 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3566 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3571 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3567 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3572 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3568 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3573 
  3569 
  3574 	test(reqStat==KRequestPending);
  3570 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3575 	test(reqStat2==KRequestPending);
  3571 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3576 	test(reqStat3==KRequestPending);
  3572 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3577 	test(reqStat4==KRequestPending);
  3573 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3578 
  3574 
  3579 	r=file.Rename(_L("\\F32-TST\\NOTIFY\\OldFile.abc"));
  3575 	r=file.Rename(_L("\\F32-TST\\NOTIFY\\OldFile.abc"));
  3580 	test_Value(r, r == KErrNone||r==KErrAlreadyExists);
  3576 	test_Value(r, r == KErrNone||r==KErrAlreadyExists);
  3581 	User::WaitForRequest(reqStat);
  3577 	User::WaitForRequest(reqStat);
  3582 	User::WaitForRequest(reqStat2);
  3578 	User::WaitForRequest(reqStat2);
  3583 	User::WaitForRequest(reqStat3);
  3579 	User::WaitForRequest(reqStat3);
  3584 	test(reqStat==KErrNone);
  3580 	test_KErrNone(reqStat.Int());
  3585 	test(reqStat2==KErrNone);
  3581 	test_KErrNone(reqStat2.Int());
  3586 	test(reqStat3==KErrNone);
  3582 	test_KErrNone(reqStat3.Int());
  3587 	test(reqStat4==KRequestPending);	//	Monitoring ENotifyDir
  3583 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	Monitoring ENotifyDir
  3588 	file.Close();
  3584 	file.Close();
  3589 	fs.NotifyChangeCancel();
  3585 	fs.NotifyChangeCancel();
  3590 	User::WaitForRequest(reqStat4);
  3586 	User::WaitForRequest(reqStat4);
  3591 	test(reqStat4==KErrCancel);
  3587 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3592 
  3588 
  3593 	path=_L("\\F32-TST\\NOTIFY\\OldFile.abc");
  3589 	path=_L("\\F32-TST\\NOTIFY\\OldFile.abc");
  3594 
  3590 
  3595 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\OldFile.abc"),EFileShareExclusive|EFileWrite);
  3591 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\OldFile.abc"),EFileShareExclusive|EFileWrite);
  3596 	test_KErrNone(r);
  3592 	test_KErrNone(r);
  3597 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3593 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3598 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3594 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3599 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3595 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3600 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3596 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3601 
  3597 
  3602 	test(reqStat==KRequestPending);
  3598 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3603 	test(reqStat2==KRequestPending);
  3599 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3604 	test(reqStat3==KRequestPending);
  3600 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3605 	User::WaitForRequest(reqStat4);
  3601 	User::WaitForRequest(reqStat4);
  3606 	test(reqStat4==KErrArgument);
  3602 	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
  3607 
  3603 
  3608 	r=file.Rename(_L("\\F32-TST\\NOTIFY\\NewFile.xyz"));
  3604 	r=file.Rename(_L("\\F32-TST\\NOTIFY\\NewFile.xyz"));
  3609 	test_KErrNone(r);
  3605 	test_KErrNone(r);
  3610 	User::WaitForRequest(reqStat);
  3606 	User::WaitForRequest(reqStat);
  3611 	User::WaitForRequest(reqStat2);
  3607 	User::WaitForRequest(reqStat2);
  3612 	User::WaitForRequest(reqStat3);
  3608 	User::WaitForRequest(reqStat3);
  3613 	test(reqStat==KErrNone);
  3609 	test_KErrNone(reqStat.Int());
  3614 	test(reqStat2==KErrNone);
  3610 	test_KErrNone(reqStat2.Int());
  3615 	test(reqStat3==KErrNone);
  3611 	test_KErrNone(reqStat3.Int());
  3616 	test(reqStat4==KErrArgument);
  3612 	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
  3617 	file.Close();
  3613 	file.Close();
  3618 
  3614 
  3619 //	RFs::Rename()
  3615 //	RFs::Rename()
  3620 	test.Next(_L("RFs::Rename()"));
  3616 	test.Next(_L("RFs::Rename()"));
  3621 	path=_L("\\F32-TST\\NOTIFY\\");
  3617 	path=_L("\\F32-TST\\NOTIFY\\");
  3622 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3618 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3623 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3619 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3624 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3620 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3625 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3621 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3626 
  3622 
  3627 	test(reqStat==KRequestPending);
  3623 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3628 	test(reqStat2==KRequestPending);
  3624 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3629 	test(reqStat3==KRequestPending);
  3625 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3630 	test(reqStat4==KRequestPending);
  3626 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3631 
  3627 
  3632 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\NewFile.xyz"),_L("\\F32-TST\\NOTIFY\\NewerFile.cat"));
  3628 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\NewFile.xyz"),_L("\\F32-TST\\NOTIFY\\NewerFile.cat"));
  3633 	test_KErrNone(r);
  3629 	test_KErrNone(r);
  3634 	User::WaitForRequest(reqStat);
  3630 	User::WaitForRequest(reqStat);
  3635 	User::WaitForRequest(reqStat2);
  3631 	User::WaitForRequest(reqStat2);
  3636 	User::WaitForRequest(reqStat3);
  3632 	User::WaitForRequest(reqStat3);
  3637 	test(reqStat==KErrNone);
  3633 	test_KErrNone(reqStat.Int());
  3638 	test(reqStat2==KErrNone);
  3634 	test_KErrNone(reqStat2.Int());
  3639 	test(reqStat3==KErrNone);
  3635 	test_KErrNone(reqStat3.Int());
  3640 	test(reqStat4==KRequestPending);	//	Changed a file not a directory entry
  3636 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	Changed a file not a directory entry
  3641 	fs.NotifyChangeCancel();
  3637 	fs.NotifyChangeCancel();
  3642 
  3638 
  3643 	test(reqStat==KErrNone);
  3639 	test_KErrNone(reqStat.Int());
  3644 	test(reqStat2==KErrNone);
  3640 	test_KErrNone(reqStat2.Int());
  3645 	test(reqStat3==KErrNone);
  3641 	test_KErrNone(reqStat3.Int());
  3646 	User::WaitForRequest(reqStat4);
  3642 	User::WaitForRequest(reqStat4);
  3647 	test(reqStat4==KErrCancel);
  3643 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3648 
  3644 
  3649 	path=_L("\\F32-TST\\NOTIFY\\NewerFile.cat");
  3645 	path=_L("\\F32-TST\\NOTIFY\\NewerFile.cat");
  3650 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3646 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3651 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3647 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3652 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3648 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3653 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3649 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3654 
  3650 
  3655 	test(reqStat==KRequestPending);
  3651 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3656 	test(reqStat2==KRequestPending);
  3652 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3657 	test(reqStat3==KRequestPending);
  3653 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3658 	User::WaitForRequest(reqStat4);
  3654 	User::WaitForRequest(reqStat4);
  3659 	test(reqStat4==KErrArgument);
  3655 	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
  3660 
  3656 
  3661 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\NewerFile.cat"),_L("\\F32-TST\\NOTIFY\\Original.dog"));
  3657 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\NewerFile.cat"),_L("\\F32-TST\\NOTIFY\\Original.dog"));
  3662 	test_KErrNone(r);
  3658 	test_KErrNone(r);
  3663 	User::WaitForRequest(reqStat);
  3659 	User::WaitForRequest(reqStat);
  3664 	User::WaitForRequest(reqStat2);
  3660 	User::WaitForRequest(reqStat2);
  3665 	User::WaitForRequest(reqStat3);
  3661 	User::WaitForRequest(reqStat3);
  3666 	test(reqStat==KErrNone);
  3662 	test_KErrNone(reqStat.Int());
  3667 	test(reqStat2==KErrNone);
  3663 	test_KErrNone(reqStat2.Int());
  3668 	test(reqStat3==KErrNone);
  3664 	test_KErrNone(reqStat3.Int());
  3669 
  3665 
  3670 	path=_L("\\F32-TST\\NOTIFY\\");
  3666 	path=_L("\\F32-TST\\NOTIFY\\");
  3671 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3667 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3672 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3668 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3673 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3669 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3674 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3670 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3675 
  3671 
  3676 	test(reqStat==KRequestPending);
  3672 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3677 	test(reqStat2==KRequestPending);
  3673 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3678 	test(reqStat3==KRequestPending);
  3674 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3679 	test(reqStat4==KRequestPending);
  3675 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3680 
  3676 
  3681 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\"),_L("\\F32-TST\\NOTIFY_TEMP\\"));
  3677 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\"),_L("\\F32-TST\\NOTIFY_TEMP\\"));
  3682 	test_KErrNone(r);
  3678 	test_KErrNone(r);
  3683 	User::WaitForRequest(reqStat);
  3679 	User::WaitForRequest(reqStat);
  3684 	User::WaitForRequest(reqStat2);
  3680 	User::WaitForRequest(reqStat2);
  3685 	User::WaitForRequest(reqStat3);
  3681 	User::WaitForRequest(reqStat3);
  3686 	User::WaitForRequest(reqStat4);
  3682 	User::WaitForRequest(reqStat4);
  3687 	test(reqStat==KErrNone);
  3683 	test_KErrNone(reqStat.Int());
  3688 	test(reqStat2==KErrNone);
  3684 	test_KErrNone(reqStat2.Int());
  3689 	test(reqStat3==KErrNone);	//	Changed a directory entry but notified anyway despite
  3685 	test_KErrNone(reqStat3.Int());	//	Changed a directory entry but notified anyway despite
  3690 	test(reqStat4==KErrNone);	//	requesting file notification only because the path we
  3686 	test_KErrNone(reqStat4.Int());	//	requesting file notification only because the path we
  3691 								//	were monitoring has changed
  3687 									//	were monitoring has changed
  3692 
  3688 
  3693 	path=_L("\\F32-TST\\NOTIFY_TEMP\\Original.dog");
  3689 	path=_L("\\F32-TST\\NOTIFY_TEMP\\Original.dog");
  3694 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3690 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3695 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3691 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3696 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3692 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3697 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3693 	fs.NotifyChange(ENotifyDir,reqStat4,path);
  3698 
  3694 
  3699 	test(reqStat==KRequestPending);
  3695 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3700 	test(reqStat2==KRequestPending);
  3696 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3701 	test(reqStat3==KRequestPending);
  3697 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3702 	User::WaitForRequest(reqStat4);
  3698 	User::WaitForRequest(reqStat4);
  3703 	test(reqStat4==KErrArgument);
  3699 	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
  3704 
  3700 
  3705 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY_TEMP\\"),_L("\\F32-TST\\NOTIFY\\"));
  3701 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY_TEMP\\"),_L("\\F32-TST\\NOTIFY\\"));
  3706 	test_KErrNone(r);
  3702 	test_KErrNone(r);
  3707 	User::WaitForRequest(reqStat);
  3703 	User::WaitForRequest(reqStat);
  3708 	User::WaitForRequest(reqStat2);
  3704 	User::WaitForRequest(reqStat2);
  3709 	User::WaitForRequest(reqStat3);
  3705 	User::WaitForRequest(reqStat3);
  3710 	test(reqStat==KErrNone);			//	Modified a directory above the level at which we
  3706 	test_KErrNone(reqStat.Int());			//	Modified a directory above the level at which we
  3711 	test(reqStat2==KErrNone);			//	are monitoring for changes - we must be notified
  3707 	test_KErrNone(reqStat2.Int());			//	are monitoring for changes - we must be notified
  3712 	test(reqStat3==KErrNone);			//	anyway because the path has changed
  3708 	test_KErrNone(reqStat3.Int());			//	anyway because the path has changed
  3713 
  3709 
  3714 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3710 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3715 	test(reqStat==KRequestPending);
  3711 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3716 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3712 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3717 	test(reqStat2==KRequestPending);
  3713 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3718 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3714 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3719 	test(reqStat3==KRequestPending);
  3715 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3720 
  3716 
  3721 	fs.NotifyChangeCancel(reqStat);
  3717 	fs.NotifyChangeCancel(reqStat);
  3722 	User::WaitForRequest(reqStat);
  3718 	User::WaitForRequest(reqStat);
  3723 	test(reqStat==KErrCancel);
  3719 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  3724 	fs.NotifyChangeCancel(reqStat2);
  3720 	fs.NotifyChangeCancel(reqStat2);
  3725 	User::WaitForRequest(reqStat2);
  3721 	User::WaitForRequest(reqStat2);
  3726 	test(reqStat2==KErrCancel);
  3722 	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
  3727 	fs.NotifyChangeCancel(reqStat3);
  3723 	fs.NotifyChangeCancel(reqStat3);
  3728 	User::WaitForRequest(reqStat3);
  3724 	User::WaitForRequest(reqStat3);
  3729 	test(reqStat3==KErrCancel);
  3725 	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
  3730 
  3726 
  3731 	path=_L("\\F32-TST\\NOTIFY\\Original.dog");
  3727 	path=_L("\\F32-TST\\NOTIFY\\Original.dog");
  3732 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3728 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3733 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3729 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3734 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3730 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3735 
  3731 
  3736 	test(reqStat==KRequestPending);
  3732 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3737 	test(reqStat2==KRequestPending);
  3733 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3738 	test(reqStat3==KRequestPending);
  3734 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3739 
  3735 
  3740 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Original.dog"));
  3736 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Original.dog"));
  3741 	test_KErrNone(r);
  3737 	test_KErrNone(r);
  3742 	User::WaitForRequest(reqStat);
  3738 	User::WaitForRequest(reqStat);
  3743 	User::WaitForRequest(reqStat2);
  3739 	User::WaitForRequest(reqStat2);
  3744 	User::WaitForRequest(reqStat3);
  3740 	User::WaitForRequest(reqStat3);
  3745 	test(reqStat==KErrNone);
  3741 	test_KErrNone(reqStat.Int());
  3746 	test(reqStat2==KErrNone);
  3742 	test_KErrNone(reqStat2.Int());
  3747 	test(reqStat3==KErrNone);
  3743 	test_KErrNone(reqStat3.Int());
  3748 
  3744 
  3749 	path=_L("\\F32-TST\\NOTIFY\\");
  3745 	path=_L("\\F32-TST\\NOTIFY\\");
  3750 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3746 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3751 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3747 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3752 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3748 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3753 
  3749 
  3754 	test(reqStat==KRequestPending);
  3750 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3755 	test(reqStat2==KRequestPending);
  3751 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3756 	test(reqStat3==KRequestPending);
  3752 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3757 
  3753 
  3758 	r=TheFs.Rename(_L("\\F32-TST\\"),_L("\\F32-TEST\\"));
  3754 	r=TheFs.Rename(_L("\\F32-TST\\"),_L("\\F32-TEST\\"));
  3759 	test_KErrNone(r);
  3755 	test_KErrNone(r);
  3760 	User::WaitForRequest(reqStat);
  3756 	User::WaitForRequest(reqStat);
  3761 	User::WaitForRequest(reqStat2);
  3757 	User::WaitForRequest(reqStat2);
  3762 	User::WaitForRequest(reqStat3);
  3758 	User::WaitForRequest(reqStat3);
  3763 	test(reqStat==KErrNone);			//	Modified a directory above the level at which we
  3759 	test_KErrNone(reqStat.Int());			//	Modified a directory above the level at which we
  3764 	test(reqStat2==KErrNone);			//	are monitoring for changes but we receive notification
  3760 	test_KErrNone(reqStat2.Int());			//	are monitoring for changes but we receive notification
  3765 	test(reqStat3==KErrNone);			//	because the notification path has been changed
  3761 	test_KErrNone(reqStat3.Int());			//	because the notification path has been changed
  3766 
  3762 
  3767 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3763 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3768 	//	Notification request is submitted, despite the subject's disappearance
  3764 	//	Notification request is submitted, despite the subject's disappearance
  3769 	test(reqStat==KRequestPending);
  3765 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3770 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3766 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3771 	//	Notification request is submitted, despite the subject's disappearance
  3767 	//	Notification request is submitted, despite the subject's disappearance
  3772 	test(reqStat2==KRequestPending);
  3768 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3773 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3769 	fs.NotifyChange(ENotifyFile,reqStat3,path);
  3774 	//	Notification request is submitted, despite the subject's disappearance
  3770 	//	Notification request is submitted, despite the subject's disappearance
  3775 	test(reqStat3==KRequestPending);
  3771 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3776 
  3772 
  3777 	fs.NotifyChangeCancel(reqStat);
  3773 	fs.NotifyChangeCancel(reqStat);
  3778 	User::WaitForRequest(reqStat);
  3774 	User::WaitForRequest(reqStat);
  3779 	test(reqStat==KErrCancel);
  3775 	test_Value(reqStat.Int(), reqStat==KErrCancel);
  3780 	fs.NotifyChangeCancel(reqStat2);
  3776 	fs.NotifyChangeCancel(reqStat2);
  3781 	User::WaitForRequest(reqStat2);
  3777 	User::WaitForRequest(reqStat2);
  3782 	test(reqStat2==KErrCancel);
  3778 	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
  3783 	fs.NotifyChangeCancel(reqStat3);
  3779 	fs.NotifyChangeCancel(reqStat3);
  3784 	User::WaitForRequest(reqStat3);
  3780 	User::WaitForRequest(reqStat3);
  3785 	test(reqStat3==KErrCancel);
  3781 	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
  3786 
  3782 
  3787 	path=_L("\\F32-TEST\\NOTIFY\\");
  3783 	path=_L("\\F32-TEST\\NOTIFY\\");
  3788 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3784 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3789 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3785 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3790 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3786 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3791 
  3787 
  3792 	test(reqStat==KRequestPending);
  3788 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3793 	test(reqStat2==KRequestPending);
  3789 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3794 	test(reqStat3==KRequestPending);
  3790 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3795 
  3791 
  3796 	r=TheFs.Rename(_L("\\F32-TEST\\NOTIFY\\"),_L("\\F32-TEST\\NOTIFY_CHANGED\\"));
  3792 	r=TheFs.Rename(_L("\\F32-TEST\\NOTIFY\\"),_L("\\F32-TEST\\NOTIFY_CHANGED\\"));
  3797 	test_KErrNone(r);
  3793 	test_KErrNone(r);
  3798 
  3794 
  3799 	User::WaitForRequest(reqStat);
  3795 	User::WaitForRequest(reqStat);
  3800 	User::WaitForRequest(reqStat2);
  3796 	User::WaitForRequest(reqStat2);
  3801 	User::WaitForRequest(reqStat3);
  3797 	User::WaitForRequest(reqStat3);
  3802 
  3798 
  3803 	test(reqStat==KErrNone);			//	Rename the directory we were monitoring
  3799 	test_KErrNone(reqStat.Int());			//	Rename the directory we were monitoring
  3804 	test(reqStat2==KErrNone);
  3800 	test_KErrNone(reqStat2.Int());
  3805 	test(reqStat3==KErrNone);
  3801 	test_KErrNone(reqStat3.Int());
  3806 
  3802 
  3807 //	Tidy up the test directory before continuing (while testing notifications of renaming to the monitored directory)
  3803 //	Tidy up the test directory before continuing (while testing notifications of renaming to the monitored directory)
  3808 
  3804 
  3809 	path=_L("\\F32-TST\\NOTIFY_CHANGED\\");
  3805 	path=_L("\\F32-TST\\NOTIFY_CHANGED\\");
  3810 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3806 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3811 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3807 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3812 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3808 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3813 	fs.NotifyChange(ENotifyFile,reqStat4,path);
  3809 	fs.NotifyChange(ENotifyFile,reqStat4,path);
  3814 
  3810 
  3815 	test(reqStat==KRequestPending);
  3811 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3816 	test(reqStat2==KRequestPending);
  3812 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3817 	test(reqStat3==KRequestPending);
  3813 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3818 	test(reqStat4==KRequestPending);
  3814 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3819 
  3815 
  3820 	r=TheFs.Rename(_L("\\F32-TEST\\"),_L("\\F32-TST\\"));
  3816 	r=TheFs.Rename(_L("\\F32-TEST\\"),_L("\\F32-TST\\"));
  3821 	test_KErrNone(r);
  3817 	test_KErrNone(r);
  3822 
  3818 
  3823 	User::WaitForRequest(reqStat);
  3819 	User::WaitForRequest(reqStat);
  3824 	User::WaitForRequest(reqStat2);
  3820 	User::WaitForRequest(reqStat2);
  3825 	User::WaitForRequest(reqStat3);
  3821 	User::WaitForRequest(reqStat3);
  3826 
  3822 
  3827 	test(reqStat==KErrNone);			//	Renaming to (under) the directory we were monitoring
  3823 	test_KErrNone(reqStat.Int());			//	Renaming to (under) the directory we were monitoring
  3828 	test(reqStat2==KErrNone);
  3824 	test_KErrNone(reqStat2.Int());
  3829 	test(reqStat3==KErrNone);
  3825 	test_KErrNone(reqStat3.Int());
  3830 	test(reqStat4==KRequestPending);
  3826 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3831 
  3827 
  3832 	fs.NotifyChangeCancel(reqStat4);
  3828 	fs.NotifyChangeCancel(reqStat4);
  3833 	User::WaitForRequest(reqStat4);
  3829 	User::WaitForRequest(reqStat4);
  3834 	test(reqStat4==KErrCancel);
  3830 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3835 
  3831 
  3836 	path=_L("\\F32-TST\\NOTIFY\\");
  3832 	path=_L("\\F32-TST\\NOTIFY\\");
  3837 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3833 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3838 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3834 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
  3839 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3835 	fs.NotifyChange(ENotifyDir,reqStat3,path);
  3840 	fs.NotifyChange(ENotifyFile,reqStat4,path);
  3836 	fs.NotifyChange(ENotifyFile,reqStat4,path);
  3841 
  3837 
  3842 	test(reqStat==KRequestPending);
  3838 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3843 	test(reqStat2==KRequestPending);
  3839 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3844 	test(reqStat3==KRequestPending);
  3840 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3845 	test(reqStat4==KRequestPending);
  3841 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3846 
  3842 
  3847 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY_CHANGED\\"),_L("\\F32-TST\\NOTIFY\\"));
  3843 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY_CHANGED\\"),_L("\\F32-TST\\NOTIFY\\"));
  3848 	test_KErrNone(r);
  3844 	test_KErrNone(r);
  3849 
  3845 
  3850 	User::WaitForRequest(reqStat);
  3846 	User::WaitForRequest(reqStat);
  3851 	User::WaitForRequest(reqStat2);
  3847 	User::WaitForRequest(reqStat2);
  3852 	User::WaitForRequest(reqStat3);
  3848 	User::WaitForRequest(reqStat3);
  3853 
  3849 
  3854 	test(reqStat==KErrNone);			//	Renaming to the directory we were monitoring
  3850 	test_KErrNone(reqStat.Int());			//	Renaming to the directory we were monitoring
  3855 	test(reqStat2==KErrNone);
  3851 	test_KErrNone(reqStat2.Int());
  3856 	test(reqStat3==KErrNone);
  3852 	test_KErrNone(reqStat3.Int());
  3857 	test(reqStat4==KRequestPending);
  3853 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3858 
  3854 
  3859 	fs.NotifyChangeCancel(reqStat4);
  3855 	fs.NotifyChangeCancel(reqStat4);
  3860 	User::WaitForRequest(reqStat4);
  3856 	User::WaitForRequest(reqStat4);
  3861 	test(reqStat4==KErrCancel);
  3857 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3862 
  3858 
  3863 //	Test combinations of notify types
  3859 //	Test combinations of notify types
  3864 	test.Next(_L("Test combinations of notify types"));
  3860 	test.Next(_L("Test combinations of notify types"));
  3865 
  3861 
  3866 	path=_L("\\F32-TST\\NOTIFY\\");
  3862 	path=_L("\\F32-TST\\NOTIFY\\");
  3867 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3863 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3868 	fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path);
  3864 	fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path);
  3869 	fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyFile),reqStat3,path);
  3865 	fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyFile),reqStat3,path);
  3870 	fs.NotifyChange((TNotifyType)(ENotifyDisk|ENotifyAttributes),reqStat4,path);
  3866 	fs.NotifyChange((TNotifyType)(ENotifyDisk|ENotifyAttributes),reqStat4,path);
  3871 
  3867 
  3872 	test(reqStat==KRequestPending);
  3868 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3873 	test(reqStat2==KRequestPending);
  3869 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3874 	test(reqStat3==KRequestPending);
  3870 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3875 	test(reqStat4==KRequestPending);
  3871 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3876 
  3872 
  3877 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite);
  3873 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite);
  3878 	test_KErrNone(r);
  3874 	test_KErrNone(r);
  3879 	User::WaitForRequest(reqStat);
  3875 	User::WaitForRequest(reqStat);
  3880 	User::WaitForRequest(reqStat2);
  3876 	User::WaitForRequest(reqStat2);
  3881 	User::WaitForRequest(reqStat3);
  3877 	User::WaitForRequest(reqStat3);
  3882 	test(reqStat==KErrNone);
  3878 	test_KErrNone(reqStat.Int());
  3883 	test(reqStat2==KErrNone);
  3879 	test_KErrNone(reqStat2.Int());
  3884 	test(reqStat3==KErrNone);
  3880 	test_KErrNone(reqStat3.Int());
  3885 	test(reqStat4==KRequestPending);	//	Monitoring ENotifyAttributes|ENotifyDisk
  3881 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	Monitoring ENotifyAttributes|ENotifyDisk
  3886 	file.Close();
  3882 	file.Close();
  3887 	fs.NotifyChangeCancel(reqStat4);
  3883 	fs.NotifyChangeCancel(reqStat4);
  3888 	User::WaitForRequest(reqStat4);
  3884 	User::WaitForRequest(reqStat4);
  3889 	test(reqStat4==KErrCancel);
  3885 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3890 
  3886 
  3891 //	RFile::SetModified()
  3887 //	RFile::SetModified()
  3892 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3888 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3893 	fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path);
  3889 	fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path);
  3894 	fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyFile),reqStat3,path);
  3890 	fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyFile),reqStat3,path);
  3895 	fs.NotifyChange((TNotifyType)(ENotifyDisk|ENotifyAttributes),reqStat4,path);
  3891 	fs.NotifyChange((TNotifyType)(ENotifyDisk|ENotifyAttributes),reqStat4,path);
  3896 
  3892 
  3897 	test(reqStat==KRequestPending);
  3893 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3898 	test(reqStat2==KRequestPending);
  3894 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3899 	test(reqStat3==KRequestPending);
  3895 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3900 	test(reqStat4==KRequestPending);
  3896 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3901 
  3897 
  3902 	TTime nowTime;
  3898 	TTime nowTime;
  3903 	nowTime.HomeTime();
  3899 	nowTime.HomeTime();
  3904 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite);
  3900 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite);
  3905 	test_KErrNone(r);
  3901 	test_KErrNone(r);
  3906 	test(reqStat==KRequestPending);
  3902 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3907 	file.SetModified(now);
  3903 	file.SetModified(now);
  3908 	file.Close();
  3904 	file.Close();
  3909 	User::WaitForRequest(reqStat);
  3905 	User::WaitForRequest(reqStat);
  3910 	User::WaitForRequest(reqStat2);
  3906 	User::WaitForRequest(reqStat2);
  3911 	User::WaitForRequest(reqStat4);
  3907 	User::WaitForRequest(reqStat4);
  3912 	test(reqStat==KErrNone);
  3908 	test_KErrNone(reqStat.Int());
  3913 	test(reqStat2==KErrNone);
  3909 	test_KErrNone(reqStat2.Int());
  3914 	test(reqStat3==KRequestPending);
  3910 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3915 	test(reqStat4==KErrNone);
  3911 	test_KErrNone(reqStat4.Int());
  3916 	fs.NotifyChangeCancel();
  3912 	fs.NotifyChangeCancel();
  3917 	User::WaitForRequest(reqStat3);
  3913 	User::WaitForRequest(reqStat3);
  3918 	test(reqStat3==KErrCancel);
  3914 	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
  3919 
  3915 
  3920 //	RFile::Write()
  3916 //	RFile::Write()
  3921 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3917 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3922 	fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path);
  3918 	fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path);
  3923 	fs.NotifyChange((TNotifyType)(ENotifyFile|ENotifyWrite),reqStat3,path);
  3919 	fs.NotifyChange((TNotifyType)(ENotifyFile|ENotifyWrite),reqStat3,path);
  3924 	fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyWrite),reqStat4,path);
  3920 	fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyWrite),reqStat4,path);
  3925 
  3921 
  3926 	test(reqStat==KRequestPending);
  3922 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3927 	test(reqStat2==KRequestPending);
  3923 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3928 	test(reqStat3==KRequestPending);
  3924 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3929 	test(reqStat4==KRequestPending);
  3925 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3930 
  3926 
  3931 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite);
  3927 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite);
  3932 	test_KErrNone(r);
  3928 	test_KErrNone(r);
  3933 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
  3929 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
  3934 	file.Close();
  3930 	file.Close();
  3935 	User::WaitForRequest(reqStat);
  3931 	User::WaitForRequest(reqStat);
  3936 	User::WaitForRequest(reqStat3);
  3932 	User::WaitForRequest(reqStat3);
  3937 	User::WaitForRequest(reqStat4);
  3933 	User::WaitForRequest(reqStat4);
  3938 	test(reqStat==KErrNone);
  3934 	test_KErrNone(reqStat.Int());
  3939 	test(reqStat2==KRequestPending);
  3935 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3940 	test(reqStat3==KErrNone);
  3936 	test_KErrNone(reqStat3.Int());
  3941 	test(reqStat4==KErrNone);
  3937 	test_KErrNone(reqStat4.Int());
  3942 	fs.NotifyChangeCancel(reqStat2);	//	Cancels all outstanding notification requests
  3938 	fs.NotifyChangeCancel(reqStat2);	//	Cancels all outstanding notification requests
  3943 	User::WaitForRequest(reqStat2);
  3939 	User::WaitForRequest(reqStat2);
  3944 	test(reqStat2==KErrCancel);
  3940 	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
  3945 
  3941 
  3946 //	RFs::Delete()
  3942 //	RFs::Delete()
  3947 	test.Next(_L("RFs::Delete()"));
  3943 	test.Next(_L("RFs::Delete()"));
  3948 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3944 	fs.NotifyChange(ENotifyAll,reqStat,path);
  3949 	fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path);
  3945 	fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path);
  3950 	fs.NotifyChange((TNotifyType)(ENotifyFile|ENotifyWrite),reqStat3,path);
  3946 	fs.NotifyChange((TNotifyType)(ENotifyFile|ENotifyWrite),reqStat3,path);
  3951 	fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyWrite),reqStat4,path);
  3947 	fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyWrite),reqStat4,path);
  3952 
  3948 
  3953 	test(reqStat==KRequestPending);
  3949 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  3954 	test(reqStat2==KRequestPending);
  3950 	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
  3955 	test(reqStat3==KRequestPending);
  3951 	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
  3956 	test(reqStat4==KRequestPending);
  3952 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3957 
  3953 
  3958 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Munchkin.msg"));
  3954 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Munchkin.msg"));
  3959 	test_KErrNone(r);
  3955 	test_KErrNone(r);
  3960 	User::WaitForRequest(reqStat);
  3956 	User::WaitForRequest(reqStat);
  3961 	User::WaitForRequest(reqStat2);
  3957 	User::WaitForRequest(reqStat2);
  3962 	User::WaitForRequest(reqStat3);
  3958 	User::WaitForRequest(reqStat3);
  3963 	test(reqStat==KErrNone);
  3959 	test_KErrNone(reqStat.Int());
  3964 	test(reqStat2==KErrNone);
  3960 	test_KErrNone(reqStat2.Int());
  3965 	test(reqStat3==KErrNone);
  3961 	test_KErrNone(reqStat3.Int());
  3966 	test(reqStat4==KRequestPending);
  3962 	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
  3967 	fs.NotifyChangeCancel(reqStat4);
  3963 	fs.NotifyChangeCancel(reqStat4);
  3968 	User::WaitForRequest(reqStat4);
  3964 	User::WaitForRequest(reqStat4);
  3969 	test(reqStat4==KErrCancel);
  3965 	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
  3970 
  3966 
  3971 	fs.Close();
  3967 	fs.Close();
  3972 	}
  3968 	}
  3973 
  3969 
  3974 #if defined __EPOC32__ && defined __INCLUDE_MANUAL_TESTS__
  3970 #if defined __EPOC32__ && defined __INCLUDE_MANUAL_TESTS__
  3996 	test(driveInfo.iType == EMediaHardDisk);
  3992 	test(driveInfo.iType == EMediaHardDisk);
  3997 
  3993 
  3998 
  3994 
  3999 	// ask the user to eject the media
  3995 	// ask the user to eject the media
  4000 	TheFs.NotifyChange(ENotifyEntry,reqStat);
  3996 	TheFs.NotifyChange(ENotifyEntry,reqStat);
  4001 	test(reqStat==KRequestPending);
  3997 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  4002 	test.Printf(_L("Please eject media on drive %C...\n"), 'A' + driveNum);
  3998 	test.Printf(_L("Please eject media on drive %C...\n"), 'A' + driveNum);
  4003 	User::WaitForRequest(reqStat);
  3999 	User::WaitForRequest(reqStat);
  4004 	test.Printf(_L("Done.\n"));
  4000 	test.Printf(_L("Done.\n"));
  4005 	TInt reqInt=reqStat.Int();
  4001 	TInt reqInt=reqStat.Int();
  4006 	test(reqInt==KErrNone);
  4002 	test_KErrNone(reqInt);
  4007 	User::WaitForRequest(reqStat);
  4003 	User::WaitForRequest(reqStat);
  4008 
  4004 
  4009 	// verify TDriveInfo.iType == EMediaNotPresent
  4005 	// verify TDriveInfo.iType == EMediaNotPresent
  4010 	r = fs.Drive(driveInfo, driveNum);
  4006 	r = fs.Drive(driveInfo, driveNum);
  4011 	test_KErrNone(r);
  4007 	test_KErrNone(r);
  4013 	test(driveInfo.iType == EMediaNotPresent);
  4009 	test(driveInfo.iType == EMediaNotPresent);
  4014 
  4010 
  4015 
  4011 
  4016 	// ask the user to re-insert the media
  4012 	// ask the user to re-insert the media
  4017 	TheFs.NotifyChange(ENotifyEntry,reqStat);
  4013 	TheFs.NotifyChange(ENotifyEntry,reqStat);
  4018 	test(reqStat==KRequestPending);
  4014 	test_Value(reqStat.Int(), reqStat==KRequestPending);
  4019 	test.Printf(_L("Please re-insert media...\n"));
  4015 	test.Printf(_L("Please re-insert media...\n"));
  4020 	User::WaitForRequest(reqStat);
  4016 	User::WaitForRequest(reqStat);
  4021 	test.Printf(_L("Done.\n"));
  4017 	test.Printf(_L("Done.\n"));
  4022 	reqInt = reqStat.Int();
  4018 	reqInt = reqStat.Int();
  4023 	test(reqInt==KErrNone);
  4019 	test_KErrNone(reqInt);
  4024 	User::WaitForRequest(reqStat);
  4020 	User::WaitForRequest(reqStat);
  4025 
  4021 
  4026 	// verify TDriveInfo.iType == EMediaHardDisk
  4022 	// verify TDriveInfo.iType == EMediaHardDisk
  4027 	r = fs.Drive(driveInfo, driveNum);
  4023 	r = fs.Drive(driveInfo, driveNum);
  4028 	test_KErrNone(r);
  4024 	test_KErrNone(r);
  4061 	TInt r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileShareAny);
  4057 	TInt r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileShareAny);
  4062 	test_KErrNone(r);
  4058 	test_KErrNone(r);
  4063 	TBuf8<596> readBuf;
  4059 	TBuf8<596> readBuf;
  4064 	reader.Read(0, readBuf, 100, readStat1);
  4060 	reader.Read(0, readBuf, 100, readStat1);
  4065 	User::WaitForRequest(readStat1);
  4061 	User::WaitForRequest(readStat1);
  4066 	test(readStat1==KErrNone);
  4062 	test_KErrNone(readStat1.Int());
  4067 	test(readBuf.Length()==0);
  4063 	test_Equal(0, readBuf.Length());
  4068 	reader.Close();
  4064 	reader.Close();
  4069 
  4065 
  4070 	test.Next(_L("Test asynchronous read fails in EFileShareExclusive mode"));
  4066 	test.Next(_L("Test asynchronous read fails in EFileShareExclusive mode"));
  4071 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareExclusive);
  4067 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareExclusive);
  4072 	test_Value(r, r == KErrArgument);
  4068 	test_Value(r, r == KErrArgument);
  4077 
  4073 
  4078 	test.Next(_L("Test asynchronous read is cancelled when file is closed"));
  4074 	test.Next(_L("Test asynchronous read is cancelled when file is closed"));
  4079 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
  4075 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
  4080 	test_KErrNone(r);
  4076 	test_KErrNone(r);
  4081 	reader.Read(0, readBuf, 100, readStat1);
  4077 	reader.Read(0, readBuf, 100, readStat1);
  4082 	test(readStat1==KRequestPending);
  4078 	test_Value(readStat1.Int(), readStat1==KRequestPending);
  4083 	reader.Close();
  4079 	reader.Close();
  4084 	User::WaitForRequest(readStat1);
  4080 	User::WaitForRequest(readStat1);
  4085 	test(readStat1==KErrCancel);
  4081 	test_Value(readStat1.Int(), readStat1==KErrCancel);
  4086 
  4082 
  4087 	test.Next(_L("Test asynchronous read can be cancelled"));
  4083 	test.Next(_L("Test asynchronous read can be cancelled"));
  4088 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
  4084 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
  4089 	test_KErrNone(r);
  4085 	test_KErrNone(r);
  4090 	reader.Read(0, readBuf, 100, readStat1);
  4086 	reader.Read(0, readBuf, 100, readStat1);
  4091 	test(readStat1==KRequestPending);
  4087 	test_Value(readStat1.Int(), readStat1==KRequestPending);
  4092 	reader.ReadCancel(readStat1);
  4088 	reader.ReadCancel(readStat1);
  4093 	User::WaitForRequest(readStat1);
  4089 	User::WaitForRequest(readStat1);
  4094 	test(readStat1==KErrCancel);
  4090 	test_Value(readStat1.Int(), readStat1==KErrCancel);
  4095 	reader.Close();
  4091 	reader.Close();
  4096 
  4092 
  4097 	// DEF105438: File server thread safety issues
  4093 	// DEF105438: File server thread safety issues
  4098 	// Up the priority of this thread so that we can cancel the request before the drive thread
  4094 	// Up the priority of this thread so that we can cancel the request before the drive thread
  4099 	// runs (to test whether cancelling still works...)
  4095 	// runs (to test whether cancelling still works...)
  4101 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
  4097 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
  4102 	test_KErrNone(r);
  4098 	test_KErrNone(r);
  4103 	RThread	thisThread;
  4099 	RThread	thisThread;
  4104 	thisThread.SetPriority(EPriorityRealTime);
  4100 	thisThread.SetPriority(EPriorityRealTime);
  4105 	reader.Read(0, readBuf, 100, readStat1);
  4101 	reader.Read(0, readBuf, 100, readStat1);
  4106 	test(readStat1==KRequestPending);
  4102 	test_Value(readStat1.Int(), readStat1==KRequestPending);
  4107 	reader.ReadCancel(readStat1);
  4103 	reader.ReadCancel(readStat1);
  4108 	test.Printf(_L("readStat1 %d"), readStat1.Int());
  4104 	test.Printf(_L("readStat1 %d"), readStat1.Int());
  4109 	User::WaitForRequest(readStat1);
  4105 	User::WaitForRequest(readStat1);
  4110 	test(readStat1==KErrCancel);
  4106 	test_Value(readStat1.Int(), readStat1==KErrCancel);
  4111 	reader.Close();
  4107 	reader.Close();
  4112 	thisThread.SetPriority(EPriorityNormal);
  4108 	thisThread.SetPriority(EPriorityNormal);
  4113 
  4109 
  4114 	test.Next(_L("Test asynchronous read is notified due to RFile::SetSize()"));
  4110 	test.Next(_L("Test asynchronous read is notified due to RFile::SetSize()"));
  4115 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
  4111 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
  4116 	test_KErrNone(r);
  4112 	test_KErrNone(r);
  4117 	reader.Read(0, readBuf, 100, readStat1);
  4113 	reader.Read(0, readBuf, 100, readStat1);
  4118 	test(readStat1==KRequestPending);
  4114 	test_Value(readStat1.Int(), readStat1==KRequestPending);
  4119 	r = reader.SetSize(100);
  4115 	r = reader.SetSize(100);
  4120 	test_KErrNone(r);
  4116 	test_KErrNone(r);
  4121 	User::WaitForRequest(readStat1);
  4117 	User::WaitForRequest(readStat1);
  4122 	test(readStat1==KErrNone);
  4118 	test_KErrNone(readStat1.Int());
  4123 	test(readBuf.Length() == 100);
  4119 	test_Equal(100, readBuf.Length());
  4124 	r=reader.SetSize(0);
  4120 	r=reader.SetSize(0);
  4125 	test_KErrNone(r);
  4121 	test_KErrNone(r);
  4126 	reader.Close();
  4122 	reader.Close();
  4127 
  4123 
  4128 	test.Next(_L("Test asynchronous read is notified due to RFile::Write()"));
  4124 	test.Next(_L("Test asynchronous read is notified due to RFile::Write()"));
  4129 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
  4125 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
  4130 	test_KErrNone(r);
  4126 	test_KErrNone(r);
  4131 	reader.Read(0, readBuf, 26, readStat1);
  4127 	reader.Read(0, readBuf, 26, readStat1);
  4132 	test(readStat1==KRequestPending);
  4128 	test_Value(readStat1.Int(), readStat1==KRequestPending);
  4133 	RFile writer;
  4129 	RFile writer;
  4134 	r=writer.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileWrite|EFileShareAny);
  4130 	r=writer.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileWrite|EFileShareAny);
  4135 	writer.Write(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
  4131 	writer.Write(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
  4136 	User::WaitForRequest(readStat1);
  4132 	User::WaitForRequest(readStat1);
  4137 	test(readStat1==KErrNone);
  4133 	test_KErrNone(readStat1.Int());
  4138 	test(readBuf.Length() == 26);
  4134 	test_Equal(26, readBuf.Length());
  4139 	reader.Close();
  4135 	reader.Close();
  4140 	writer.Close();
  4136 	writer.Close();
  4141 
  4137 
  4142 	test.Next(_L("Test multiple asynchronous readers notified from separate thread"));
  4138 	test.Next(_L("Test multiple asynchronous readers notified from separate thread"));
  4143 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
  4139 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
  4148 	test.Printf(_L(">Read%d[%d]\n"), 0, KReadLen);
  4144 	test.Printf(_L(">Read%d[%d]\n"), 0, KReadLen);
  4149 	reader.Read(0, readBuf, KReadLen, readStat1);
  4145 	reader.Read(0, readBuf, KReadLen, readStat1);
  4150 	TBuf8<596> readBuf2;
  4146 	TBuf8<596> readBuf2;
  4151 	test.Printf(_L(">Read%d[%d]\n"), 1, KReadLen);
  4147 	test.Printf(_L(">Read%d[%d]\n"), 1, KReadLen);
  4152 	reader.Read(KReadLen, readBuf2, KReadLen, readStat2);
  4148 	reader.Read(KReadLen, readBuf2, KReadLen, readStat2);
  4153 	test(readStat1==KRequestPending);
  4149 	test_Value(readStat1.Int(), readStat1==KRequestPending);
  4154 	test(readStat2==KRequestPending);
  4150 	test_Value(readStat2.Int(), readStat2==KRequestPending);
  4155 
  4151 
  4156 	RThread thread;
  4152 	RThread thread;
  4157 	r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest12);
  4153 	r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest12);
  4158 	test_KErrNone(r);
  4154 	test_KErrNone(r);
  4159 	thread.Logon(thrdStat);
  4155 	thread.Logon(thrdStat);
  4162 
  4158 
  4163 	RTimer timer;
  4159 	RTimer timer;
  4164 	TRequestStatus timerStat(KRequestPending);
  4160 	TRequestStatus timerStat(KRequestPending);
  4165 	timer.CreateLocal();
  4161 	timer.CreateLocal();
  4166 	timer.After(timerStat, 30000000);	// 30 seconds timeout (the following async test should take 10 seconds)
  4162 	timer.After(timerStat, 30000000);	// 30 seconds timeout (the following async test should take 10 seconds)
  4167 	test(timerStat==KRequestPending);
  4163 	test_Value(timerStat.Int(), timerStat==KRequestPending);
  4168 
  4164 
  4169 	#define ODDPASS  (pass&0x01)
  4165 	#define ODDPASS  (pass&0x01)
  4170 	#define REQSTAT  (ODDPASS ? readStat2 : readStat1)
  4166 	#define REQSTAT  (ODDPASS ? readStat2 : readStat1)
  4171 	#define PENDSTAT (ODDPASS ? readStat1 : readStat2)
  4167 	#define PENDSTAT (ODDPASS ? readStat1 : readStat2)
  4172 	#define COMPLEN  (ODDPASS ? KReadLen  : (pass+1)*KReadLen)
  4168 	#define COMPLEN  (ODDPASS ? KReadLen  : (pass+1)*KReadLen)
  4176 
  4172 
  4177 	TInt pass = 0;
  4173 	TInt pass = 0;
  4178 	FOREVER
  4174 	FOREVER
  4179 		{
  4175 		{
  4180         User::WaitForRequest(REQSTAT, timerStat);
  4176         User::WaitForRequest(REQSTAT, timerStat);
  4181 		test(REQSTAT==KErrNone);
  4177 		test_KErrNone(REQSTAT.Int());
  4182 		test(timerStat==KRequestPending);
  4178 		test_Value(timerStat.Int(), timerStat==KRequestPending);
  4183 		test(READBUF.Length() == COMPLEN);
  4179 		test_Equal(COMPLEN, READBUF.Length());
  4184 		test(READBUF.Right(KReadLen) == _L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
  4180 		test(READBUF.Right(KReadLen) == _L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
  4185 		test.Printf(_L(">Read%d[%d]\n"), pass&0x01, READLEN);
  4181 		test.Printf(_L(">Read%d[%d]\n"), pass&0x01, READLEN);
  4186 		reader.Read(READPOS, READBUF, READLEN, REQSTAT);
  4182 		reader.Read(READPOS, READBUF, READLEN, REQSTAT);
  4187 		test(REQSTAT==KRequestPending);
  4183 		test_Value(REQSTAT.Int(), REQSTAT==KRequestPending);
  4188 		if(++pass==10)
  4184 		if(++pass==10)
  4189 			break;
  4185 			break;
  4190 		}
  4186 		}
  4191 
  4187 
  4192 	test.Next(_L("Close reader and test multiple outstanding requests are cancelled"));
  4188 	test.Next(_L("Close reader and test multiple outstanding requests are cancelled"));
  4193 	timer.Close();
  4189 	timer.Close();
  4194 	User::WaitForRequest(timerStat);
  4190 	User::WaitForRequest(timerStat);
  4195 	reader.Close();
  4191 	reader.Close();
  4196 	User::WaitForRequest(readStat1);
  4192 	User::WaitForRequest(readStat1);
  4197 	test(readStat1==KErrCancel);
  4193 	test_Value(readStat1.Int(), readStat1==KErrCancel);
  4198 	User::WaitForRequest(readStat2);
  4194 	User::WaitForRequest(readStat2);
  4199 	test(readStat2==KErrCancel);
  4195 	test_Value(readStat2.Int(), readStat2==KErrCancel);
  4200 
  4196 
  4201 	User::WaitForRequest(thrdStat);
  4197 	User::WaitForRequest(thrdStat);
  4202 	test(thrdStat==KErrNone);
  4198 	test_KErrNone(thrdStat.Int());
  4203 	}
  4199 	}
  4204 
  4200 
  4205 
  4201 
  4206 //-----------------------------------------------------------------------
  4202 //-----------------------------------------------------------------------
  4207 
  4203 
  4217 
  4213 
  4218     _LIT(KTestPath, "\\"); //-- root dir, actually
  4214     _LIT(KTestPath, "\\"); //-- root dir, actually
  4219 
  4215 
  4220     //-- set up notifier
  4216     //-- set up notifier
  4221     TheFs.NotifyChange(ENotifyAll, reqStatNotify1, KTestPath);
  4217     TheFs.NotifyChange(ENotifyAll, reqStatNotify1, KTestPath);
  4222     test(reqStatNotify1.Int() == KRequestPending);
  4218     test_Value(reqStatNotify1.Int(), reqStatNotify1 == KRequestPending);
  4223 
  4219 
  4224     //-- create a file in the root dir
  4220     //-- create a file in the root dir
  4225     RFile       file;
  4221     RFile       file;
  4226     TFileName   fileName(KTestPath);
  4222     TFileName   fileName(KTestPath);
  4227 
  4223 
  4231     test_Value(nRes, nRes == KErrNone || nRes ==KErrAlreadyExists);
  4227     test_Value(nRes, nRes == KErrNone || nRes ==KErrAlreadyExists);
  4232     file.Close();
  4228     file.Close();
  4233 
  4229 
  4234     //-- check that the notifier worked
  4230     //-- check that the notifier worked
  4235     User::WaitForRequest(reqStatNotify1);
  4231     User::WaitForRequest(reqStatNotify1);
  4236     test(reqStatNotify1.Int() == KErrNone);
  4232     test_KErrNone(reqStatNotify1.Int());
  4237 
  4233 
  4238 }
  4234 }
  4239 
  4235 
  4240 
  4236 
  4241 
  4237 
  4322 
  4318 
  4323 #if defined (__EPOC32__)//we have no removable media on Emulator yet
  4319 #if defined (__EPOC32__)//we have no removable media on Emulator yet
  4324 
  4320 
  4325 //	Test RFs::NotifyChange() extended notification
  4321 //	Test RFs::NotifyChange() extended notification
  4326 	TInt uid;
  4322 	TInt uid;
  4327 	test(HAL::Get(HAL::EMachineUid,uid)==KErrNone);
  4323 	test_KErrNone(HAL::Get(HAL::EMachineUid,uid));
  4328 	if(uid!=HAL::EMachineUid_Cogent && uid!=HAL::EMachineUid_IQ80310 &&
  4324 	if(uid!=HAL::EMachineUid_Cogent && uid!=HAL::EMachineUid_IQ80310 &&
  4329 				uid != HAL::EMachineUid_Integrator && uid!=HAL::EMachineUid_X86PC)
  4325 				uid != HAL::EMachineUid_Integrator && uid!=HAL::EMachineUid_X86PC)
  4330 		MediaChangeExtendedNotification();
  4326 		MediaChangeExtendedNotification();
  4331 
  4327 
  4332 #endif
  4328 #endif