--- a/kerneltest/f32test/server/t_dcallfiles.cpp Thu Aug 19 11:14:22 2010 +0300
+++ b/kerneltest/f32test/server/t_dcallfiles.cpp Tue Aug 31 16:34:26 2010 +0300
@@ -13,6 +13,7 @@
// Description:
//
+#define __E32TEST_EXTENSION__
#include <f32file.h>
#include <e32test.h>
#include <e32std.h>
@@ -88,9 +89,6 @@
TRequestStatus aStat3;
TRequestStatus aStat4;
-TVolumeInfo aVolInfo;
-// TDriveInfo adriveInfo;
-
TBuf<40> systestfile;
TBuf<40> pritestfile;
TBuf<40> restestfile;
@@ -113,13 +111,13 @@
//
{
TInt r = TheFs.Rename(_L("\\sys"), _L("\\sysbad"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r = TheFs.Rename(_L("\\resource"), _L("\\resourcebad"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r = TheFs.Rename(_L("\\private"), _L("\\privatebad"));
- test(r == KErrNone);
+ test_KErrNone(r);
r = TheFs.Rename(_L("\\privatebad"), _L("\\private"));
- test(r == KErrNone);
+ test_KErrNone(r);
}
LOCAL_C void systemRFstest()
@@ -135,16 +133,16 @@
mkdirname.Append(systestname);
mkdirname.Append(KMkDirSub);
r=TheFs.MkDirAll(mkdirname);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.RmDir(mkdirname);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.SetSubst(systestname,EDriveO);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.SetSessionPath(systestname);
- test(r==KErrNone);
+ test_KErrNone(r);
TheFs.NotifyChange(ENotifyAll,aStat1,systestname);
test(aStat1==KRequestPending);
@@ -159,29 +157,29 @@
oldName[0]=(TText)gDriveToTest;
r=TheFs.GetShortName(systestfile, shortfilename);
- test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
+ test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
r=TheFs.GetLongName(systestfile1, longfilename);
- test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
+ test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
r=file1.Create(TheFs,oldName,EFileWrite);
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
file1.Close();
r=TheFs.Replace(oldName,systestfile);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.Rename(systestfile,systestfile1);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.Entry(systestfile1,entry);
- test(r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.Delete(systestfile1);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
}
@@ -199,20 +197,20 @@
mkdirname.Append(restestname);
mkdirname.Append(KMkDirSub);
r=TheFs.MkDirAll(mkdirname);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
TheFs.RmDir(mkdirname);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.SetSubst(restestname,EDriveO);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.RealName(_L("O:\\File.XXX"),realName);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.SetSessionPath(restestname);
- test(r==KErrNone);
+ test_KErrNone(r);
TheFs.NotifyChange(ENotifyAll,aStat4,restestname);
test(aStat4==KRequestPending);
@@ -228,29 +226,29 @@
oldName[0]=(TText)gDriveToTest;
r=TheFs.GetShortName(restestfile, shortfilename);
- test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
+ test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
r=TheFs.GetLongName(restestfile1, longfilename);
- test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
+ test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
r=file1.Create(TheFs,oldName,EFileWrite);
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
file1.Close();
r=TheFs.Replace(oldName,restestfile);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.Rename(restestfile,restestfile1);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.Entry(restestfile1,entry);
- test(r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.Delete(restestfile1);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
}
@@ -269,19 +267,19 @@
mkdirname.Append(KMkDirSub);
r=TheFs.MkDirAll(mkdirname);
- test(r==KErrNone );
+ test_KErrNone(r);
r=TheFs.RmDir(mkdirname);
- test(r==KErrNone );
+ test_KErrNone(r);
r=TheFs.SetSubst(pritestfalseidname,EDriveO);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.RealName(_L("O:\\File.XXX"),realName);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.SetSessionPath(pritestfalseidname);
- test(r==KErrNone);
+ test_KErrNone(r);
TheFs.NotifyChange(ENotifyAll,aStat2,pritestfalseidname);
test(aStat2==KRequestPending);
@@ -296,29 +294,29 @@
oldName[0]=(TText)gDriveToTest;
r=TheFs.GetShortName(pritestfile, shortfilename);
- test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
+ test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
r=TheFs.GetLongName(pritestfile1, longfilename);
- test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
+ test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
r=file1.Create(TheFs,oldName,EFileWrite);
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
file1.Close();
r=TheFs.Replace(oldName,pritestfile);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.Rename(pritestfile,pritestfile1);
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
r=TheFs.Entry(pritestfile1,entry);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.Delete(pritestfile1);
- test(r==KErrNone);
+ test_KErrNone(r);
}
@@ -337,19 +335,19 @@
mkdirname.Append(KMkDirSub);
r=TheFs.MkDirAll(mkdirname);
- test(r==KErrNone );
+ test_KErrNone(r);
r=TheFs.RmDir(mkdirname);
- test(r==KErrNone );
+ test_KErrNone(r);
r=TheFs.SetSubst(pritestname,EDriveO);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.RealName(_L("O:\\File.XXX"),realName);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.SetSessionPath(pritestname);
- test(r==KErrNone);
+ test_KErrNone(r);
TheFs.NotifyChange(ENotifyAll,aStat2,pritestname);
test(aStat2==KRequestPending);
@@ -364,29 +362,29 @@
oldName[0]=(TText)gDriveToTest;
r=TheFs.GetShortName(pritestfile, shortfilename);
- test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
+ test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
r=TheFs.GetLongName(pritestfile1, longfilename);
- test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
+ test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
r=file1.Create(TheFs,oldName,EFileWrite);
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
file1.Close();
r=TheFs.Replace(oldName,pritestfile);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.Rename(pritestfile,pritestfile1);
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
r=TheFs.Entry(pritestfile1,entry);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.Delete(pritestfile1);
- test(r==KErrNone);
+ test_KErrNone(r);
}
@@ -405,19 +403,19 @@
mkdirname.Append(theprivatepath);
mkdirname.Append(KMkDirSub);
r=TheFs.MkDirAll(mkdirname);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.RmDir(mkdirname);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.SetSubst(theprivatepath,EDriveO);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.RealName(_L("O:\\File.XXX"),realName);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.SetSessionPath(theprivatepath);
- test(r==KErrNone);
+ test_KErrNone(r);
TheFs.NotifyChange(ENotifyAll,aStat3,theprivatepath);
test(aStat3==KRequestPending);
@@ -432,29 +430,29 @@
oldName[0]=(TText)gDriveToTest;
r=TheFs.GetShortName(pritestfile, shortfilename);
- test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
+ test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
r=TheFs.GetLongName(pritestfile1, longfilename);
- test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
+ test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
r=file1.Create(TheFs,oldName,EFileWrite);
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
file1.Close();
r=TheFs.Replace(oldName,pritestfile);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.Rename(pritestfile,pritestfile1);
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
r=TheFs.Entry(pritestfile1,entry);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.Delete(pritestfile1);
- test(r==KErrNone);
+ test_KErrNone(r);
}
@@ -467,10 +465,10 @@
r=TheFs.SetSessionPath(systestname);
- test(r==KErrNone);
+ test_KErrNone(r);
r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
TBuf<25> sysfilename;
@@ -478,36 +476,36 @@
sysfilename.Append(KFileSys);
r=file1.Create(TheFs,sysfilename,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=file1.Open(TheFs,sysfilename,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
// DEF113117
r=file1.Open(TheFs, KSysBinFile, EFileShareReadersOnly | EFileRead | EFileReadBuffered);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs, KSysBinFile, EFileStreamText | EFileReadBuffered | EFileReadAheadOn);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs, KSysBinFile, EFileStreamText | EFileShareReadersOnly);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs,sysfilename,EFileRead);
- test(r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
r=file1.Replace(TheFs,sysfilename,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
TFindFile finder(TheFs);
CDir* dir = NULL;
r=finder.FindWildByDir(KWildFile, KWildPath, dir);
if (!(r==KErrNone))
test.Printf(_L("T_DCALLFILES: test find wildcards r = %d (expected KErrNone)\n"), r);
- test(r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
delete dir;
}
@@ -519,45 +517,45 @@
{
r=TheFs.SetSessionPath(restestname);
- test(r==KErrNone);
+ test_KErrNone(r);
r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
r=file1.Create(TheFs,KFileRes,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
r=file1.Open(TheFs,KFileRes,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
r=file1.Open(TheFs,KFileRes,EFileRead|EFileShareReadersOnly);
- test(r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
file1.Close();
r=file1.Open(TheFs,KFileRes,EFileShareReadersOrWriters|EFileRead);
- test(r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
file1.Close();
r=file1.Open(TheFs,KFileRes,EFileShareReadersOrWriters|EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
r=file1.Open(TheFs,KFileRes,EFileShareReadersOnly);
- test(r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
r=file1.ChangeMode(EFileShareExclusive); //this is not illegal though will prevent shared access to resource which is nit my fault but may be desirable to prevent
- test(r==KErrNone);
+ test_KErrNone(r);
//this operation is prevented as you can not open a file for write access in the resource directory
r=file1.Rename(KFileRes3);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
r=file1.Replace(TheFs,KFileRes,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
}
@@ -570,29 +568,29 @@
{
r=TheFs.SetSessionPath(pritestfalseidname);
- test(r==KErrNone);
+ test_KErrNone(r);
r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Create(TheFs,KFilePri,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs,KFilePri,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs,KFilePri,EFileRead);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Replace(TheFs,KFilePri,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
r=file1.Rename(KFilePri3);
- test(r==KErrNone || r== KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r== KErrAlreadyExists);
file1.Close();
}
@@ -605,29 +603,29 @@
{
r=TheFs.SetSessionPath(pritestname);
- test(r==KErrNone);
+ test_KErrNone(r);
r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Create(TheFs,KFilePri,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs,KFilePri,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs,KFilePri,EFileRead);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Replace(TheFs,KFilePri,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
r=file1.Rename(KFilePri3);
- test(r==KErrNone || r== KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r== KErrAlreadyExists);
file1.Close();
}
@@ -640,29 +638,29 @@
//Rfile Testing with session path set to //Private//UID//
r=TheFs.SetSessionToPrivate(gTheDriveNum);
- test(r==KErrNone);
+ test_KErrNone(r);
r=file1.Temp(TheFs,theprivatepath,fromTemp,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Create(TheFs,KFilePri,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs,KFilePri,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs,KFilePri,EFileRead);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Replace(TheFs,KFilePri,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
r=file1.Rename(KFilePri3);
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
file1.Close();
}
@@ -678,11 +676,11 @@
dirNameBuf = KSystemPath;
dirNameBuf[0]=(TText)gDriveToTest;
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
- test(r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
dir.Close();
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
- test(r==KErrNone);
+ test_KErrNone(r);
delete dirEntries;
dirNameBuf.Zero();
@@ -690,20 +688,20 @@
dirNameBuf=KPrivateFalseID;
dirNameBuf[0]=(TText)gDriveToTest;
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
- test(r==KErrNone);
+ test_KErrNone(r);
dir.Close();
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
- test(r==KErrNone);
+ test_KErrNone(r);
dirNameBuf.Zero();
delete dirEntries;
//Private
dirNameBuf=KPrivatePath;
dirNameBuf[0]=(TText)gDriveToTest;
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
- test(r==KErrNone);
+ test_KErrNone(r);
dir.Close();
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
- test(r==KErrNone);
+ test_KErrNone(r);
dirNameBuf.Zero();
delete dirEntries;
//Private/uid
@@ -711,20 +709,20 @@
dirNameBuf.Insert(0,_L("?:"));
dirNameBuf[0]=(TText)gDriveToTest;
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
- test(r==KErrNone);
+ test_KErrNone(r);
dir.Close();
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
- test(r==KErrNone);
+ test_KErrNone(r);
dirNameBuf.Zero();
delete dirEntries;
//Resource
dirNameBuf=KResourcePath;
dirNameBuf[0]=(TText)gDriveToTest;
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
- test(r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
- test(r==KErrNone);
+ test_KErrNone(r);
delete dirEntries;
dir.Close();
}
@@ -739,19 +737,19 @@
//
{
r=TheFs.FileSystemName(fsname,gTheDriveNum);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.DismountFileSystem(fsname,gTheDriveNum);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
// r=TheFs.RemoveFileSystem(fsname); //can not test due to bug else where fix exists
-// test(r==KErrPermissionDenied);
+// test_Value(r, r == KErrPermissionDenied);
// r=TheFs.AddFileSystem(fsname);
-// test(r==KErrPermissionDenied);
+// test_Value(r, r == KErrPermissionDenied);
r=TheFs.MountFileSystem(fsname,gTheDriveNum);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.SetDriveName(gTheDriveNum,KDriveName);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
// r=TheFs.SetVolumeLabel(KVolLable, gTheDriveNum);
-// test(r==KErrNone);
+// test_KErrNone(r);
systemRFstest();
resourceRFstest();
@@ -781,22 +779,22 @@
r=TheFs.SetSessionPath(systestname);
- test(r==KErrNone);
+ test_KErrNone(r);
//Test RRawDisk class
r=rawdisk.Open(TheFs,gTheDriveNum);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=format.Open(TheFs,driveBuf,EHighDensity,count);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
RDirtest();
driveBuf[0]=(TText)gDriveToTest;
r=TheFs.ScanDrive(driveBuf);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.CheckDisk(driveBuf);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
}
LOCAL_C void TestCaps()
@@ -812,16 +810,16 @@
driveBuf[0]=(TText)gDriveToTest;
r=TheFs.SessionPath(temp);
- test(r==KErrNone);
+ test_KErrNone(r);
test.Printf(_L("Session path: %S"),&temp);
r=TheFs.CreatePrivatePath(gTheDriveNum);
- test(r==KErrNone || r== KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r== KErrAlreadyExists);
TBuf<18> tempPri;
r=TheFs.PrivatePath(tempPri);
- test(r==KErrNone);
+ test_KErrNone(r);
theprivatepath = _L("?:");
theprivatepath.Append(tempPri);
@@ -829,9 +827,9 @@
TFileName thesessionpath;
r=TheFs.SetSessionToPrivate(gTheDriveNum);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.SessionPath(thesessionpath);
- test(r==KErrNone);
+ test_KErrNone(r);
test(thesessionpath == theprivatepath);
}
@@ -841,16 +839,16 @@
{
CDirScan* scanner = NULL;
TRAP(r, scanner = CDirScan::NewL(TheFs));
- test(r == KErrNone && scanner);
+ test_Value(r, r == KErrNone && scanner);
TRAP(r, scanner->SetScanDataL(aName,KEntryAttDir,ESortByName|EAscending,aDirection));
- test(r == KErrNone);
+ test_KErrNone(r);
CDir *entryList=NULL;
for (;;)
{
TRAP(r, scanner->NextL(entryList));
- test(r == aError);
+ test_Value(r, r == aError);
if (entryList==NULL)
break;
TInt count=entryList->Count();
@@ -888,11 +886,11 @@
test.Printf(_L("Private Path is=%S"),&privatepath);
r = TheFs.MkDir(_L("\\Caged\\"));
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
CDir* entryCount=NULL;
r=TheFs.GetDir(_L("\\*.*"),KEntryAttNormal,ESortNone,entryCount);
- test(r==KErrNone);
+ test_KErrNone(r);
TInt rootCount= entryCount->Count();
delete entryCount;
@@ -902,12 +900,12 @@
//Testing Copy
CDir* entryCount2=NULL;
r=fMan->Copy(_L("\\sys\\"),_L("\\Caged\\"));
- test(r == KErrNotFound);
+ test_Value(r, r == KErrNotFound);
r=fMan->Copy(_L("\\*"),_L("\\Caged\\"));
- test(r == KErrNone);
+ test_KErrNone(r);
r=TheFs.GetDir(_L("\\Caged\\*.*"),KEntryAttNormal,ESortNone,entryCount2);
- test(r==KErrNone);
+ test_KErrNone(r);
TInt cagedCount= entryCount2->Count();
test(cagedCount==rootCount);
@@ -917,12 +915,12 @@
r=fMan->Copy(_L("\\private\\two\\moo"),_L("\\private\\two\\mew"));
- test(r == KErrPathNotFound);
+ test_Value(r, r == KErrPathNotFound);
// Create a test file
RFile testFile;
r = testFile.Replace(TheFs, _L("\\capTest"),EFileWrite);
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
testFile.Close();
TFileName name;
@@ -930,90 +928,90 @@
name.Append(_L("privateFile.tst"));
RFile privateFile;
r = privateFile.Replace(TheFs, name,EFileWrite);
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
privateFile.Close();
r=fMan->Copy(_L("\\capTest"),_L("\\private\\to\\moo"));
- test(r == KErrPathNotFound);
+ test_Value(r, r == KErrPathNotFound);
r=fMan->Copy(_L("\\capTest"),_L("\\sys\\bin\\moo"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->Copy(_L("\\sys\\bin\\capTest"),_L("\\sys\\bin\\moo"));
- test(r == KErrPathNotFound);
+ test_Value(r, r == KErrPathNotFound);
r=fMan->Copy(_L("\\sys\\*"),_L("\\"));
- test (r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
r=fMan->Copy(name,_L("\\sys\\"));
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
// Testing Move
r=fMan->Move(_L("\\capTest"),_L("\\private\\wst\\moo"), CFileMan::ERecurse); // Recurse flag needed as destination path does not exist.
- test(r == KErrNone);
+ test_KErrNone(r);
r=fMan->Move(_L("\\sys\\bin\\capTest"),_L("\\sys\\bin\\moo"));
- test(r == KErrPathNotFound);
+ test_Value(r, r == KErrPathNotFound);
r=fMan->Move(_L("\\sys\\*"),_L("\\"));
- test (r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
r=fMan->Move(name,_L("\\sys\\"));
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo"));
- test(r == KErrPathNotFound);
+ test_Value(r, r == KErrPathNotFound);
r=fMan->Move(_L("\\private\\two\\moo.."),_L("\\private\\one\\moo"));
- test(r == KErrPathNotFound);
+ test_Value(r, r == KErrPathNotFound);
r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo.."));
- test(r == KErrPathNotFound);
+ test_Value(r, r == KErrPathNotFound);
r=fMan->Move(name,_L("\\privateFile.tst"));
- test(r == KErrNone);
+ test_KErrNone(r);
r=fMan->Move(_L("\\privateFile.tst"),name);
- test(r == KErrNone);
+ test_KErrNone(r);
// Testing Attribs
r=fMan->Attribs(_L("\\private\\two\\moo"),KEntryAttReadOnly,0,TTime(0));
- test(r == KErrPathNotFound);
+ test_Value(r, r == KErrPathNotFound);
r=fMan->Attribs(_L("\\private\\moo"),KEntryAttReadOnly,0,TTime(0));
- test(r == KErrNotFound);
+ test_Value(r, r == KErrNotFound);
r=fMan->Attribs(name,KEntryAttReadOnly,0,TTime(0));
- test(r == KErrNone);
+ test_KErrNone(r);
r=fMan->Attribs(name,0,KEntryAttReadOnly,TTime(0));
- test(r == KErrNone);
+ test_KErrNone(r);
// Testing RmDir
r=fMan->RmDir(_L("\\private\\"));
- test(r == KErrNone);
+ test_KErrNone(r);
// put it back where it was
r = TheFs.MkDirAll(_L("\\private\\00000001\\"));
- test(r == KErrNone);
+ test_KErrNone(r);
r=fMan->RmDir(_L("\\private\\two\\"));
- test(r == KErrPathNotFound);
+ test_Value(r, r == KErrPathNotFound);
r=fMan->RmDir(_L("\\private\\tw?\\"));
- test(r == KErrBadName);
+ test_Value(r, r == KErrBadName);
r=fMan->RmDir(_L("\\sys\\"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
// Testing Rename
r=fMan->Rename(_L("\\private\\two\\moo"),_L("\\private\\two\\mew"));
- test(r == KErrPathNotFound);
+ test_Value(r, r == KErrPathNotFound);
// Testing Delete
r=fMan->Delete(_L("\\private\\two\\test"));
- test(r == KErrPathNotFound);
+ test_Value(r, r == KErrPathNotFound);
r=fMan->Delete(_L("\\private\\moo"));
- test(r == KErrNotFound);
+ test_Value(r, r == KErrNotFound);
//Something that actually exists in Private
r=fMan->Rename(name,_L("\\private\\00000001\\moo"));
- test(r == KErrNotFound); //deleted the file previously
+ test_Value(r, r == KErrNotFound); //deleted the file previously
r=fMan->Rename(_L("\\private\\00000001\\moo"),name);
- test(r == KErrNotFound);
+ test_Value(r, r == KErrNotFound);
r=fMan->Copy(name,_L("\\private\\00000001\\moo"));
- test(r == KErrNotFound);
+ test_Value(r, r == KErrNotFound);
r=fMan->Delete(_L("\\private\\00000001\\moo"));
- test(r == KErrNotFound);
+ test_Value(r, r == KErrNotFound);
// Clean up the test data
r=fMan->RmDir(_L("\\Caged\\"));
- test(r == KErrNone);
+ test_KErrNone(r);
r=fMan->Delete(_L("\\capTest"));
- test(r == KErrNone || KErrNotFound);
+ test_Value(r, r == KErrNone || r == KErrNotFound);
delete(fMan);
}
@@ -1034,7 +1032,7 @@
test.Next(_L("Delete test directory"));
CFileMan* fMan=CFileMan::NewL(TheFs);
TInt r=fMan->RmDir(gSessionPath);
- test(r==KErrNone);
+ test_KErrNone(r);
delete fMan;
}
@@ -1058,14 +1056,14 @@
sesspath[0] = (TText)gDriveToTest;
TInt r= TheFs.SetSessionPath(sesspath);
- test(r==KErrNone);
+ test_KErrNone(r);
TBuf<2> cmd;
cmd.SetLength(1);
cmd[0] = (TText)gDriveToTest;
RProcess tp;
r=tp.Create(_L("clean_prepdc.exe"),sesspath);
- test(r==KErrNone);
+ test_KErrNone(r);
{
TRequestStatus ps;
tp.Logon(ps);
@@ -1079,30 +1077,30 @@
RFs fs2;
r=fs1.Connect();
- test(r==KErrNone);
+ test_KErrNone(r);
r=fs1.SessionPath(sesspath);
- test(r==KErrNone);
+ test_KErrNone(r);
test.Printf(_L("session1 Path=%S"),&sesspath);
TBuf<30> privatepath;
r=fs1.SetSessionToPrivate(gTheDriveNum);
- test(r==KErrNone);
+ test_KErrNone(r);
r=fs1.PrivatePath(privatepath);
- test(r==KErrNone);
+ test_KErrNone(r);
r=privatepath.Compare(KExpectedPrivatePath());
- test(r==0);
+ test_Value(r, r == 0);
r=fs1.SessionPath(sesspath);
- test(r==KErrNone);
+ test_KErrNone(r);
r=privatepath.Compare(sesspath.Mid(KPathPosition));
- test(r==0);
+ test_Value(r, r == 0);
r=fs1.CreatePrivatePath(gTheDriveNum);
- test(r==KErrNone);
+ test_KErrNone(r);
fs1.Close();
r=fs2.Connect();
- test(r==KErrNone);
+ test_KErrNone(r);
r=fs2.SessionPath(sesspath);
- test(r==KErrNone);
+ test_KErrNone(r);
test.Printf(_L("session2 Path=%S"),&sesspath);
fs2.Close();