--- a/kerneltest/f32test/server/t_notify.cpp Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_notify.cpp Wed Sep 01 12:34:56 2010 +0100
@@ -15,15 +15,11 @@
//
//
-#define __E32TEST_EXTENSION__
#include <f32file.h>
#include <e32test.h>
#include <e32svr.h>
#include <hal.h>
#include "t_server.h"
-#include "f32_test_utils.h"
-
-using namespace F32_Test_Utils;
const TInt KHeapSize=0x200;
@@ -113,9 +109,9 @@
{
RFs fs;
TInt r=fs.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
TTestCode testCode=*(TTestCode*)&aTestCode;
RFile f;
switch (testCode)
@@ -123,26 +119,26 @@
case ETest1:
r=f.Replace(fs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
f.Close();
break;
case ETest2:
r=f.Replace(fs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
f.Close();
break;
case ETest3:
r=fs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\"));
- test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+ test((r==KErrNone)||(r==KErrAlreadyExists));
break;
case ETest4:
{
TRequestStatus s;
fs.NotifyChange(ENotifyAll,s);
- test_Value(s.Int(), s==KRequestPending);
+ test(s==KRequestPending);
gSleepThread.Signal();
User::After(100000000);
}
@@ -152,34 +148,34 @@
{
RFile file;
TInt r=file.Open(fs,_L("\\F32-TST\\NOTIFY\\kangaroo.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
r=file.SetSize(sizeof(TCheckedUid));
- test_KErrNone(r);
+ test(r==KErrNone);
r=file.Write(sizeof(TCheckedUid),_L8("012345678912"));
- test_KErrNone(r);
+ test(r==KErrNone);
TBuf8<64> dum;
r=file.Read(0,dum);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
r=file.Open(fs,_L("\\F32-TST\\NOTIFY\\koala.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
r=file.SetSize(50);
- test_KErrNone(r);
+ test(r==KErrNone);
r=file.Write(sizeof(TCheckedUid),_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
- test_KErrNone(r);
+ test(r==KErrNone);
r=file.Read(0,dum);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
r=file.Open(fs,_L("\\F32-TST\\NOTIFY\\dingo.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
r=file.SetSize(50);
- test_KErrNone(r);
+ test(r==KErrNone);
r=file.Write(sizeof(TCheckedUid),_L8("01234567890123456789"));
- test_KErrNone(r);
+ test(r==KErrNone);
r=file.Read(0,dum);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
gSleepThread.Signal();
}
@@ -197,9 +193,9 @@
{
RFile file;
TInt r=file.Open(fs,_L("\\F32-TST\\NOTIFY\\NewFILE.TXT"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
r=file.Write(_L8("asdfasdfasdf"));
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
gSleepThread.Signal();
}
@@ -208,7 +204,7 @@
case ETest8:
{
r=f.Open(fs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.msg"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
f.SetSize(500);
f.Close();
break;
@@ -219,7 +215,7 @@
TRequestStatus s;
TFileName path=_L("\\F32-TST\\NOTIFY\\");
fs.NotifyChange(ENotifyAll,s,path);
- test_Value(s.Int(), s==KRequestPending);
+ test(s==KRequestPending);
gSleepThread.Signal();
User::After(100000000);
}
@@ -228,7 +224,7 @@
{
TFileName path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
r=fs.MkDir(path);
- test_KErrNone(r);
+ test(r==KErrNone);
break;
}
case ETest11:
@@ -236,7 +232,7 @@
TFileName path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man");
RFile file;
r=file.Replace(fs,path,EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
break;
}
@@ -244,12 +240,12 @@
{
RFile writer;
TInt r=writer.Open(fs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileWrite|EFileShareAny);
- test_KErrNone(r);
+ test(r==KErrNone);
TInt i;
for(i=0; i<10; i++)
{
r=writer.Write(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::After(1000000);
}
writer.Close();
@@ -292,58 +288,58 @@
TheFs.NotifyChange(ENotifyEntry,reqStat);
RThread thread;
r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
- test_KErrNone(r);
+ test(r==KErrNone);
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
thread.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
RFile file;
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite|EFileShareExclusive);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Write(_L8("Somewhere over the rainbow..."),reqStat);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
TBuf8<256> buf;
file.Read(0, buf,reqStat);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
file.Close();
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareExclusive);
- test_Value(r, r == KErrArgument);
+ test(r==KErrArgument);
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareReadersOnly);
- test_Value(r, r == KErrArgument);
+ test(r==KErrArgument);
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Read(0, buf, 100, reqStat);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
file.Close();
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Read(0, buf, 100, reqStat);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
file.ReadCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
file.Close();
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Read(0, buf, 100, reqStat);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
file.SetSize(100);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
- test_Equal(100, buf.Length());
+ test(reqStat==KErrNone);
+ test(buf.Length() == 100);
file.Close();
test.Next(_L("Repeat Test notification of an entry change"));
@@ -352,10 +348,15 @@
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
thread.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ if (reqStat!=KErrNone)
+ {
+ test.Printf(_L("ReqStat=%d\n"),reqStat.Int());
+ //test.Getch();
+ }
+ test(reqStat==KErrNone);
test.Next(_L("Test Notify cancel"));
TheFs.NotifyChange(ENotifyEntry,reqStat);
@@ -368,10 +369,10 @@
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
thread.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
}
static void Test2()
@@ -385,23 +386,23 @@
TRequestStatus reqStat1(KRequestPending);
RFs fs1;
TInt r=fs1.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
fs1.NotifyChange(ENotifyEntry,reqStat1);
TRequestStatus reqStat2(KRequestPending);
RFs fs2;
r=fs2.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
fs2.NotifyChange(ENotifyEntry,reqStat2);
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NEWFILE.TXT"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat1);
User::WaitForRequest(reqStat2);
- test_KErrNone(reqStat1.Int());
- test_KErrNone(reqStat2.Int());
+ test(reqStat1==KErrNone);
+ test(reqStat2==KErrNone);
}
static void Test3()
@@ -413,7 +414,7 @@
test.Next(_L("Cancel notification"));
RFs fs1;
TInt r=fs1.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
TRequestStatus status1;
TRequestStatus status2;
@@ -426,25 +427,25 @@
fs1.NotifyChange(ENotifyAll,status3);
fs1.NotifyChange(ENotifyAll,status4);
fs1.NotifyChange(ENotifyAll,status5);
- test_Value(status1.Int(), status1==KRequestPending);
- test_Value(status2.Int(), status2==KRequestPending);
- test_Value(status3.Int(), status3==KRequestPending);
- test_Value(status4.Int(), status4==KRequestPending);
- test_Value(status5.Int(), status5==KRequestPending);
+ test(status1==KRequestPending);
+ test(status2==KRequestPending);
+ test(status3==KRequestPending);
+ test(status4==KRequestPending);
+ test(status5==KRequestPending);
test.Next(_L("RFs::NotifyCancel()"));
// Test that one call to RFs::NotifyCancel() cancels all outstanding requests
fs1.NotifyChangeCancel();
User::WaitForRequest(status1);
- test_Value(status1.Int(), status1==KErrCancel);
+ test(status1==KErrCancel);
User::WaitForRequest(status2);
- test_Value(status2.Int(), status2==KErrCancel);
+ test(status2==KErrCancel);
User::WaitForRequest(status3);
- test_Value(status3.Int(), status3==KErrCancel);
+ test(status3==KErrCancel);
User::WaitForRequest(status4);
- test_Value(status4.Int(), status4==KErrCancel);
+ test(status4==KErrCancel);
User::WaitForRequest(status5);
- test_Value(status5.Int(), status5==KErrCancel);
+ test(status5==KErrCancel);
// Call the cancel function again to check no further action
fs1.NotifyChangeCancel();
@@ -455,49 +456,49 @@
fs1.NotifyChange(ENotifyAll,status3);
fs1.NotifyChange(ENotifyAll,status4);
fs1.NotifyChange(ENotifyAll,status5);
- test_Value(status1.Int(), status1==KRequestPending);
- test_Value(status2.Int(), status2==KRequestPending);
- test_Value(status3.Int(), status3==KRequestPending);
- test_Value(status4.Int(), status4==KRequestPending);
- test_Value(status5.Int(), status5==KRequestPending);
+ test(status1==KRequestPending);
+ test(status2==KRequestPending);
+ test(status3==KRequestPending);
+ test(status4==KRequestPending);
+ test(status5==KRequestPending);
// Cancel the outstanding request with status5
test.Next(_L("RFs::NotifyCancel()"));
fs1.NotifyChangeCancel(status5);
User::WaitForRequest(status5);
- test_Value(status1.Int(), status1==KRequestPending);
- test_Value(status2.Int(), status2==KRequestPending);
- test_Value(status3.Int(), status3==KRequestPending);
- test_Value(status4.Int(), status4==KRequestPending);
- test_Value(status5.Int(), status5==KErrCancel);
+ test(status1==KRequestPending);
+ test(status2==KRequestPending);
+ test(status3==KRequestPending);
+ test(status4==KRequestPending);
+ test(status5==KErrCancel);
fs1.NotifyChangeCancel(status2);
User::WaitForRequest(status2);
- test_Value(status1.Int(), status1==KRequestPending);
- test_Value(status2.Int(), status2==KErrCancel);
- test_Value(status3.Int(), status3==KRequestPending);
- test_Value(status4.Int(), status4==KRequestPending);
+ test(status1==KRequestPending);
+ test(status2==KErrCancel);
+ test(status3==KRequestPending);
+ test(status4==KRequestPending);
fs1.NotifyChangeCancel(status4);
User::WaitForRequest(status4);
- test_Value(status1.Int(), status1==KRequestPending);
- test_Value(status3.Int(), status3==KRequestPending);
- test_Value(status4.Int(), status4==KErrCancel);
-
- fs1.NotifyChangeCancel(status4); // Test no side effects on trying to cancel a request
- test_Value(status4.Int(), status4==KErrCancel); // that has already been cancelled
+ test(status1==KRequestPending);
+ test(status3==KRequestPending);
+ test(status4==KErrCancel);
+
+ fs1.NotifyChangeCancel(status4); // Test no side effects on trying to cancel a request
+ test(status4==KErrCancel); // that has already been cancelled
fs1.NotifyChangeCancel(status1);
User::WaitForRequest(status1);
- test_Value(status1.Int(), status1==KErrCancel);
- test_Value(status3.Int(), status3==KRequestPending);
+ test(status1==KErrCancel);
+ test(status3==KRequestPending);
fs1.NotifyChangeCancel(status1); // Test no side effects on trying to cancel a request
- test_Value(status1.Int(), status1==KErrCancel); // that has already been cancelled
+ test(status1==KErrCancel); // that has already been cancelled
fs1.NotifyChangeCancel(status3);
User::WaitForRequest(status3);
- test_Value(status3.Int(), status3==KErrCancel);
+ test(status3==KErrCancel);
fs1.Close();
}
@@ -510,7 +511,7 @@
test.Next(_L("Kill client"));
TInt r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
RThread clientThread;
r=clientThread.Create(_L("ClientThread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest4);
if (r!=KErrNone)
@@ -531,7 +532,7 @@
clientThread.Close();
r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\"));
- test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+ test(r==KErrNone || r==KErrAlreadyExists);
MakeFile(_L("\\F32-TST\\NOTIFY\\NewFile.Txt"));
User::After(1000);
}
@@ -547,37 +548,37 @@
RFile file;
TInt r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\kangaroo.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\koala.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\dingo.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
TRequestStatus reqStat=0;
TheFs.NotifyChange(ENotifyEntry,reqStat);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
RThread clientThread;
r=clientThread.Create(_L("Test5Thread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
- test_KErrNone(r);
+ test(r==KErrNone);
clientThread.Resume();
gSleepThread.Wait();
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\koala.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\dingo.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
@@ -593,7 +594,7 @@
{
TDriveInfo driveInfo;
TInt r=TheFs.Drive(driveInfo,CurrentDrive());
- test_KErrNone(r);
+ test(r==KErrNone);
// only test on removable media
if (driveInfo.iDriveAtt&KDriveAttRemovable)
{
@@ -603,16 +604,16 @@
TRequestStatus reqStat=0;
TInt r;
TheFs.NotifyChange(ENotifyEntry,reqStat);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
RThread clientThread;
r=clientThread.Create(_L("Test6Thread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);
- test_KErrNone(r);
+ test(r==KErrNone);
clientThread.Resume();
gSleepThread.Wait();
TInt reqInt=reqStat.Int();
- test_KErrNone(reqInt);
+ test(reqInt==KErrNone);
User::WaitForRequest(reqStat);
WaitForMediaChange();
gSleepThread.Close();
@@ -622,7 +623,7 @@
//-- it seems that after generating media change the meia driver isn't ready for some time
User::After(2000000);
r=TheFs.Drive(driveInfo,CurrentDrive());
- test_KErrNone(r);
+ test(r==KErrNone);
}
@@ -639,19 +640,19 @@
MakeFile(_L("NewFile.TXT"));
TInt r;
TheFs.NotifyChange(ENotifyEntry,reqStat);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
RThread clientThread;
r=clientThread.Create(_L("Test7Thread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest7);
- test_KErrNone(r);
+ test(r==KErrNone);
clientThread.Resume();
gSleepThread.Wait();
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("Newfile.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
@@ -668,7 +669,7 @@
{
TDriveInfo driveInfo;
TInt r=TheFs.Drive(driveInfo,CurrentDrive());
- test_KErrNone(r);
+ test(r==KErrNone);
// only test on removable media
if (driveInfo.iDriveAtt&KDriveAttRemovable)
{
@@ -677,17 +678,17 @@
TFileName path = _L("\\F32-tst\\NOTIFY\\");
TInt r;
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
RThread clientThread;
gSocketNumber=0;
r=clientThread.Create(_L("Test6Thread1"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6); //only generates a media change on removable media
- test_KErrNone(r);
+ test(r==KErrNone);
clientThread.Resume();
gSleepThread.Wait();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
WaitForMediaChange();
gSleepThread.Close();
clientThread.Close();
@@ -695,19 +696,19 @@
//-- it seems that after generating media change the meia driver isn't ready for some time
User::After(2000000);
r=TheFs.Drive(driveInfo,CurrentDrive());
- test_KErrNone(r);
+ test(r==KErrNone);
TheFs.NotifyChange(ENotifyDisk,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
r=clientThread.Create(_L("Test6Thread2"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);
- test_KErrNone(r);
+ test(r==KErrNone);
clientThread.Resume();
gSleepThread.Wait();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
WaitForMediaChange();
gSleepThread.Close();
clientThread.Close();
@@ -715,18 +716,18 @@
//-- it seems that after generating media change the meia driver isn't ready for some time
User::After(2000000);
r=TheFs.Drive(driveInfo,CurrentDrive());
- test_KErrNone(r);
+ test(r==KErrNone);
TheFs.NotifyChange(ENotifyWrite,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
r=clientThread.Create(_L("Test6Thread3"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);
- test_KErrNone(r);
+ test(r==KErrNone);
clientThread.Resume();
gSleepThread.Wait();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
WaitForMediaChange();
gSleepThread.Close();
clientThread.Close();
@@ -734,7 +735,7 @@
//-- it seems that after generating media change the meia driver isn't ready for some time
User::After(2000000);
r=TheFs.Drive(driveInfo,CurrentDrive());
- test_KErrNone(r);
+ test(r==KErrNone);
}
}
@@ -749,153 +750,153 @@
// First a simple example
TInt r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\"));
- test_Value(r, (r == KErrNotFound)||(r==KErrPathNotFound)||(r==KErrNone));
+ test((r==KErrNotFound)||(r==KErrPathNotFound)||(r==KErrNone));
TFileName path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
TRequestStatus reqStat(KRequestPending);
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man");
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
RFile file;
r=file.Replace(TheFs,path,EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.Delete(path);
- test_KErrNone(r);
+ test(r==KErrNone);
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
// Now cancel the outstanding request
TheFs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// Repeat with a ENotifyFile request
TheFs.NotifyChange(ENotifyFile,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.Replace(TheFs,path,EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.Delete(path);
- test_KErrNone(r);
+ test(r==KErrNone);
TheFs.NotifyChange(ENotifyFile,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
// Now cancel the outstanding request
TheFs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// Repeat with an ENotifyAttributes request
TheFs.NotifyChange(ENotifyAttributes,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.Replace(TheFs,path,EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int()); // Monitoring attributes but informed anyway
+ test(reqStat==KErrNone); // Monitoring attributes but informed anyway
r=TheFs.Delete(path);
- test_KErrNone(r);
+ test(r==KErrNone);
TheFs.NotifyChange(ENotifyAttributes,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
// Now cancel the outstanding request
TheFs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// Repeat with an ENotifyWrite request
TheFs.NotifyChange(ENotifyWrite,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.Replace(TheFs,path,EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int()); // Monitoring file writing but informed anyway
+ test(reqStat==KErrNone); // Monitoring file writing but informed anyway
r=TheFs.Delete(path);
- test_KErrNone(r);
+ test(r==KErrNone);
TheFs.NotifyChange(ENotifyWrite,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
// Now cancel the outstanding request
TheFs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// Repeat with an ENotifyDisk request
TheFs.NotifyChange(ENotifyDisk,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.Replace(TheFs,path,EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int()); // Monitoring disk activity but informed anyway
+ test(reqStat==KErrNone); // Monitoring disk activity but informed anyway
r=TheFs.Delete(path);
- test_KErrNone(r);
+ test(r==KErrNone);
TheFs.NotifyChange(ENotifyAttributes,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
// Now cancel the outstanding request
TheFs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// Now do much the same with directory monitoring
path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
TheFs.RmDir(path);
TheFs.NotifyChange(ENotifyDir,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
TheFs.MkDir(path);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
TheFs.RmDir(path);
- test_KErrNone(r);
+ test(r==KErrNone);
TheFs.NotifyChange(ENotifyDir,reqStat,path);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
// Now cancel the outstanding request
TheFs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
TheFs.NotifyChange(ENotifyDir,reqStat,path);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
// Get a separate thread to create the directory
RThread thread;
@@ -906,19 +907,19 @@
thread.Close();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
TheFs.RmDir(path);
- test_KErrNone(r);
+ test(r==KErrNone);
// Check that notification is not received for a non-existent file if only the previously
// non existent directory that contains it is created
path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man");
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
thread.Create(_L("RequestAheadThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest10);
thread.Logon(thrdStat);
@@ -926,35 +927,35 @@
thread.Close();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(thrdStat==KErrNone);
+ test(reqStat==KRequestPending);
// Now get a thread to create the file
thread.Create(_L("RequestAhead"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest11);
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
thread.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
TheFs.Delete(path);
- test_KErrNone(r);
+ test(r==KErrNone);
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
// Now cancel the outstanding request
TheFs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
TheFs.RmDir(path);
- test_KErrNone(r);
+ test(r==KErrNone);
}
@@ -970,52 +971,52 @@
TFileName path=(_L("\\F32-TST\\"));
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
RThread thread;
TInt r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
- test_KErrNone(r);
+ test(r==KErrNone);
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
thread.Close();
// Repeat the test
test.Next(_L("Repeat Test notification of an entry change"));
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=thread.Create(_L("MyThread2"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
- test_KErrNone(r);
+ test(r==KErrNone);
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
thread.Close();
// Test it can be cancelled
test.Next(_L("Test Notify cancel"));
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
TheFs.NotifyChangeCancel();
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// Test it can be notified again
test.Next(_L("Test notification still works"));
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=thread.Create(_L("MyThread3"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
- test_KErrNone(r);
+ test(r==KErrNone);
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
thread.Close();
// Test notification doesn't occur when a change occurs above the directory monitored
@@ -1023,200 +1024,200 @@
// will occur - this is tested for in Test18())
test.Next(_L("Test changing above monitored directory"));
r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
- test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+ test((r==KErrNone)||(r==KErrAlreadyExists));
path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=thread.Create(_L("MyThread4"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
- test_KErrNone(r);
+ test(r==KErrNone);
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
User::After(500000);
thread.Close();
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
TheFs.NotifyChangeCancel();
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// Test notification occurs when a change is made to the subdirectory monitored
test.Next(_L("Create a file in monitored subdirectory"));
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=thread.Create(_L("MyThread5"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest2);
- test_KErrNone(r);
+ test(r==KErrNone);
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
thread.Close();
test.Next(_L("Create a directory in monitored subdirectory"));
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=thread.Create(_L("MyThread6"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest3);
- test_KErrNone(r);
+ test(r==KErrNone);
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
thread.Close();
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\TINMAN\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\TINMAN\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
// Test again that notification doesn't occur above the subdirectory being monitored
test.Next(_L("Test changing above monitored directory"));
r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
- test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+ test((r==KErrNone)||(r==KErrAlreadyExists));
path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=thread.Create(_L("MyThread7"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
- test_KErrNone(r);
+ test(r==KErrNone);
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
User::After(500000);
thread.Close();
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
TheFs.NotifyChangeCancel();
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// Test notification occurs when a change is made to the subdirectory monitored
test.Next(_L("Delete a file in monitored subdirectory"));
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
RFile file;
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.msg"),EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
// Test notification on a specific file
test.Next(_L("Monitor changes to a specific file"));
path+=_L("WickedWitch.msg");
TheFs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=thread.Create(_L("MyThread8"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest8);
- test_KErrNone(r);
+ test(r==KErrNone);
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
thread.Close();
// Test notification does not occur if a change is made above the file
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
thread.Create(_L("MyThread9"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest2);
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
User::After(500000);
thread.Close();
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
TheFs.NotifyChangeCancel();
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// Test notification occurs when a change is made to the file
test.Next(_L("Delete monitored file"));
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.Msg"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// Test notification request is now submitted on the non existent path successfully
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
TheFs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.Doc");
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.Doc"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// Submit a request for a path which does not yet exist
path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\");
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
// Now create the directory we are waiting on
r=TheFs.MkDir(path);
- test_KErrNone(r);
+ test(r==KErrNone);
// Make sure the notification has now been received
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// Submit a request for a file which does not yet exist
path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\Red-Shoes.red");
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
// Now create the file we are waiting on
r=file.Replace(TheFs,path,EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
// Make sure the notification has now been received
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// Submit another notification request and delete the file
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(path);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\");
TheFs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.RmDir(path);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// test passing in an empty string
TheFs.NotifyChange(ENotifyEntry,reqStat,_L(""));
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrArgument);
+ test(reqStat==KErrArgument);
}
static void Test9()
@@ -1230,13 +1231,13 @@
// Create five sessions monitoring various levels of a directory tree
TInt r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\ANIMAL\\"));
- test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+ test((r==KErrNone)||(r==KErrAlreadyExists));
RFile file;
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\ANIMAL\\cat.txt"),EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\ANIMAL\\dog.txt"),EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
TFileName path1=_L("\\F32-TST\\");
@@ -1249,127 +1250,127 @@
TRequestStatus reqStat1(KRequestPending);
RFs fs1;
r=fs1.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs1.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
TRequestStatus reqStat2(KRequestPending);
RFs fs2;
r=fs2.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs2.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
TRequestStatus reqStat3(KRequestPending);
RFs fs3;
r=fs3.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs3.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
TRequestStatus reqStat4(KRequestPending);
RFs fs4;
r=fs4.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs4.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
fs4.NotifyChange(ENotifyEntry,reqStat4,path4);
TRequestStatus reqStat5(KRequestPending);
RFs fs5;
r=fs5.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs5.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
fs5.NotifyChange(ENotifyEntry,reqStat5,path5);
TRequestStatus reqStat6(KRequestPending);
RFs fs6;
r=fs6.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs6.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
- test_Value(reqStat5.Int(), reqStat5==KRequestPending);
- test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
+ test(reqStat5==KRequestPending);
+ test(reqStat6==KRequestPending);
// Make a change a the top level and check that only the session monitoring
// that level is notified
test.Next(_L("Test only client monitoring top level is notified"));
r=file.Replace(TheFs,_L("\\F32-TST\\NewFile.txt"),EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
User::WaitForRequest(reqStat1);
- test_KErrNone(reqStat1.Int());
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
- test_Value(reqStat5.Int(), reqStat5==KRequestPending);
+ test(reqStat1==KErrNone);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
+ test(reqStat5==KRequestPending);
User::WaitForRequest(reqStat6);
- test_KErrNone(reqStat6.Int());
+ test(reqStat6==KErrNone);
r=TheFs.Delete(_L("\\F32-TST\\NewFile.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
// Renew the notify request at the top level and make a change one step lower
fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat6==KRequestPending);
test.Next(_L("Test clients monitoring levels 1 and 2 are notified"));
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
User::WaitForRequest(reqStat1);
User::WaitForRequest(reqStat2);
- test_KErrNone(reqStat1.Int());
- test_KErrNone(reqStat2.Int());
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
- test_Value(reqStat5.Int(), reqStat5==KRequestPending);
+ test(reqStat1==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
+ test(reqStat5==KRequestPending);
User::WaitForRequest(reqStat6);
- test_KErrNone(reqStat6.Int());
+ test(reqStat6==KErrNone);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NewFile.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
// Renew the notify request at the top and second levels and make a change
// one step lower still
fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat6==KRequestPending);
test.Next(_L("Test clients monitoring levels 1,2 and 3 are notified"));
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\ANIMAL\\NewFile.txt"),EFileStream);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
User::WaitForRequest(reqStat1);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat1.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
- test_Value(reqStat5.Int(), reqStat5==KRequestPending);
+ test(reqStat1==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending);
+ test(reqStat5==KRequestPending);
User::WaitForRequest(reqStat6);
- test_KErrNone(reqStat6.Int());
+ test(reqStat6==KErrNone);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\NewFile.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
// Renew the notify request at the top, second and third levels and make a change
// one step lower still
@@ -1377,25 +1378,25 @@
fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat6==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat6==KRequestPending);
test.Next(_L("Test clients monitoring levels 1 - 4 are notified"));
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\cat.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat1);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
User::WaitForRequest(reqStat4);
- test_KErrNone(reqStat1.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_KErrNone(reqStat4.Int());
- test_Value(reqStat5.Int(), reqStat5==KRequestPending);
+ test(reqStat1==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KErrNone);
+ test(reqStat5==KRequestPending);
User::WaitForRequest(reqStat6);
- test_KErrNone(reqStat6.Int());
+ test(reqStat6==KErrNone);
// Renew the notify request at the top, second and third levels and on the file deleted above
// which will be successful, but will not complete (for obvious reasons)
@@ -1406,31 +1407,31 @@
fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
fs4.NotifyChange(ENotifyEntry,reqStat4,path4);
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
- test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
+ test(reqStat6==KRequestPending);
test.Next(_L("Test clients monitoring levels 1 - 3 and 5 are notified"));
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\dog.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat1);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
// Don't wait for reqStat4
User::WaitForRequest(reqStat5);
User::WaitForRequest(reqStat6);
- test_KErrNone(reqStat1.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending); // File does not exist
- test_KErrNone(reqStat5.Int());
- test_KErrNone(reqStat6.Int());
+ test(reqStat1==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending); // File does not exist
+ test(reqStat5==KErrNone);
+ test(reqStat6==KErrNone);
fs4.NotifyChangeCancel(reqStat4);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
// Renew the notify request at the top, second and third levels and attempt to renew
// the request on the files deleted above (which will fail).
@@ -1441,25 +1442,25 @@
fs4.NotifyChange(ENotifyEntry,reqStat4,path4);
fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
fs5.NotifyChange(ENotifyEntry,reqStat5,path5);
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
- test_Value(reqStat5.Int(), reqStat5==KRequestPending);
- test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
+ test(reqStat5==KRequestPending);
+ test(reqStat6==KRequestPending);
r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\ANIMAL\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat1);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat1.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
- test_Value(reqStat5.Int(), reqStat5==KRequestPending);
+ test(reqStat1==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending);
+ test(reqStat5==KRequestPending);
User::WaitForRequest(reqStat6);
- test_KErrNone(reqStat6.Int());
+ test(reqStat6==KErrNone);
// Renew the notify request at the top and second levels on the third level
// which was removed - it'll succeed but won't complete.
@@ -1471,12 +1472,12 @@
fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
- test_Value(reqStat5.Int(), reqStat5==KRequestPending);
- test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
+ test(reqStat5==KRequestPending);
+ test(reqStat6==KRequestPending);
fs1.NotifyChangeCancel();
fs2.NotifyChangeCancel();
@@ -1508,9 +1509,9 @@
TFileName path=_L("\\F32-TST\\NOTIFY\\");
RFs fs1;
TInt r=fs1.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs1.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
TRequestStatus status1;
TRequestStatus status2;
@@ -1523,25 +1524,25 @@
fs1.NotifyChange(ENotifyAll,status3,path);
fs1.NotifyChange(ENotifyAll,status4,path);
fs1.NotifyChange(ENotifyAll,status5,path);
- test_Value(status1.Int(), status1==KRequestPending);
- test_Value(status2.Int(), status2==KRequestPending);
- test_Value(status3.Int(), status3==KRequestPending);
- test_Value(status4.Int(), status4==KRequestPending);
- test_Value(status5.Int(), status5==KRequestPending);
+ test(status1==KRequestPending);
+ test(status2==KRequestPending);
+ test(status3==KRequestPending);
+ test(status4==KRequestPending);
+ test(status5==KRequestPending);
test.Next(_L("RFs::NotifyCancel()"));
// Test that one call to RFs::NotifyCancel() cancels all outstanding requests
fs1.NotifyChangeCancel();
User::WaitForRequest(status1);
- test_Value(status1.Int(), status1==KErrCancel);
+ test(status1==KErrCancel);
User::WaitForRequest(status2);
- test_Value(status2.Int(), status2==KErrCancel);
+ test(status2==KErrCancel);
User::WaitForRequest(status3);
- test_Value(status3.Int(), status3==KErrCancel);
+ test(status3==KErrCancel);
User::WaitForRequest(status4);
- test_Value(status4.Int(), status4==KErrCancel);
+ test(status4==KErrCancel);
User::WaitForRequest(status5);
- test_Value(status5.Int(), status5==KErrCancel);
+ test(status5==KErrCancel);
// Call the cancel function again to check no further action
fs1.NotifyChangeCancel();
@@ -1552,62 +1553,62 @@
fs1.NotifyChange(ENotifyAll,status3,path);
fs1.NotifyChange(ENotifyAll,status4,path);
fs1.NotifyChange(ENotifyAll,status5,path);
- test_Value(status1.Int(), status1==KRequestPending);
- test_Value(status2.Int(), status2==KRequestPending);
- test_Value(status3.Int(), status3==KRequestPending);
- test_Value(status4.Int(), status4==KRequestPending);
- test_Value(status5.Int(), status5==KRequestPending);
+ test(status1==KRequestPending);
+ test(status2==KRequestPending);
+ test(status3==KRequestPending);
+ test(status4==KRequestPending);
+ test(status5==KRequestPending);
// Cancel the outstanding request with status5
test.Next(_L("RFs::NotifyCancel()"));
fs1.NotifyChangeCancel(status5);
User::WaitForRequest(status5);
- test_Value(status1.Int(), status1==KRequestPending);
- test_Value(status2.Int(), status2==KRequestPending);
- test_Value(status3.Int(), status3==KRequestPending);
- test_Value(status4.Int(), status4==KRequestPending);
- test_Value(status5.Int(), status5==KErrCancel);
+ test(status1==KRequestPending);
+ test(status2==KRequestPending);
+ test(status3==KRequestPending);
+ test(status4==KRequestPending);
+ test(status5==KErrCancel);
r=TheFs.MkDir(_L("\\F32-TST\\TROPICANA\\"));
- test_KErrNone(r);
- test_Value(status1.Int(), status1==KRequestPending);
- test_Value(status2.Int(), status2==KRequestPending);
- test_Value(status3.Int(), status3==KRequestPending);
- test_Value(status4.Int(), status4==KRequestPending);
+ test(r==KErrNone);
+ test(status1==KRequestPending);
+ test(status2==KRequestPending);
+ test(status3==KRequestPending);
+ test(status4==KRequestPending);
fs1.NotifyChangeCancel(status2);
User::WaitForRequest(status2);
- test_Value(status1.Int(), status1==KRequestPending);
- test_Value(status2.Int(), status2==KErrCancel);
- test_Value(status3.Int(), status3==KRequestPending);
- test_Value(status4.Int(), status4==KRequestPending);
+ test(status1==KRequestPending);
+ test(status2==KErrCancel);
+ test(status3==KRequestPending);
+ test(status4==KRequestPending);
r=TheFs.RmDir(_L("\\F32-TST\\TROPICANA\\"));
- test_KErrNone(r);
- test_Value(status1.Int(), status1==KRequestPending);
- test_Value(status3.Int(), status3==KRequestPending);
- test_Value(status4.Int(), status4==KRequestPending);
+ test(r==KErrNone);
+ test(status1==KRequestPending);
+ test(status3==KRequestPending);
+ test(status4==KRequestPending);
fs1.NotifyChangeCancel(status4);
User::WaitForRequest(status4);
- test_Value(status1.Int(), status1==KRequestPending);
- test_Value(status3.Int(), status3==KRequestPending);
- test_Value(status4.Int(), status4==KErrCancel);
+ test(status1==KRequestPending);
+ test(status3==KRequestPending);
+ test(status4==KErrCancel);
fs1.NotifyChangeCancel(status4); // Test no side effects on trying to cancel a request
- test_Value(status4.Int(), status4==KErrCancel); // that has already been cancelled
+ test(status4==KErrCancel); // that has already been cancelled
fs1.NotifyChangeCancel(status1);
User::WaitForRequest(status1);
- test_Value(status1.Int(), status1==KErrCancel);
- test_Value(status3.Int(), status3==KRequestPending);
+ test(status1==KErrCancel);
+ test(status3==KRequestPending);
fs1.NotifyChangeCancel(status1); // Test no side effects on trying to cancel a request
- test_Value(status1.Int(), status1==KErrCancel); // that has already been cancelled
+ test(status1==KErrCancel); // that has already been cancelled
fs1.NotifyChangeCancel(status3);
User::WaitForRequest(status3);
- test_Value(status3.Int(), status3==KErrCancel);
+ test(status3==KErrCancel);
fs1.Close();
}
@@ -1621,11 +1622,11 @@
test.Next(_L("Kill client while it is monitoring changes to a directory"));
// Call CreateLocal to create RSemaphore gSleepThread which is local to this process
TInt r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
RThread clientThread;
r=clientThread.Create(_L("ClientThread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest9);
- test_KErrNone(r);
+ test(r==KErrNone);
clientThread.Resume();
gSleepThread.Wait(); // Wait for gSleepThread to be signalled
// Client thread is waiting for notification of changes
@@ -1640,7 +1641,7 @@
// Make a change and check there's no disaster
r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\"));
- test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+ test(r==KErrNone || r==KErrAlreadyExists);
MakeFile(_L("\\F32-TST\\NOTIFY\\NewFile.Txt"));
User::After(1000);
}
@@ -1657,95 +1658,95 @@
RFile file;
TInt r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\kangaroo.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\koala.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\dingo.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
TFileName path=_L("\\F32-TST\\NOTIFY\\");
TRequestStatus reqStat1(KRequestPending);
RFs fs1;
r=fs1.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs1.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
fs1.NotifyChange(ENotifyEntry,reqStat1,path);
TRequestStatus reqStat2(KRequestPending);
RFs fs2;
r=fs2.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs2.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
fs2.NotifyChange(ENotifyEntry,reqStat2,path);
TRequestStatus reqStat3(KRequestPending);
RFs fs3;
r=fs3.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs3.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
fs3.NotifyChange(ENotifyEntry,reqStat3,path);
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
RThread thread1;
r=thread1.Create(_L("TestThread1"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
- test_KErrNone(r);
+ test(r==KErrNone);
thread1.Resume();
gSleepThread.Wait();
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat1);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat1.Int()); // All three notifications occur because they
- test_KErrNone(reqStat2.Int()); // are all monitoring the top level directory
- test_KErrNone(reqStat3.Int()); // Later, we'll test monitoring individual files...
+ test(reqStat1==KErrNone); // All three notifications occur because they
+ test(reqStat2==KErrNone); // are all monitoring the top level directory
+ test(reqStat3==KErrNone); // Later, we'll test monitoring individual files...
gSleepThread.Close();
thread1.Close();
test.Next(_L("Test reads and writes do cause notification under ENotifyAll"));
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\kangaroo.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
fs1.NotifyChange(ENotifyAll,reqStat1,path);
fs2.NotifyChange(ENotifyAll,reqStat2,path);
fs3.NotifyChange(ENotifyAll,reqStat3,path);
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
RThread thread2;
r=thread2.Create(_L("TestThread2"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
- test_KErrNone(r);
+ test(r==KErrNone);
thread2.Resume();
gSleepThread.Wait();
User::WaitForRequest(reqStat1);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat1.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
+ test(reqStat1==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
gSleepThread.Close();
thread2.Close();
@@ -1762,33 +1763,33 @@
fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
fs3.NotifyChange(ENotifyAll,reqStat3,path3);
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
RThread thread3;
r=thread3.Create(_L("TestThread3"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
- test_KErrNone(r);
+ test(r==KErrNone);
thread3.Resume();
gSleepThread.Wait();
User::WaitForRequest(reqStat1);
- test_KErrNone(reqStat1.Int());
- test_Value(reqStat2.Int(), reqStat2==KRequestPending); // Monitoring with ENotifyEntry
+ test(reqStat1==KErrNone);
+ test(reqStat2==KRequestPending); // Monitoring with ENotifyEntry
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat3.Int());
+ test(reqStat3==KErrNone);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\koala.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat2);
- test_KErrNone(reqStat2.Int());
+ test(reqStat2==KErrNone);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\dingo.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
gSleepThread.Close();
thread3.Close();
@@ -1805,17 +1806,17 @@
{
RFs fs; // Session to be notified of any changes
TInt r=fs.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
- test_Value(r, r == KErrNone||r==KErrAlreadyExists);
+ test(r==KErrNone||r==KErrAlreadyExists);
RFile file;
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.msg"),EFileStream);
- test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+ test(r==KErrNone||KErrAlreadyExists);
file.Close();
// Test notification on a specific file
@@ -1824,48 +1825,48 @@
TRequestStatus reqStat(KRequestPending);
TRequestStatus thrdStat(KRequestPending);
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
RThread thread;
r=thread.Create(_L("MyThread7"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest8);
- test_KErrNone(r);
+ test(r==KErrNone);
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
thread.Close();
// Test notification does not occur if a change is made above the file
fs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=thread.Create(_L("MyThread8"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
- test_KErrNone(r);
+ test(r==KErrNone);
thread.Logon(thrdStat);
thread.Resume();
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
User::After(500000);
thread.Close();
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NEWFILE.TXT"));
- test_KErrNone(r);
+ test(r==KErrNone);
// Test notification does not occur if a change is made to another file
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Lion.log"),EFileStream);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
file.Close();
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Lion.log"));
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
// Test notification occurs when a change is made to the file
test.Next(_L("Delete monitored file"));
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.Msg"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
fs.Close();
}
@@ -1879,9 +1880,9 @@
//
RFs fs;
TInt r=fs.Connect(); // Session to be notified of any changes
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
// RFile::Write() to a file within the monitored directory
test.Next(_L("RFile::Write()"));
@@ -1891,178 +1892,178 @@
RFile file;
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::Read() a file within the monitored directory - no notification for reads
path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
TBuf8<100> temp;
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
r=file.Read(0,temp,100);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
// RFile::SetAtt() of a file within the monitored directory
test.Next(_L("RFile::SetAtt()"));
r=file.SetAtt(KEntryAttSystem,KEntryAttNormal);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
// RFile::SetSize() of a file within the monitored directory
test.Next(_L("RFile::SetSize()"));
r=file.SetSize(256);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
file.Close();
// RFile::Temp() to create a temp file within the monitored directory
test.Next(_L("RFile::Temp()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
TFileName fileName;
r=file.Temp(TheFs,path,fileName,EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
file.Close();
// RFile::SetModified() to change modification time of a file within monitored dir
test.Next(_L("RFile::SetModified()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
TTime now;
now.HomeTime();
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
file.SetModified(now);
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFs::SetEntry() to change a directory entry within the monitored directory
test.Next(_L("RFs::SetEntry()"));
TEntry entry;
fs.NotifyChange(ENotifyAll,reqStat,path);
r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
now.HomeTime();
r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::Set() to change file's modification time and attributes
test.Next(_L("RFile::Set()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
now.HomeTime();
r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFs::SetDriveName()
test.Next(_L("RFs::SetDriveName()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
User::After(KNotifyChangeAfter);
r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
fs.NotifyChange(ENotifyEntry,reqStat,path);
User::After(KNotifyChangeAfter);
r=TheFs.SetDriveName(KDefaultDrive,_L("TEST"));
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
fs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
fs.NotifyChange(ENotifyDisk,reqStat,path);
User::After(KNotifyChangeAfter);
r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE"));
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
fs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// RFs::MkDir()
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
test.Next(_L("RFs::MkDir()"));
r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFs::RmDir()
test.Next(_L("RFs::RmDir()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::Create()
test.Next(_L("RFile::Create()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
file.Close();
// RFs::Delete()
test.Next(_L("RFs::Delete()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::Replace()
test.Next(_L("RFile::Replace()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
file.Close();
// RFs::Delete()
test.Next(_L("RFs::Delete()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFs::SetVolumeLabel() - should only be notification when monitoring relevant TNotifyTypes
test.Next(_L("RFs::SetVolumeLabel"));
@@ -2073,52 +2074,52 @@
TFileName currentVolName;
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
currentVolName=volInfo.iName;
r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
if (r==KErrNone)
{
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
test(volInfo.iName==_L("VOL"));
// Test notification occurs under ENotifyDisk
fs.NotifyChange(ENotifyDisk,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
test(volInfo.iName==_L("ABCDEFGHIJK"));
// Test notification does not occur under ENotifyAttributes
fs.NotifyChange(ENotifyAttributes,reqStat,path);
r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
test(volInfo.iName==_L("TROPICANA"));
fs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// Test notification occurs under ENotifyEntry
fs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.SetVolumeLabel(currentVolName,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
test(volInfo.iName==currentVolName);
}
@@ -2134,29 +2135,31 @@
test.Next(_L("RFs::Rename()"));
fs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Toto.doc"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Toto.doc"),_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"));
- test_KErrNone(r);
-
- if(!Is_SimulatedSystemDrive(TheFs,driveNum))
- {// Skip emulator/PlatSim drive C:
+ test(r==KErrNone);
+
+#if defined(__WINS__)
+ if(gSessionPath[0]=='Y'||gSessionPath[0]=='X')
+#endif
+ {
test.Next(_L("RFs::Rename() with max path length"));
TFileName longName=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
while(longName.Length()<(KMaxFileName-2))
longName+=_L("a");
r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),longName);
- test_KErrNone(r);
+ test(r==KErrNone);
fs.NotifyChange(ENotifyEntry,reqStat,longName);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Rename(longName,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
}
fs.Close();
@@ -2172,9 +2175,9 @@
//
RFs fs; // Session to be notified when a change occurs
TInt r=fs.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
// RFile::Write() to a file in the subtree
test.Next(_L("RFile::Write()"));
@@ -2184,48 +2187,48 @@
RFile file;
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::Read() a file within the monitored directory - no notification for reads
fs.NotifyChange(ENotifyAll,reqStat,path);
TBuf8<100> temp;
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
r=file.Read(0,temp,100);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
// RFile::SetAtt() of a file within the monitored directory
test.Next(_L("RFile::SetAtt()"));
r=file.SetAtt(KEntryAttNormal,KEntryAttHidden);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::SetSize() of a file within the monitored directory
test.Next(_L("RFile::SetSize()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.SetSize(256);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
file.Close();
// RFile::Temp() to create a temp file in the subtree
test.Next(_L("RFile::Temp()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
TFileName fileName;
r=file.Temp(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"),fileName,EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
file.Close();
// RFile::SetModified() to change modification time of a file within monitored dir
@@ -2234,118 +2237,118 @@
TTime now;
now.HomeTime();
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
file.SetModified(now);
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFs::Entry() to change a directory entry within the monitored directory
test.Next(_L("RFs::Entry()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
TEntry entry;
r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
now.HomeTime();
r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::Set() to change file's modification time and attributes
test.Next(_L("RFile::Set()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
now.HomeTime();
r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFs::SetDriveName()
test.Next(_L("RFs::SetDriveName()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
User::After(KNotifyChangeAfter);
r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
fs.NotifyChange(ENotifyEntry,reqStat,path);
r=TheFs.SetDriveName(KDefaultDrive,_L("TEST"));
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
User::After(KNotifyChangeAfter);
fs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
fs.NotifyChange(ENotifyDisk,reqStat,path);
User::After(KNotifyChangeAfter);
r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE"));
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
fs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// RFs::MkDir()
test.Next(_L("RFs::MkDir()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFs::RmDir()
test.Next(_L("RFs::RmDir()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::Create()
test.Next(_L("RFile::Create()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
file.Close();
// RFs::Delete()
test.Next(_L("RFs::Delete()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::Replace()
test.Next(_L("RFile::Replace()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
file.Close();
// RFs::Delete()
test.Next(_L("RFs::Delete()"));
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFs::SetVolumeLabel() - should be notification under relevant TNotifyType monitoring
// The operation is non-path specific so all outstanding interested requests are notified
@@ -2357,52 +2360,52 @@
TVolumeInfo volInfo;
TFileName currentVolName;
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
currentVolName=volInfo.iName;
r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
if (r==KErrNone)
{
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
test(volInfo.iName==_L("VOL"));
// Test notification occurs under ENotifyDisk
fs.NotifyChange(ENotifyDisk,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
test(volInfo.iName==_L("ABCDEFGHIJK"));
// Test notification does not occur under ENotifyAttributes
fs.NotifyChange(ENotifyAttributes,reqStat,path);
r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
test(volInfo.iName==_L("TROPICANA"));
fs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// Test notification occurs under ENotifyEntry
fs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.SetVolumeLabel(currentVolName,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
test(volInfo.iName==currentVolName);
}
@@ -2417,18 +2420,18 @@
// Test that notification is made when change is made to monitored directory
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
fs.Close();
}
@@ -2442,9 +2445,9 @@
//
RFs fs;
TInt r=fs.Connect(); // Session to be notified when a change occurs
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
// RFile::Write() to a file in the subtree
TFileName path=_L("\\F32-TST\\NOTIFY\\");
@@ -2453,35 +2456,35 @@
RFile file;
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::Read() a file within the monitored directory - no notification for reads
fs.NotifyChange(ENotifyAll,reqStat,path);
TBuf8<100> temp;
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
r=file.Read(0,temp,100);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
// RFile::SetAtt() of a file within the monitored directory
r=file.SetAtt(KEntryAttNormal,KEntryAttHidden);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::SetSize() of a file within the monitored directory
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.SetSize(256);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
file.Close();
@@ -2490,109 +2493,109 @@
TTime now;
now.HomeTime();
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
file.SetModified(now);
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFs::Entry() to change a directory entry within the monitored directory
fs.NotifyChange(ENotifyAll,reqStat,path);
TEntry entry;
r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
now.HomeTime();
r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::Set() to change file's modification time and attributes
fs.NotifyChange(ENotifyAll,reqStat,path);
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
now.HomeTime();
r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFs::SetDriveName() - should be no notification ever with extended notification
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
User::After(KNotifyChangeAfter);
r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
fs.NotifyChange(ENotifyEntry,reqStat,path);
User::After(KNotifyChangeAfter);
r=TheFs.SetDriveName(KDefaultDrive,_L("TEST"));
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
fs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
fs.NotifyChange(ENotifyDisk,reqStat,path);
User::After(KNotifyChangeAfter);
r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE"));
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
fs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// RFs::MkDir()
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFs::RmDir()
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::Create()
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
file.Close();
// RFs::Delete()
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFile::Replace()
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
file.Close();
// RFs::Delete()
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// RFs::SetVolumeLabel()
// Not path specific, so all outstanding requests of correct TNotifyType are notified
@@ -2601,52 +2604,52 @@
TVolumeInfo volInfo;
TFileName currentVolName;
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
currentVolName=volInfo.iName;
r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
if (r==KErrNone)
{
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
test(volInfo.iName==_L("VOL"));
// Test notification occurs under ENotifyDisk
fs.NotifyChange(ENotifyDisk,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
test(volInfo.iName==_L("ABCDEFGHIJK"));
// Test notification does not occur under ENotifyAttributes
fs.NotifyChange(ENotifyAttributes,reqStat,path);
r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
test(volInfo.iName==_L("TROPICANA"));
fs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
// Test notification occurs under ENotifyEntry
fs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.SetVolumeLabel(currentVolName,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
test(volInfo.iName==currentVolName);
}
@@ -2659,26 +2662,26 @@
// RFs::Rename()
fs.NotifyChange(ENotifyEntry,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Toto.doc"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
// Test that notification is made when change is made to monitored directory
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
fs.Close();
}
@@ -2693,20 +2696,20 @@
RFile file;
TInt r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\kangaroo.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\koala.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\dingo.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
RFs fs;
r=fs.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
TRequestStatus reqStat1(KRequestPending);
TFileName path1=_L("\\F32-TST\\NOTIFY\\");
@@ -2756,66 +2759,66 @@
r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
RThread thread1;
r=thread1.Create(_L("TestThread1"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
- test_KErrNone(r);
+ test(r==KErrNone);
thread1.Resume();
gSleepThread.Wait();
- test_Value(status1.Int(), status1==KRequestPending);
- test_Value(status2.Int(), status2==KRequestPending);
- test_Value(status3.Int(), status3==KRequestPending);
- test_Value(status4.Int(), status4==KRequestPending);
- test_Value(status5.Int(), status5==KRequestPending);
- test_Value(status6.Int(), status6==KRequestPending);
-
- test_Value(statusExtended1.Int(), statusExtended1==KRequestPending);
- test_Value(statusExtended2.Int(), statusExtended2==KRequestPending);
- test_Value(statusExtended3.Int(), statusExtended3==KRequestPending);
- test_Value(statusExtended4.Int(), statusExtended4==KRequestPending);
- test_Value(statusExtended5.Int(), statusExtended5==KRequestPending);
- test_Value(statusExtended6.Int(), statusExtended6==KRequestPending);
-
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(status1==KRequestPending);
+ test(status2==KRequestPending);
+ test(status3==KRequestPending);
+ test(status4==KRequestPending);
+ test(status5==KRequestPending);
+ test(status6==KRequestPending);
+
+ test(statusExtended1==KRequestPending);
+ test(statusExtended2==KRequestPending);
+ test(statusExtended3==KRequestPending);
+ test(statusExtended4==KRequestPending);
+ test(statusExtended5==KRequestPending);
+ test(statusExtended6==KRequestPending);
+
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat1);
- test_KErrNone(reqStat1.Int());
+ test(reqStat1==KErrNone);
User::WaitForRequest(status1);
- test_KErrNone(status1.Int());
+ test(status1==KErrNone);
User::WaitForRequest(status2);
- test_KErrNone(status2.Int());
+ test(status2==KErrNone);
User::WaitForRequest(status3);
- test_KErrNone(status3.Int());
+ test(status3==KErrNone);
User::WaitForRequest(status4);
- test_KErrNone(status4.Int());
+ test(status4==KErrNone);
User::WaitForRequest(status5);
- test_KErrNone(status5.Int());
+ test(status5==KErrNone);
User::WaitForRequest(status6);
- test_KErrNone(status6.Int());
+ test(status6==KErrNone);
User::WaitForRequest(statusExtended1);
- test_KErrNone(statusExtended1.Int());
+ test(statusExtended1==KErrNone);
User::WaitForRequest(statusExtended2);
- test_KErrNone(statusExtended2.Int());
+ test(statusExtended2==KErrNone);
User::WaitForRequest(statusExtended3);
- test_KErrNone(statusExtended3.Int());
+ test(statusExtended3==KErrNone);
User::WaitForRequest(statusExtended4);
- test_KErrNone(statusExtended4.Int());
+ test(statusExtended4==KErrNone);
User::WaitForRequest(statusExtended5);
- test_KErrNone(statusExtended5.Int());
+ test(statusExtended5==KErrNone);
User::WaitForRequest(statusExtended6);
- test_KErrNone(statusExtended6.Int());
+ test(statusExtended6==KErrNone);
User::WaitForRequest(reqStat2);
- test_KErrNone(reqStat2.Int());
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
fs.NotifyChangeCancel(); // Cancels both remaining notification requests
User::WaitForRequest(reqStat3);
@@ -2826,32 +2829,32 @@
test.Next(_L("Test reads and writes do cause notification under ENotifyAll"));
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\kangaroo.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
file.Close();
fs.NotifyChange(ENotifyAll,reqStat1,path1);
fs.NotifyChange(ENotifyEntry,reqStat2,path2);
fs.NotifyChange(ENotifyAll,reqStat3,path3);
fs.NotifyChange(ENotifyEntry,reqStat4,path4);
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
RThread thread2;
r=thread2.Create(_L("TestThread2"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
- test_KErrNone(r);
+ test(r==KErrNone);
thread2.Resume();
gSleepThread.Wait();
User::WaitForRequest(reqStat1);
- test_KErrNone(reqStat1.Int());
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
+ test(reqStat1==KErrNone);
+ test(reqStat2==KRequestPending);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending);
gSleepThread.Close();
thread2.Close();
@@ -2859,55 +2862,55 @@
fs.NotifyChange(ENotifyAll,reqStat1,path1);
fs.NotifyChange(ENotifyAll,reqStat3,path3);
- test_Value(reqStat1.Int(), reqStat1==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat1==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=gSleepThread.CreateLocal(0);
- test_KErrNone(r);
+ test(r==KErrNone);
RThread thread3;
r=thread3.Create(_L("TestThread3"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
- test_KErrNone(r);
+ test(r==KErrNone);
thread3.Resume();
gSleepThread.Wait();
User::WaitForRequest(reqStat1);
- test_KErrNone(reqStat1.Int());
- test_Value(reqStat2.Int(), reqStat2==KRequestPending); // Monitoring with ENotifyEntry
+ test(reqStat1==KErrNone);
+ test(reqStat2==KRequestPending); // Monitoring with ENotifyEntry
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending); // Monitoring with ENotifyEntry
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending); // Monitoring with ENotifyEntry
RFs fs2;
r=fs2.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs2.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
TRequestStatus reqStat(KRequestPending);
fs2.NotifyChange(ENotifyEntry,reqStat);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat2);
- test_KErrNone(reqStat2.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat2==KErrNone);
+ test(reqStat4==KRequestPending);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
+ test(reqStat==KErrNone);
fs2.NotifyChange(ENotifyAll,reqStat);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\koala.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KErrNone);
+ test(reqStat4==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\dingo.txt"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat4);
- test_KErrNone(reqStat4.Int());
+ test(reqStat4==KErrNone);
gSleepThread.Close();
thread3.Close();
@@ -2925,9 +2928,9 @@
//
RFs fs;
TInt r=fs.Connect(); // Session to be notified of any changes
- test_KErrNone(r);
+ test(r==KErrNone);
r=fs.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
// RFile::Write() to a file within the monitored directory
test.Next(_L("RFile::Write()"));
@@ -2943,7 +2946,7 @@
RFile file;
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
fs.NotifyChange(ENotifyAll,reqStat,path);
fs.NotifyChange(ENotifyFile,reqStat2,path);
@@ -2954,43 +2957,43 @@
fs.NotifyChange(ENotifyDisk,reqStat7,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrArgument); // Cannot monitor a file with ENotifyDir
- test_Value(reqStat5.Int(), reqStat5==KRequestPending);
- test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+ test(reqStat4==KErrArgument); // Cannot monitor a file with ENotifyDir
+ test(reqStat5==KRequestPending);
+ test(reqStat6==KRequestPending);
fs.NotifyChange(ENotifyEntry,reqStat4,path);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat4==KRequestPending);
r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
- test_Value(reqStat2.Int(), reqStat2==KRequestPending); // Monitoring with ENotifyFile
+ test(reqStat==KErrNone);
+ test(reqStat2==KRequestPending); // Monitoring with ENotifyFile
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending); // Monitoring with ENotifyEntry
- test_Value(reqStat5.Int(), reqStat5==KRequestPending);
- test_Value(reqStat6.Int(), reqStat6==KRequestPending);
- test_Value(reqStat7.Int(), reqStat7==KRequestPending);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending); // Monitoring with ENotifyEntry
+ test(reqStat5==KRequestPending);
+ test(reqStat6==KRequestPending);
+ test(reqStat7==KRequestPending);
fs.NotifyChangeCancel(); // Cancels all outstanding notification requests
User::WaitForRequest(reqStat2);
- test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+ test(reqStat2==KErrCancel);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
User::WaitForRequest(reqStat5);
- test_Value(reqStat5.Int(), reqStat5==KErrCancel);
+ test(reqStat5==KErrCancel);
User::WaitForRequest(reqStat6);
- test_Value(reqStat6.Int(), reqStat6==KErrCancel);
+ test(reqStat6==KErrCancel);
User::WaitForRequest(reqStat7);
- test_Value(reqStat7.Int(), reqStat7==KErrCancel);
+ test(reqStat7==KErrCancel);
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
// RFile::SetAtt() of a file within the monitored directory
fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3001,88 +3004,88 @@
fs.NotifyChange(ENotifyWrite,reqStat6,path);
fs.NotifyChange(ENotifyDisk,reqStat7,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
User::WaitForRequest(reqStat5);
- test_Value(reqStat5.Int(), reqStat5==KErrArgument);
- test_Value(reqStat6.Int(), reqStat6==KRequestPending);
- test_Value(reqStat7.Int(), reqStat7==KRequestPending);
+ test(reqStat5==KErrArgument);
+ test(reqStat6==KRequestPending);
+ test(reqStat7==KRequestPending);
test.Next(_L("RFile::SetAtt()"));
r=file.SetAtt(KEntryAttSystem,KEntryAttNormal);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat4);
- test_KErrNone(reqStat.Int());
- test_Value(reqStat2.Int(), reqStat2==KRequestPending); // Monitoring with ENotifyFile
- test_Value(reqStat3.Int(), reqStat3==KRequestPending); // Monitoring with ENotifyEntry
- test_KErrNone(reqStat4.Int()); // Monitoring a file - can't use ENotifyDir
- test_Value(reqStat6.Int(), reqStat6==KRequestPending);
- test_Value(reqStat7.Int(), reqStat7==KRequestPending);
+ test(reqStat==KErrNone);
+ test(reqStat2==KRequestPending); // Monitoring with ENotifyFile
+ test(reqStat3==KRequestPending); // Monitoring with ENotifyEntry
+ test(reqStat4==KErrNone); // Monitoring a file - can't use ENotifyDir
+ test(reqStat6==KRequestPending);
+ test(reqStat7==KRequestPending);
fs.NotifyChange(ENotifyWrite,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
fs.NotifyChange(ENotifyDir,reqStat4,path);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+ test(reqStat4==KErrArgument);
r=file.SetAtt(KEntryAttNormal,KEntryAttSystem);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending); // Monitoring with ENotifyWrite
+ test(r==KErrNone);
+ test(reqStat==KRequestPending); // Monitoring with ENotifyWrite
fs.NotifyChangeCancel(); // Cancel outstanding notification request
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
User::WaitForRequest(reqStat2);
- test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+ test(reqStat2==KErrCancel);
User::WaitForRequest(reqStat3);
- test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+ test(reqStat3==KErrCancel);
User::WaitForRequest(reqStat6);
- test_Value(reqStat6.Int(), reqStat6==KErrCancel);
+ test(reqStat6==KErrCancel);
User::WaitForRequest(reqStat7);
- test_Value(reqStat7.Int(), reqStat7==KErrCancel);
+ test(reqStat7==KErrCancel);
fs.NotifyChange(ENotifyAll,reqStat,path);
fs.NotifyChange(ENotifyFile,reqStat2,path);
fs.NotifyChange(ENotifyEntry,reqStat3,path);
fs.NotifyChange(ENotifyAttributes,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
// RFile::SetSize() of a file within the monitored directory
test.Next(_L("RFile::SetSize()"));
r=file.SetSize(256);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat4);
- test_KErrNone(reqStat.Int());
- test_Value(reqStat2.Int(), reqStat2==KRequestPending); // Monitoring with ENotifyFile
- test_Value(reqStat3.Int(), reqStat3==KRequestPending); // Monitoring with ENotifyEntry
- test_KErrNone(reqStat4.Int());
+ test(reqStat==KErrNone);
+ test(reqStat2==KRequestPending); // Monitoring with ENotifyFile
+ test(reqStat3==KRequestPending); // Monitoring with ENotifyEntry
+ test(reqStat4==KErrNone);
fs.NotifyChange(ENotifyWrite,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
fs.NotifyChange(ENotifyDir,reqStat4,path);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+ test(reqStat4==KErrArgument);
r=file.SetSize(200);
- test_KErrNone(r);
+ test(r==KErrNone);
User::After(1000000);
- test_Value(reqStat.Int(), reqStat==KRequestPending); // Monitoring with ENotifyWrite
+ test(reqStat==KRequestPending); // Monitoring with ENotifyWrite
file.Close();
fs.NotifyChangeCancel(); // Cancels all outstanding notification requests
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
User::WaitForRequest(reqStat2);
- test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+ test(reqStat2==KErrCancel);
User::WaitForRequest(reqStat3);
- test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+ test(reqStat3==KErrCancel);
// RFile::Temp() to create a temp file within the monitored directory
test.Next(_L("RFile::Temp()"));
@@ -3093,47 +3096,47 @@
fs.NotifyChange(ENotifyEntry,reqStat3,path);
fs.NotifyChange(ENotifyAttributes,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
TFileName fileName;
r=file.Temp(TheFs,path,fileName,EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending); // Monitoring ENotifyEntry
- test_Value(reqStat4.Int(), reqStat4==KRequestPending); // Monitoring ENotifyAttributes
+ test(reqStat==KErrNone);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending); // Monitoring ENotifyEntry
+ test(reqStat4==KRequestPending); // Monitoring ENotifyAttributes
file.Close();
fs.NotifyChangeCancel();
User::WaitForRequest(reqStat2);
- test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+ test(reqStat2==KErrCancel);
User::WaitForRequest(reqStat3);
- test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+ test(reqStat3==KErrCancel);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
fs.NotifyChange(ENotifyFile,reqStat,path);
fs.NotifyChange(ENotifyDisk,reqStat2,path);
fs.NotifyChange(ENotifyWrite,reqStat3,path);
r=file.Temp(TheFs,path,fileName,EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending); // Monitoring ENotifyFile
- test_Value(reqStat2.Int(), reqStat2==KRequestPending); // Monitoring ENotifyDisk
- test_Value(reqStat3.Int(), reqStat3==KRequestPending); // Monitoring ENotifyWrite
+ test(r==KErrNone);
+ test(reqStat==KRequestPending); // Monitoring ENotifyFile
+ test(reqStat2==KRequestPending); // Monitoring ENotifyDisk
+ test(reqStat3==KRequestPending); // Monitoring ENotifyWrite
file.Close();
fs.NotifyChangeCancel(); // Cancels all outstanding notification requests
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
User::WaitForRequest(reqStat2);
- test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+ test(reqStat2==KErrCancel);
User::WaitForRequest(reqStat3);
- test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+ test(reqStat3==KErrCancel);
// RFile::SetModified() to change modification time of a file within monitored dir
test.Next(_L("RFile::SetModified()"));
@@ -3143,30 +3146,30 @@
fs.NotifyChange(ENotifyAttributes,reqStat3,path);
fs.NotifyChange(ENotifyFile,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
TTime now;
now.HomeTime();
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
file.SetModified(now);
file.Close();
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
+ test(reqStat==KErrNone);
+ test(reqStat2==KRequestPending);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending);
fs.NotifyChangeCancel();
User::WaitForRequest(reqStat2);
- test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+ test(reqStat2==KErrCancel);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
// RFs::SetEntry() to change a directory entry within the monitored directory
test.Next(_L("RFs::SetEntry()"));
@@ -3176,28 +3179,28 @@
fs.NotifyChange(ENotifyAttributes,reqStat3,path);
fs.NotifyChange(ENotifyDisk,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\NewFile.txt"),entry);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
now.HomeTime();
r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\NewFile.txt"),now,KEntryAttHidden,KEntryAttNormal);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int());
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KErrNone);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending);
fs.NotifyChangeCancel();
User::WaitForRequest(reqStat2);
- test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+ test(reqStat2==KErrCancel);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
// RFile::Set() to change file's modification time and attributes
test.Next(_L("RFile::Set()"));
@@ -3206,29 +3209,29 @@
fs.NotifyChange(ENotifyAttributes,reqStat3,path);
fs.NotifyChange(ENotifyWrite,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
now.HomeTime();
r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
file.Close();
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int());
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KErrNone);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending);
fs.NotifyChangeCancel();
User::WaitForRequest(reqStat2);
- test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+ test(reqStat2==KErrCancel);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
// RFs::SetDriveName()
@@ -3238,27 +3241,27 @@
fs.NotifyChange(ENotifyDisk,reqStat3,path);
fs.NotifyChange(ENotifyAttributes,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
User::After(KNotifyChangeAfter);
r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
- test_KErrNone(reqStat.Int());
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KErrNone);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
fs.NotifyChangeCancel();
User::WaitForRequest(reqStat2);
- test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+ test(reqStat2==KErrCancel);
User::WaitForRequest(reqStat3);
- test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+ test(reqStat3==KErrCancel);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
// RFs::MkDir()
test.Next(_L("RFs::MkDir()"));
@@ -3269,20 +3272,20 @@
fs.NotifyChange(ENotifyDir,reqStat3,path);
fs.NotifyChange(ENotifyFile,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending);
// RFs::RmDir()
test.Next(_L("RFs::RmDir()"));
@@ -3290,24 +3293,24 @@
fs.NotifyChange(ENotifyDir,reqStat2,path);
fs.NotifyChange(ENotifyWrite,reqStat3,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
fs.NotifyChangeCancel();
User::WaitForRequest(reqStat3);
- test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+ test(reqStat3==KErrCancel);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
// RFile::Create()
test.Next(_L("RFile::Create()"));
@@ -3316,20 +3319,20 @@
fs.NotifyChange(ENotifyDir,reqStat3,path);
fs.NotifyChange(ENotifyFile,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat4);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_Value(reqStat3.Int(), reqStat3==KRequestPending); // Monitoring ENotifyDir
- test_KErrNone(reqStat4.Int());
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KRequestPending); // Monitoring ENotifyDir
+ test(reqStat4==KErrNone);
file.Close();
fs.NotifyChangeCancel(reqStat3);
User::WaitForRequest(reqStat3);
@@ -3339,26 +3342,26 @@
fs.NotifyChange(ENotifyDisk,reqStat3,path);
fs.NotifyChange(ENotifyWrite,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Bad_Witch.bat"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
file.Close();
fs.NotifyChangeCancel();
User::WaitForRequest(reqStat3);
- test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+ test(reqStat3==KErrCancel);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
// RFs::Delete()
test.Next(_L("RFs::Delete()"));
@@ -3367,46 +3370,46 @@
fs.NotifyChange(ENotifyDir,reqStat3,path);
fs.NotifyChange(ENotifyFile,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat4);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_Value(reqStat3.Int(), reqStat3==KRequestPending); // Monitoring ENotifyDir
- test_KErrNone(reqStat4.Int());
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KRequestPending); // Monitoring ENotifyDir
+ test(reqStat4==KErrNone);
fs.NotifyChangeCancel(reqStat3);
User::WaitForRequest(reqStat3);
- test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+ test(reqStat3==KErrCancel);
fs.NotifyChange(ENotifyAll,reqStat,path);
fs.NotifyChange(ENotifyEntry,reqStat2,path);
fs.NotifyChange(ENotifyAttributes,reqStat3,path);
fs.NotifyChange(ENotifyAll,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Bad_Witch.bat"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat4);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_KErrNone(reqStat4.Int());
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KErrNone);
fs.NotifyChangeCancel(reqStat3);
User::WaitForRequest(reqStat3);
- test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+ test(reqStat3==KErrCancel);
// RFile::Replace()
test.Next(_L("RFile::Replace()"));
@@ -3415,28 +3418,28 @@
fs.NotifyChange(ENotifyFile,reqStat3,path);
fs.NotifyChange(ENotifyDir,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending);
file.Close();
fs.NotifyChangeCancel();
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
// RFs::Delete()
test.Next(_L("RFs::Delete()"));
@@ -3446,21 +3449,21 @@
fs.NotifyChange(ENotifyFile,reqStat3,path);
fs.NotifyChange(ENotifyDir,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+ test(reqStat4==KErrArgument);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KErrArgument);
// RFs::SetVolumeLabel()
test.Next(_L("RFs::SetVolumeLabel()"));
@@ -3473,20 +3476,20 @@
fs.NotifyChange(ENotifyAttributes,reqStat6,path);
fs.NotifyChange(ENotifyDisk,reqStat7,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
- test_Value(reqStat5.Int(), reqStat5==KRequestPending);
- test_Value(reqStat6.Int(), reqStat6==KRequestPending);
- test_Value(reqStat7.Int(), reqStat7==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
+ test(reqStat5==KRequestPending);
+ test(reqStat6==KRequestPending);
+ test(reqStat7==KRequestPending);
TInt driveNum=CurrentDrive();
TVolumeInfo volInfo;
TFileName currentVolName;
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
currentVolName=volInfo.iName;
r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
@@ -3496,51 +3499,51 @@
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat7);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
- test_Value(reqStat5.Int(), reqStat5==KRequestPending);
- test_Value(reqStat6.Int(), reqStat6==KRequestPending);
- test_KErrNone(reqStat7.Int());
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
+ test(reqStat5==KRequestPending);
+ test(reqStat6==KRequestPending);
+ test(reqStat7==KErrNone);
fs.NotifyChange(ENotifyAll,reqStat,path);
fs.NotifyChange(ENotifyEntry,reqStat2,path);
fs.NotifyChange(ENotifyDisk,reqStat7,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat7.Int(), reqStat7==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat7==KRequestPending);
r=TheFs.SetVolumeLabel(currentVolName,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat7);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
- test_Value(reqStat5.Int(), reqStat5==KRequestPending);
- test_Value(reqStat6.Int(), reqStat6==KRequestPending);
- test_KErrNone(reqStat7.Int());
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
+ test(reqStat5==KRequestPending);
+ test(reqStat6==KRequestPending);
+ test(reqStat7==KErrNone);
r=TheFs.Volume(volInfo,driveNum);
- test_KErrNone(r);
+ test(r==KErrNone);
test(volInfo.iName==currentVolName);
fs.NotifyChangeCancel();
User::WaitForRequest(reqStat3);
- test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+ test(reqStat3==KErrCancel);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
User::WaitForRequest(reqStat5);
- test_Value(reqStat5.Int(), reqStat5==KErrCancel);
+ test(reqStat5==KErrCancel);
User::WaitForRequest(reqStat6);
- test_Value(reqStat6.Int(), reqStat6==KErrCancel);
+ test(reqStat6==KErrCancel);
}
else // RFs::SetVolumeLabel() doesn't work on subst drives
@@ -3567,49 +3570,49 @@
fs.NotifyChange(ENotifyFile,reqStat3,path);
fs.NotifyChange(ENotifyDir,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=file.Rename(_L("\\F32-TST\\NOTIFY\\OldFile.abc"));
- test_Value(r, r == KErrNone||r==KErrAlreadyExists);
+ test(r==KErrNone||r==KErrAlreadyExists);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending); // Monitoring ENotifyDir
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending); // Monitoring ENotifyDir
file.Close();
fs.NotifyChangeCancel();
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
path=_L("\\F32-TST\\NOTIFY\\OldFile.abc");
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\OldFile.abc"),EFileShareExclusive|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
fs.NotifyChange(ENotifyAll,reqStat,path);
fs.NotifyChange(ENotifyEntry,reqStat2,path);
fs.NotifyChange(ENotifyFile,reqStat3,path);
fs.NotifyChange(ENotifyDir,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+ test(reqStat4==KErrArgument);
r=file.Rename(_L("\\F32-TST\\NOTIFY\\NewFile.xyz"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KErrArgument);
file.Close();
// RFs::Rename()
@@ -3620,27 +3623,27 @@
fs.NotifyChange(ENotifyFile,reqStat3,path);
fs.NotifyChange(ENotifyDir,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\NewFile.xyz"),_L("\\F32-TST\\NOTIFY\\NewerFile.cat"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending); // Changed a file not a directory entry
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending); // Changed a file not a directory entry
fs.NotifyChangeCancel();
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
path=_L("\\F32-TST\\NOTIFY\\NewerFile.cat");
fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3648,20 +3651,20 @@
fs.NotifyChange(ENotifyFile,reqStat3,path);
fs.NotifyChange(ENotifyDir,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+ test(reqStat4==KErrArgument);
r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\NewerFile.cat"),_L("\\F32-TST\\NOTIFY\\Original.dog"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
path=_L("\\F32-TST\\NOTIFY\\");
fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3669,22 +3672,22 @@
fs.NotifyChange(ENotifyFile,reqStat3,path);
fs.NotifyChange(ENotifyDir,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\"),_L("\\F32-TST\\NOTIFY_TEMP\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
User::WaitForRequest(reqStat4);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int()); // Changed a directory entry but notified anyway despite
- test_KErrNone(reqStat4.Int()); // requesting file notification only because the path we
- // were monitoring has changed
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone); // Changed a directory entry but notified anyway despite
+ test(reqStat4==KErrNone); // requesting file notification only because the path we
+ // were monitoring has changed
path=_L("\\F32-TST\\NOTIFY_TEMP\\Original.dog");
fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3692,113 +3695,113 @@
fs.NotifyChange(ENotifyFile,reqStat3,path);
fs.NotifyChange(ENotifyDir,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+ test(reqStat4==KErrArgument);
r=TheFs.Rename(_L("\\F32-TST\\NOTIFY_TEMP\\"),_L("\\F32-TST\\NOTIFY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int()); // Modified a directory above the level at which we
- test_KErrNone(reqStat2.Int()); // are monitoring for changes - we must be notified
- test_KErrNone(reqStat3.Int()); // anyway because the path has changed
+ test(reqStat==KErrNone); // Modified a directory above the level at which we
+ test(reqStat2==KErrNone); // are monitoring for changes - we must be notified
+ test(reqStat3==KErrNone); // anyway because the path has changed
fs.NotifyChange(ENotifyAll,reqStat,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
fs.NotifyChange(ENotifyEntry,reqStat2,path);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
+ test(reqStat2==KRequestPending);
fs.NotifyChange(ENotifyFile,reqStat3,path);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat3==KRequestPending);
fs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
fs.NotifyChangeCancel(reqStat2);
User::WaitForRequest(reqStat2);
- test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+ test(reqStat2==KErrCancel);
fs.NotifyChangeCancel(reqStat3);
User::WaitForRequest(reqStat3);
- test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+ test(reqStat3==KErrCancel);
path=_L("\\F32-TST\\NOTIFY\\Original.dog");
fs.NotifyChange(ENotifyAll,reqStat,path);
fs.NotifyChange(ENotifyEntry,reqStat2,path);
fs.NotifyChange(ENotifyFile,reqStat3,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Original.dog"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
path=_L("\\F32-TST\\NOTIFY\\");
fs.NotifyChange(ENotifyAll,reqStat,path);
fs.NotifyChange(ENotifyEntry,reqStat2,path);
fs.NotifyChange(ENotifyDir,reqStat3,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
r=TheFs.Rename(_L("\\F32-TST\\"),_L("\\F32-TEST\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int()); // Modified a directory above the level at which we
- test_KErrNone(reqStat2.Int()); // are monitoring for changes but we receive notification
- test_KErrNone(reqStat3.Int()); // because the notification path has been changed
+ test(reqStat==KErrNone); // Modified a directory above the level at which we
+ test(reqStat2==KErrNone); // are monitoring for changes but we receive notification
+ test(reqStat3==KErrNone); // because the notification path has been changed
fs.NotifyChange(ENotifyAll,reqStat,path);
// Notification request is submitted, despite the subject's disappearance
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
fs.NotifyChange(ENotifyEntry,reqStat2,path);
// Notification request is submitted, despite the subject's disappearance
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
+ test(reqStat2==KRequestPending);
fs.NotifyChange(ENotifyFile,reqStat3,path);
// Notification request is submitted, despite the subject's disappearance
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat3==KRequestPending);
fs.NotifyChangeCancel(reqStat);
User::WaitForRequest(reqStat);
- test_Value(reqStat.Int(), reqStat==KErrCancel);
+ test(reqStat==KErrCancel);
fs.NotifyChangeCancel(reqStat2);
User::WaitForRequest(reqStat2);
- test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+ test(reqStat2==KErrCancel);
fs.NotifyChangeCancel(reqStat3);
User::WaitForRequest(reqStat3);
- test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+ test(reqStat3==KErrCancel);
path=_L("\\F32-TEST\\NOTIFY\\");
fs.NotifyChange(ENotifyAll,reqStat,path);
fs.NotifyChange(ENotifyEntry,reqStat2,path);
fs.NotifyChange(ENotifyDir,reqStat3,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
r=TheFs.Rename(_L("\\F32-TEST\\NOTIFY\\"),_L("\\F32-TEST\\NOTIFY_CHANGED\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int()); // Rename the directory we were monitoring
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
+ test(reqStat==KErrNone); // Rename the directory we were monitoring
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
// Tidy up the test directory before continuing (while testing notifications of renaming to the monitored directory)
@@ -3808,26 +3811,26 @@
fs.NotifyChange(ENotifyDir,reqStat3,path);
fs.NotifyChange(ENotifyFile,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=TheFs.Rename(_L("\\F32-TEST\\"),_L("\\F32-TST\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int()); // Renaming to (under) the directory we were monitoring
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KErrNone); // Renaming to (under) the directory we were monitoring
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending);
fs.NotifyChangeCancel(reqStat4);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
path=_L("\\F32-TST\\NOTIFY\\");
fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3835,26 +3838,26 @@
fs.NotifyChange(ENotifyDir,reqStat3,path);
fs.NotifyChange(ENotifyFile,reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=TheFs.Rename(_L("\\F32-TST\\NOTIFY_CHANGED\\"),_L("\\F32-TST\\NOTIFY\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int()); // Renaming to the directory we were monitoring
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KErrNone); // Renaming to the directory we were monitoring
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending);
fs.NotifyChangeCancel(reqStat4);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
// Test combinations of notify types
test.Next(_L("Test combinations of notify types"));
@@ -3865,24 +3868,24 @@
fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyFile),reqStat3,path);
fs.NotifyChange((TNotifyType)(ENotifyDisk|ENotifyAttributes),reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending); // Monitoring ENotifyAttributes|ENotifyDisk
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending); // Monitoring ENotifyAttributes|ENotifyDisk
file.Close();
fs.NotifyChangeCancel(reqStat4);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
// RFile::SetModified()
fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3890,28 +3893,28 @@
fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyFile),reqStat3,path);
fs.NotifyChange((TNotifyType)(ENotifyDisk|ENotifyAttributes),reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
TTime nowTime;
nowTime.HomeTime();
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite);
- test_KErrNone(r);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(r==KErrNone);
+ test(reqStat==KRequestPending);
file.SetModified(now);
file.Close();
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat4);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_KErrNone(reqStat4.Int());
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KErrNone);
fs.NotifyChangeCancel();
User::WaitForRequest(reqStat3);
- test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+ test(reqStat3==KErrCancel);
// RFile::Write()
fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3919,25 +3922,25 @@
fs.NotifyChange((TNotifyType)(ENotifyFile|ENotifyWrite),reqStat3,path);
fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyWrite),reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
file.Close();
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat3);
User::WaitForRequest(reqStat4);
- test_KErrNone(reqStat.Int());
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_KErrNone(reqStat3.Int());
- test_KErrNone(reqStat4.Int());
+ test(reqStat==KErrNone);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KErrNone);
fs.NotifyChangeCancel(reqStat2); // Cancels all outstanding notification requests
User::WaitForRequest(reqStat2);
- test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+ test(reqStat2==KErrCancel);
// RFs::Delete()
test.Next(_L("RFs::Delete()"));
@@ -3946,23 +3949,23 @@
fs.NotifyChange((TNotifyType)(ENotifyFile|ENotifyWrite),reqStat3,path);
fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyWrite),reqStat4,path);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
- test_Value(reqStat2.Int(), reqStat2==KRequestPending);
- test_Value(reqStat3.Int(), reqStat3==KRequestPending);
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KRequestPending);
+ test(reqStat2==KRequestPending);
+ test(reqStat3==KRequestPending);
+ test(reqStat4==KRequestPending);
r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Munchkin.msg"));
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(reqStat);
User::WaitForRequest(reqStat2);
User::WaitForRequest(reqStat3);
- test_KErrNone(reqStat.Int());
- test_KErrNone(reqStat2.Int());
- test_KErrNone(reqStat3.Int());
- test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+ test(reqStat==KErrNone);
+ test(reqStat2==KErrNone);
+ test(reqStat3==KErrNone);
+ test(reqStat4==KRequestPending);
fs.NotifyChangeCancel(reqStat4);
User::WaitForRequest(reqStat4);
- test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+ test(reqStat4==KErrCancel);
fs.Close();
}
@@ -3980,48 +3983,48 @@
RFs fs;
TInt r=fs.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
TDriveInfo driveInfo;
TInt driveNum = EDriveC + SocketToDrive[gSocketNumber];
// verify TDriveInfo.iType == EMediaHardDisk
r = fs.Drive(driveInfo, driveNum);
- test_KErrNone(r);
+ test (r == KErrNone);
test.Printf(_L("iType = %d\n"), driveInfo.iType);
test(driveInfo.iType == EMediaHardDisk);
// ask the user to eject the media
TheFs.NotifyChange(ENotifyEntry,reqStat);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
test.Printf(_L("Please eject media on drive %C...\n"), 'A' + driveNum);
User::WaitForRequest(reqStat);
test.Printf(_L("Done.\n"));
TInt reqInt=reqStat.Int();
- test_KErrNone(reqInt);
+ test(reqInt==KErrNone);
User::WaitForRequest(reqStat);
// verify TDriveInfo.iType == EMediaNotPresent
r = fs.Drive(driveInfo, driveNum);
- test_KErrNone(r);
+ test (r == KErrNone);
test.Printf(_L("iType = %d\n"), driveInfo.iType);
test(driveInfo.iType == EMediaNotPresent);
// ask the user to re-insert the media
TheFs.NotifyChange(ENotifyEntry,reqStat);
- test_Value(reqStat.Int(), reqStat==KRequestPending);
+ test(reqStat==KRequestPending);
test.Printf(_L("Please re-insert media...\n"));
User::WaitForRequest(reqStat);
test.Printf(_L("Done.\n"));
reqInt = reqStat.Int();
- test_KErrNone(reqInt);
+ test(reqInt==KErrNone);
User::WaitForRequest(reqStat);
// verify TDriveInfo.iType == EMediaHardDisk
r = fs.Drive(driveInfo, driveNum);
- test_KErrNone(r);
+ test (r == KErrNone);
test.Printf(_L("iType = %d\n"), driveInfo.iType);
test(driveInfo.iType == EMediaHardDisk);
@@ -4055,39 +4058,39 @@
test.Next(_L("Test original behaviour of asynchronous read API"));
RFile reader;
TInt r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileShareAny);
- test_KErrNone(r);
+ test(r==KErrNone);
TBuf8<596> readBuf;
reader.Read(0, readBuf, 100, readStat1);
User::WaitForRequest(readStat1);
- test_KErrNone(readStat1.Int());
- test_Equal(0, readBuf.Length());
+ test(readStat1==KErrNone);
+ test(readBuf.Length()==0);
reader.Close();
test.Next(_L("Test asynchronous read fails in EFileShareExclusive mode"));
r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareExclusive);
- test_Value(r, r == KErrArgument);
+ test(r==KErrArgument);
test.Next(_L("Test asynchronous read fails in EFileShareReadersOnly mode"));
r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareReadersOnly);
- test_Value(r, r == KErrArgument);
+ test(r==KErrArgument);
test.Next(_L("Test asynchronous read is cancelled when file is closed"));
r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
- test_KErrNone(r);
+ test(r==KErrNone);
reader.Read(0, readBuf, 100, readStat1);
- test_Value(readStat1.Int(), readStat1==KRequestPending);
+ test(readStat1==KRequestPending);
reader.Close();
User::WaitForRequest(readStat1);
- test_Value(readStat1.Int(), readStat1==KErrCancel);
+ test(readStat1==KErrCancel);
test.Next(_L("Test asynchronous read can be cancelled"));
r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
- test_KErrNone(r);
+ test(r==KErrNone);
reader.Read(0, readBuf, 100, readStat1);
- test_Value(readStat1.Int(), readStat1==KRequestPending);
+ test(readStat1==KRequestPending);
reader.ReadCancel(readStat1);
User::WaitForRequest(readStat1);
- test_Value(readStat1.Int(), readStat1==KErrCancel);
+ test(readStat1==KErrCancel);
reader.Close();
// DEF105438: File server thread safety issues
@@ -4095,63 +4098,63 @@
// runs (to test whether cancelling still works...)
test.Next(_L("Test asynchronous read is cancelled when running at high priority"));
r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
- test_KErrNone(r);
+ test(r==KErrNone);
RThread thisThread;
thisThread.SetPriority(EPriorityRealTime);
reader.Read(0, readBuf, 100, readStat1);
- test_Value(readStat1.Int(), readStat1==KRequestPending);
+ test(readStat1==KRequestPending);
reader.ReadCancel(readStat1);
test.Printf(_L("readStat1 %d"), readStat1.Int());
User::WaitForRequest(readStat1);
- test_Value(readStat1.Int(), readStat1==KErrCancel);
+ test(readStat1==KErrCancel);
reader.Close();
thisThread.SetPriority(EPriorityNormal);
test.Next(_L("Test asynchronous read is notified due to RFile::SetSize()"));
r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
- test_KErrNone(r);
+ test(r==KErrNone);
reader.Read(0, readBuf, 100, readStat1);
- test_Value(readStat1.Int(), readStat1==KRequestPending);
+ test(readStat1==KRequestPending);
r = reader.SetSize(100);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForRequest(readStat1);
- test_KErrNone(readStat1.Int());
- test_Equal(100, readBuf.Length());
+ test(readStat1==KErrNone);
+ test(readBuf.Length() == 100);
r=reader.SetSize(0);
- test_KErrNone(r);
+ test(r==KErrNone);
reader.Close();
test.Next(_L("Test asynchronous read is notified due to RFile::Write()"));
r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
- test_KErrNone(r);
+ test(r==KErrNone);
reader.Read(0, readBuf, 26, readStat1);
- test_Value(readStat1.Int(), readStat1==KRequestPending);
+ test(readStat1==KRequestPending);
RFile writer;
r=writer.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileWrite|EFileShareAny);
writer.Write(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
User::WaitForRequest(readStat1);
- test_KErrNone(readStat1.Int());
- test_Equal(26, readBuf.Length());
+ test(readStat1==KErrNone);
+ test(readBuf.Length() == 26);
reader.Close();
writer.Close();
test.Next(_L("Test multiple asynchronous readers notified from separate thread"));
r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
- test_KErrNone(r);
+ test(r==KErrNone);
r=reader.SetSize(0);
- test_KErrNone(r);
+ test(r==KErrNone);
const TInt KReadLen = 26;
test.Printf(_L(">Read%d[%d]\n"), 0, KReadLen);
reader.Read(0, readBuf, KReadLen, readStat1);
TBuf8<596> readBuf2;
test.Printf(_L(">Read%d[%d]\n"), 1, KReadLen);
reader.Read(KReadLen, readBuf2, KReadLen, readStat2);
- test_Value(readStat1.Int(), readStat1==KRequestPending);
- test_Value(readStat2.Int(), readStat2==KRequestPending);
+ test(readStat1==KRequestPending);
+ test(readStat2==KRequestPending);
RThread thread;
r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest12);
- test_KErrNone(r);
+ test(r==KErrNone);
thread.Logon(thrdStat);
thread.Resume();
thread.Close();
@@ -4160,7 +4163,7 @@
TRequestStatus timerStat(KRequestPending);
timer.CreateLocal();
timer.After(timerStat, 30000000); // 30 seconds timeout (the following async test should take 10 seconds)
- test_Value(timerStat.Int(), timerStat==KRequestPending);
+ test(timerStat==KRequestPending);
#define ODDPASS (pass&0x01)
#define REQSTAT (ODDPASS ? readStat2 : readStat1)
@@ -4174,13 +4177,13 @@
FOREVER
{
User::WaitForRequest(REQSTAT, timerStat);
- test_KErrNone(REQSTAT.Int());
- test_Value(timerStat.Int(), timerStat==KRequestPending);
- test_Equal(COMPLEN, READBUF.Length());
+ test(REQSTAT==KErrNone);
+ test(timerStat==KRequestPending);
+ test(READBUF.Length() == COMPLEN);
test(READBUF.Right(KReadLen) == _L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
test.Printf(_L(">Read%d[%d]\n"), pass&0x01, READLEN);
reader.Read(READPOS, READBUF, READLEN, REQSTAT);
- test_Value(REQSTAT.Int(), REQSTAT==KRequestPending);
+ test(REQSTAT==KRequestPending);
if(++pass==10)
break;
}
@@ -4190,12 +4193,12 @@
User::WaitForRequest(timerStat);
reader.Close();
User::WaitForRequest(readStat1);
- test_Value(readStat1.Int(), readStat1==KErrCancel);
+ test(readStat1==KErrCancel);
User::WaitForRequest(readStat2);
- test_Value(readStat2.Int(), readStat2==KErrCancel);
+ test(readStat2==KErrCancel);
User::WaitForRequest(thrdStat);
- test_KErrNone(thrdStat.Int());
+ test(thrdStat==KErrNone);
}
@@ -4215,7 +4218,7 @@
//-- set up notifier
TheFs.NotifyChange(ENotifyAll, reqStatNotify1, KTestPath);
- test_Value(reqStatNotify1.Int(), reqStatNotify1 == KRequestPending);
+ test(reqStatNotify1.Int() == KRequestPending);
//-- create a file in the root dir
RFile file;
@@ -4224,12 +4227,12 @@
fileName.Append(_L("TestFile.tst"));
nRes=file.Replace(TheFs, fileName, EFileWrite|EFileRead);
- test_Value(nRes, nRes == KErrNone || nRes ==KErrAlreadyExists);
+ test(nRes == KErrNone || nRes ==KErrAlreadyExists);
file.Close();
//-- check that the notifier worked
User::WaitForRequest(reqStatNotify1);
- test_KErrNone(reqStatNotify1.Int());
+ test(reqStatNotify1.Int() == KErrNone);
}
@@ -4284,7 +4287,7 @@
if (r == KErrNotSupported)
continue;
- test_KErrNone(r);
+ test(r==KErrNone);
TInt sockNum = 0;
if (d.IsRemovable(sockNum)>0)
{
@@ -4320,7 +4323,7 @@
// Test RFs::NotifyChange() extended notification
TInt uid;
- test_KErrNone(HAL::Get(HAL::EMachineUid,uid));
+ test(HAL::Get(HAL::EMachineUid,uid)==KErrNone);
if(uid!=HAL::EMachineUid_Cogent && uid!=HAL::EMachineUid_IQ80310 &&
uid != HAL::EMachineUid_Integrator && uid!=HAL::EMachineUid_X86PC)
MediaChangeExtendedNotification();