--- a/kerneltest/f32test/fsstress/t_ramstr.cpp Thu Aug 19 11:14:22 2010 +0300
+++ b/kerneltest/f32test/fsstress/t_ramstr.cpp Tue Aug 31 16:34:26 2010 +0300
@@ -15,6 +15,7 @@
//
//
+#define __E32TEST_EXTENSION__
#include <f32file.h>
#include <e32test.h>
#include <e32math.h>
@@ -83,12 +84,12 @@
TBuf<128> fileName=aBaseName;
fileName.AppendNum(aX);
TInt r=TheFs.Delete(fileName);
- test(r==KErrNone);
+ test_KErrNone(r);
// r=TheFs.CheckDisk(fileName);
// if (r!=KErrNone && r!=KErrNotSupported)
// {
// test.Printf(_L("ERROR:: CheckDisk returned %d\n"),r);
-// test(r==KErrNone);
+// test_KErrNone(r);
// }
test.Printf(_L("Deleted File %d\n"),aX);
return(KErrNone);
@@ -103,7 +104,7 @@
testBuf.SetLength(testBuf.MaxSize());
Mem::Fill(bufPtr,testBuf.MaxSize(),aCluster);
TInt r=aFile.Write(testBuf);
- test(r==KErrNone);
+ test_KErrNone(r);
}
LOCAL_C void SeekToCluster(RFile& aFile,TInt aCluster)
@@ -113,7 +114,7 @@
{
TBuf8<508> seekBuf(508);
TInt r=aFile.Read(aCluster*testBuf.MaxSize(),seekBuf);
- test(r==KErrNone);
+ test_KErrNone(r);
test(seekBuf[0]==(TUint8)aCluster && seekBuf[507]==(TUint8)aCluster);
}
@@ -124,10 +125,10 @@
{
TBuf8<508> seekBuf(508);
TInt r=aFile.Read(aCluster1*testBuf.MaxSize(),seekBuf);
- test(r==KErrNone);
+ test_KErrNone(r);
test(seekBuf[0]==(TUint8)aCluster1 && seekBuf[507]==(TUint8)aCluster1);
r=aFile.Read(aCluster2*testBuf.MaxSize(),seekBuf);
- test(r==KErrNone);
+ test_KErrNone(r);
test(seekBuf[0]==(TUint8)aCluster2 && seekBuf[507]==(TUint8)aCluster2);
}
@@ -158,9 +159,9 @@
RFile f1,f2;
TInt r=f1.Replace(TheFs,_L("BIGFILE1.TST"),EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
r=f2.Replace(TheFs,_L("BIGFILE2.TST"),EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
TInt maxListLength=4;
TInt i=0,k=0;
@@ -205,9 +206,9 @@
f1.Close();
f2.Close();
r=TheFs.Delete(_L("BIGFile1.tst"));
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.Delete(_L("BIGFile2.tst"));
- test(r==KErrNone);
+ test_KErrNone(r);
CheckDisk();
}
@@ -220,9 +221,9 @@
RFile f1,f2;
TInt r=f1.Replace(TheFs,_L("BIGFILE1.TST"),EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
r=f2.Replace(TheFs,_L("BIGFILE2.TST"),EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
WriteCluster(f1,0);
WriteCluster(f1,1);
@@ -239,9 +240,9 @@
f1.Close();
f2.Close();
r=TheFs.Delete(_L("BIGFile1.tst"));
- test(r==KErrNone);
+ test_KErrNone(r);
r=TheFs.Delete(_L("BIGFile2.tst"));
- test(r==KErrNone);
+ test_KErrNone(r);
CheckDisk();
}
@@ -256,10 +257,10 @@
TheSeed=917824;
TInt i=0,j=0;
TInt r=f1.Replace(TheFs,_L("BIGFILE1.TST"),EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
r=f1.SetSize(65534);
- test(r==KErrNone);
+ test_KErrNone(r);
for(i=0;i<=15;i++)
WriteCluster(f1,i);
@@ -273,7 +274,7 @@
test.Next(_L("Increase Size"));
r=f1.SetSize(1048577);
- test(r==KErrNone || r==KErrDiskFull);
+ test_Value(r, r == KErrNone || r==KErrDiskFull);
if (r==KErrDiskFull)
{
test.Printf(_L("File too big\n"));
@@ -291,7 +292,7 @@
TInt newPos=8192;
r=f1.Seek(ESeekStart,newPos);
- test(r==KErrNone);
+ test_KErrNone(r);
test.Next(_L("Write more data"));
for(i=16;i<83;i++)
@@ -307,7 +308,7 @@
test.Next(_L("Reduce file size"));
r=f1.SetSize(135000);
- test(r==KErrNone);
+ test_KErrNone(r);
test.Next(_L("Test data still present"));
for (j=0;j<200;j++)
@@ -340,7 +341,7 @@
{
TInt r=iFile.Read(0,iData);
- test(r==KErrNone);
+ test_KErrNone(r);
}
void TFileReader::Next(TUint8& aVal,TInt& aLength)
@@ -352,7 +353,7 @@
if (iPos==iData.Length())
{
TInt r=iFile.Read(iData);
- test(r==KErrNone);
+ test_KErrNone(r);
iPos=0;
if (iData.Length()==0)
{
@@ -476,13 +477,13 @@
HBufC8* dataBuf=HBufC8::NewL(KMaxBufferLength);
TInt r=f[0].Replace(TheFs,_L("TEST1.DAT"),EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
r=f[1].Replace(TheFs,_L("TEST2.DAT"),EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
r=f[2].Replace(TheFs,_L("TEST3.DAT"),EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
r=f[3].Replace(TheFs,_L("TEST4.DAT"),EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
TInt size=0;
TInt iteration=0;
@@ -507,7 +508,7 @@
TInt s=len*mult[fileNum];
TInt filePos=pos*mult[fileNum];
r=f[fileNum].Seek(ESeekStart,filePos);
- test(r==KErrNone);
+ test_KErrNone(r);
while(s>0)
{
@@ -516,7 +517,7 @@
r=f[fileNum].Write(*dataBuf);
if (r==KErrDiskFull)
goto End;
- test(r==KErrNone);
+ test_KErrNone(r);
s-=l;
}
@@ -537,7 +538,7 @@
{
TInt fileNum=(order+i)%KMaxFiles;
r=f[fileNum].SetSize(size*mult[fileNum]);
- test(r==KErrNone);
+ test_KErrNone(r);
}
CheckFileContents(&f[0]);
}
@@ -556,10 +557,10 @@
{
test.Start(_L("Test multiple file creation, deletion and resize operations"));
TInt r=TheFs.MkDirAll(_L("\\F32-TST\\BIGDIRECTORY\\"));
- test(r==KErrNone || r==KErrAlreadyExists);
+ test_Value(r, r == KErrNone || r==KErrAlreadyExists);
TFileName sessionPath;
r=TheFs.SessionPath(sessionPath);
- test(r==KErrNone);
+ test_KErrNone(r);
TInt index=0;
TBuf<128> fileName=_L("\\F32-TST\\BIGDIRECTORY\\FILE");
@@ -570,7 +571,7 @@
if (r!=KErrNone)
break;
- test(r==KErrNone);
+ test_KErrNone(r);
#if defined(__WINS__)
if (index==32 && sessionPath[0]=='C')
@@ -601,7 +602,7 @@
baseName=fileName;
baseName.AppendNum(index);
r=file.Open(TheFs,baseName,EFileRead|EFileWrite);
- test(r==KErrNone);
+ test_KErrNone(r);
test.Printf(_L("Resized %S from %d to %d\n"),&baseName,anInitialSize,anInitialSize*2);
r=file.SetSize(2*anInitialSize);
test((r==KErrNone)||(r==KErrDiskFull));