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