--- a/kerneltest/f32test/server/t_dctcb.cpp Thu Aug 19 11:14:22 2010 +0300
+++ b/kerneltest/f32test/server/t_dctcb.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>
@@ -87,8 +88,6 @@
TRequestStatus aStat3;
TRequestStatus aStat4;
-TVolumeInfo aVolInfo;
-
TBuf<40> systestfile;
TBuf<40> pritestfile;
TBuf<40> restestfile;
@@ -111,15 +110,15 @@
//
{
TInt r = TheFs.Rename(_L("\\sys"), _L("\\sysbad"));
- test(r == KErrNone);
+ test_KErrNone(r);
r = TheFs.Rename(_L("\\resource"), _L("\\resourcebad"));
- test(r == KErrNone);
+ test_KErrNone(r);
r = TheFs.Rename(_L("\\sysbad"), _L("\\sys"));
- test(r == KErrNone);
+ test_KErrNone(r);
r = TheFs.Rename(_L("\\resourcebad"), _L("\\resource"));
- test(r == KErrNone);
+ test_KErrNone(r);
r = TheFs.Rename(_L("\\private"), _L("\\privatebad"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
}
LOCAL_C void systemRFsTest()
@@ -135,19 +134,19 @@
mkdirname.Append(systestname);
mkdirname.Append(KMkDirSub);
r=TheFs.MkDirAll(mkdirname);
- test(r==KErrNone);
+ test_KErrNone(r);
TheFs.RmDir(mkdirname);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.SetSubst(systestname,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(systestname);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
TheFs.NotifyChange(ENotifyAll,aStat1,systestname);
test(aStat1==KErrPermissionDenied);
@@ -162,32 +161,32 @@
oldName[0]=(TText)gDriveToTest;
r=TheFs.GetShortName(systestfile, shortfilename);
- test(r==KErrPermissionDenied || r==KErrNotSupported);
+ test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
r=TheFs.GetLongName(systestfile1, longfilename);
- test(r==KErrPermissionDenied || r==KErrNotSupported);
+ test_Value(r, r == KErrPermissionDenied || 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==KErrNone);
+ test_KErrNone(r);
r=TheFs.Delete(systestfile1);
- test(r==KErrNone || r==KErrNotFound);
+ test_Value(r, r == KErrNone || r==KErrNotFound);
r=TheFs.Rename(systestfile,systestfile1);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.Entry(systestfile1,entry);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.Delete(systestfile1);
- test(r==KErrNone);
+ test_KErrNone(r);
__UHEAP_MARKEND;
@@ -207,19 +206,19 @@
mkdirname.Append(restestname);
mkdirname.Append(KMkDirSub);
r=TheFs.MkDirAll(mkdirname);
- test(r==KErrNone);
+ test_KErrNone(r);
TheFs.RmDir(mkdirname);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.SetSubst(restestname,EDriveO);
- test(r==KErrPermissionDenied || r==KErrGeneral);
+ test_Value(r, r == KErrPermissionDenied || r==KErrGeneral);
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);
@@ -234,29 +233,31 @@
oldName[0]=(TText)gDriveToTest;
r=TheFs.GetShortName(restestfile, shortfilename);
- test(r==KErrNone || KErrNotFound || r==KErrNotSupported);
+// test_Value(r, r == KErrNone || r == KErrNotFound || r==KErrNotSupported);
+ test(r == KErrNone || KErrNotFound || r==KErrNotSupported);
r=TheFs.GetLongName(restestfile1, longfilename);
- test(r==KErrNone || KErrNotFound || r==KErrNotSupported);
+// test_Value(r, r == KErrNone || r == KErrNotFound || r==KErrNotSupported);
+ test(r == KErrNone || 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==KErrNone);
+ test_KErrNone(r);
r=TheFs.Rename(restestfile,restestfile1);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.Entry(restestfile1,entry);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.Delete(restestfile1);
- test(r==KErrNone);
+ test_KErrNone(r);
__UHEAP_MARK;
@@ -278,22 +279,22 @@
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(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==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
TheFs.NotifyChange(ENotifyAll,aStat2,pritestfalseidname);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
pritestfile=KPrivateFalseID;
@@ -306,29 +307,29 @@
oldName[0]=(TText)gDriveToTest;
r=TheFs.GetShortName(pritestfile, shortfilename);
- test(r==KErrPermissionDenied || r==KErrNotSupported);
+ test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
r=TheFs.GetLongName(pritestfile1, longfilename);
- test(r==KErrPermissionDenied || r==KErrNotSupported);
+ test_Value(r, r == KErrPermissionDenied || 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==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.Rename(pritestfile,pritestfile1);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.Entry(pritestfile1,entry);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.Delete(pritestfile1);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
__UHEAP_MARKEND;
}
@@ -350,22 +351,22 @@
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(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==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
TheFs.NotifyChange(ENotifyAll,aStat2,pritestname);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
pritestfile=KPrivatePath;
@@ -378,29 +379,29 @@
oldName[0]=(TText)gDriveToTest;
r=TheFs.GetShortName(pritestfile, shortfilename);
- test(r==KErrPermissionDenied || r==KErrNotSupported);
+ test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
r=TheFs.GetLongName(pritestfile1, longfilename);
- test(r==KErrPermissionDenied || r==KErrNotSupported);
+ test_Value(r, r == KErrPermissionDenied || 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==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.Rename(pritestfile,pritestfile1);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.Entry(pritestfile1,entry);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.Delete(pritestfile1);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
__UHEAP_MARKEND;
}
@@ -417,19 +418,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 || r==KErrGeneral); // Drive may already be substituted
+ test_Value(r, r == KErrPermissionDenied || r==KErrGeneral); // Drive may already be substituted
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);
@@ -444,29 +445,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);
__UHEAP_MARKEND;
}
@@ -480,10 +481,10 @@
__UHEAP_MARK;
r=TheFs.SetSessionPath(systestname);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
TBuf<25> sysfilename;
@@ -491,26 +492,26 @@
sysfilename.Append(KFileSys);
r=file1.Create(TheFs,sysfilename,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs,sysfilename,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs,sysfilename,EFileRead);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
r=file1.Replace(TheFs,sysfilename,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
TBuf<25> sysfilename2;
sysfilename2.Append(systestname);
sysfilename2.Append(KFileSys3);
r=file1.Rename(sysfilename2);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
TFindFile finder(TheFs);
@@ -518,7 +519,7 @@
r=finder.FindWildByDir(KWildFile, KWildPath, dir);
if (!(r==KErrPermissionDenied))
test.Printf(_L("T_DCTCB: test find wildcards r = %d (expected KErrPermissionDenied)\n"), r);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
delete dir;
__UHEAP_MARKEND;
@@ -532,40 +533,40 @@
__UHEAP_MARK;
r=TheFs.SetSessionPath(restestname);
- test(r==KErrNone);
+ test_KErrNone(r);
r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Create(TheFs,KFileRes,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs,KFileRes,EFileWrite|EFileShareExclusive );
- test(r==KErrNone);
+ test_KErrNone(r);
r=file1.Rename(KFileRes3);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileRead);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Open(TheFs,KFileRes3,EFileShareReadersOnly);
- test(r==KErrNone);
+ test_KErrNone(r);
r=file1.ChangeMode(EFileShareExclusive);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
r=file1.Replace(TheFs,KFileRes,EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
__UHEAP_MARKEND;
@@ -581,10 +582,10 @@
__UHEAP_MARK;
r=TheFs.SetSessionPath(pritestfalseidname);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
// Since can't set session path create explicit path
@@ -593,23 +594,23 @@
pritestfile.Append(KFilePri);
r=file1.Create(TheFs,pritestfile,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
r=file1.Open(TheFs,pritestfile,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
r=file1.Open(TheFs,pritestfile,EFileRead);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
r=file1.Replace(TheFs,pritestfile,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
// File does not exist so can't rename it
/* r=file1.Rename(KFilePri3);
- test(r==KErrAlreadyExists || r==KErrNone);
+ test_Value(r, r == KErrAlreadyExists || r==KErrNone);
file1.Close();
*/ __UHEAP_MARKEND;
}
@@ -623,10 +624,10 @@
__UHEAP_MARK;
r=TheFs.SetSessionPath(pritestname);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
// Since can't set session path create explicit path
@@ -635,23 +636,23 @@
pritestfile.Append(KFilePri);
r=file1.Create(TheFs,pritestfile,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
r=file1.Open(TheFs,pritestfile,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
r=file1.Open(TheFs,pritestfile,EFileRead);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
file1.Close();
r=file1.Replace(TheFs,pritestfile,EFileWrite);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
// File does not exist so can't be renamed
/* r=file1.Rename(KFilePri3);
- test(r==KErrNone);
+ test_KErrNone(r);
file1.Close();
*/
__UHEAP_MARKEND;
@@ -665,29 +666,29 @@
{
__UHEAP_MARK;
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);
+ test_KErrNone(r);
file1.Close();
__UHEAP_MARKEND;
}
@@ -704,10 +705,10 @@
TBuf<30> dirNameBuf(KSystemPath);
dirNameBuf[0]=(TText)gDriveToTest;
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
dir.Close();
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
dirNameBuf.Zero();
delete dirEntries;
@@ -715,10 +716,10 @@
dirNameBuf=KPrivatePath;
dirNameBuf[0]=(TText)gDriveToTest;
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
dir.Close();
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
dirNameBuf.Zero();
delete dirEntries;
@@ -726,10 +727,10 @@
dirNameBuf=KPrivateFalseID;
dirNameBuf[0]=(TText)gDriveToTest;
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
dir.Close();
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
dirNameBuf.Zero();
delete dirEntries;
@@ -738,19 +739,19 @@
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);
+ test_KErrNone(r);
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
- test(r==KErrNone);
+ test_KErrNone(r);
dir.Close();
delete dirEntries;
__UHEAP_MARKEND;
@@ -764,16 +765,16 @@
{
__UHEAP_MARK;
r=TheFs.FileSystemName(fsname,gTheDriveNum);
- test(r==KErrNone);
+ test_KErrNone(r);
r = DismountFileSystem(TheFs, fsname, gTheDriveNum);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r = MountFileSystem(TheFs, fsname, gTheDriveNum);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=TheFs.SetDriveName(gTheDriveNum,KDriveName);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
#ifndef __WINS__
r=TheFs.SetVolumeLabel(KVolLable, gTheDriveNum);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
#endif
systemRFsTest();
@@ -800,11 +801,11 @@
test(aStat4==KErrNone);
r=TheFs.SetSessionPath(systestname);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
//Test RRawDisk class
r=rawdisk.Open(TheFs,gTheDriveNum);
- test(r==KErrNone);
+ test_KErrNone(r);
rawdisk.Close();
RDirtest();
@@ -815,21 +816,21 @@
{
//Test RFormat class
r=format.Open(TheFs,driveBuf,EHighDensity,count);
- test(r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
while(count)
{
TInt r=format.Next(count);
- test(r==KErrNone);
+ test_KErrNone(r);
}
format.Close();
}
driveBuf[0]=(TText)gDriveToTest;
r=TheFs.ScanDrive(driveBuf);
- test((r==KErrPermissionDenied)||(r==KErrNotSupported));
+ test_Value(r, (r == KErrPermissionDenied)||(r==KErrNotSupported));
r=TheFs.CheckDisk(driveBuf);
- test((r==KErrPermissionDenied)||(r==KErrNotSupported));
+ test_Value(r, (r == KErrPermissionDenied)||(r==KErrNotSupported));
__UHEAP_MARKEND;
}
@@ -847,14 +848,14 @@
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);
@@ -862,9 +863,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);
__UHEAP_MARKEND;
}
@@ -876,16 +877,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();
@@ -924,11 +925,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;
@@ -938,12 +939,12 @@
//Testing Copy
CDir* entryCount2=NULL;
r=fMan->Copy(_L("\\sys\\"),_L("\\Caged\\"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
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);
@@ -952,12 +953,12 @@
entryCount2=NULL;
r=fMan->Copy(_L("\\private\\two\\moo"),_L("\\private\\two\\mew"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
// 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;
@@ -965,99 +966,99 @@
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\\two\\moo"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->Copy(_L("\\capTest"),_L("\\sys\\bin\\moo"));
- test(r == KErrPathNotFound);
+ test_Value(r, r == KErrPathNotFound);
r=fMan->Copy(_L("\\sys\\bin\\capTest"),_L("\\sys\\bin\\moo"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->Copy(_L("\\capTest"),_L("\\sys\\capTest"));
- test(r == KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
r=fMan->Copy(_L("\\sys\\*"),_L("\\"));
- test (r==KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->Copy(name,_L("\\sys\\"));
- test(r==KErrNone);
+ test_KErrNone(r);
// Testing Move
r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->Move(_L("\\private\\two\\moo.."),_L("\\private\\one\\moo"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo.."));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
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 == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->Attribs(_L("\\private\\moo"),KEntryAttReadOnly,0,TTime(0));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
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 Move
r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->Move(_L("\\private\\two\\moo.."),_L("\\private\\one\\moo"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo.."));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
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 RmDir
r=fMan->RmDir(_L("\\private\\"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->RmDir(_L("\\private\\two\\"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->RmDir(_L("\\private\\tw?\\"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
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 == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
// Testing Delete
r=fMan->Delete(_L("\\private\\two\\test"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->Delete(_L("\\private\\moo"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
r=fMan->Delete(_L("\\sys\\"));
- test(r == KErrPermissionDenied);
+ test_Value(r, r == KErrPermissionDenied);
//Something that actually exists in Private
r=fMan->Rename(name,_L("\\private\\00000001\\moo"));
- test(r == KErrNone);
+ test_KErrNone(r);
r=fMan->Rename(_L("\\private\\00000001\\moo"),name);
- test(r == KErrNone);
+ test_KErrNone(r);
r=fMan->Copy(name,_L("\\private\\00000001\\moo"));
- test(r == KErrNone);
+ test_KErrNone(r);
r=fMan->Delete(_L("\\private\\00000001\\moo"));
- test(r == KErrNone);
+ test_KErrNone(r);
// Clean up the test data
r=fMan->RmDir(_L("\\Caged\\"));
- test(r == KErrNone);
+ test_KErrNone(r);
r=fMan->Delete(_L("\\capTest"));
- test(r == KErrNone);
+ test_KErrNone(r);
r=fMan->Delete(name);
- test(r == KErrNone);
+ test_KErrNone(r);
delete(fMan);
}
@@ -1088,14 +1089,14 @@
test.Printf(_L("Setting %c:"), 'A'+i);
TInt ret = TheFs.SetSystemDrive((TDriveNumber)i);
test.Printf(_L("%d\n"), ret);
- test(ret == KErrNone || ret == KErrAlreadyExists);
+ test_Value(ret, ret == KErrNone || ret == KErrAlreadyExists);
if(ret == KErrNone)
{
drive = (TDriveNumber)i;
test.Printf(_L("Re-setting %c:"), 'A'+i);
ret = TheFs.SetSystemDrive(drive);
test.Printf(_L("%d\n"), ret);
- test(ret == KErrAlreadyExists);
+ test_Value(ret, ret == KErrAlreadyExists);
}
}
}
@@ -1114,7 +1115,8 @@
test.Next(_L("Delete test directory"));
CFileMan* fMan=CFileMan::NewL(TheFs);
TInt r=fMan->RmDir(gSessionPath);
- test(r==KErrNone || KErrPathNotFound);
+// test_Value(r, r == KErrNone || r == KErrPathNotFound);
+ test(r == KErrNone || KErrPathNotFound);
delete fMan;
}
@@ -1138,7 +1140,7 @@
sesspath[0] = (TText)gDriveToTest;
TInt r= TheFs.SetSessionPath(sesspath);
- test(r==KErrNone);
+ test_KErrNone(r);
//cleanup from previous run of this test
TBuf<20> delDir;
@@ -1146,15 +1148,18 @@
delDir=KResourcePath;
delDir[0]=(TText)gDriveToTest;
r=fMan->RmDir(delDir);
- test(r==KErrNone || KErrNotFound);
+// test_Value(r, r == KErrNone || r == KErrNotFound);
+ test(r == KErrNone || KErrNotFound);
delDir=KSystemPath;
delDir[0]=(TText)gDriveToTest;
r=fMan->RmDir(delDir);
- test(r==KErrNone || KErrNotFound);
+// test_Value(r, r == KErrNone || r == KErrNotFound);
+ test(r == KErrNone || KErrNotFound);
delDir=KPrivatePath;
delDir[0]=(TText)gDriveToTest;
r=fMan->RmDir(delDir);
- test(r==KErrNone || KErrNotFound);
+// test_Value(r, r == KErrNone || r == KErrNotFound);
+ test(r == KErrNone || KErrNotFound);
delete fMan;
//check double mode ie that Defpath still works
@@ -1162,30 +1167,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();