--- a/kerneltest/f32test/server/b_file.cpp Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/b_file.cpp Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
//
//
-#define __E32TEST_EXTENSION__
#include <f32file.h>
#include <e32math.h>
#include <e32test.h>
@@ -73,7 +72,7 @@
TInt pos=0; // Relative position zero
aret=TheFile.Seek(ESeekCurrent,pos);
test.Printf(_L("bwrite2,pos=%u\n"),pos);
- test_KErrNone(aret);
+ test(aret==KErrNone);
TInt count=pos&0xff;
tbuf.SetLength(aLength);
TText8* p=(TText8*)tbuf.Ptr();
@@ -99,7 +98,7 @@
CheckDisk();
TInt pos=0; // Relative position zero
aret=TheFile.Seek(ESeekCurrent,pos);
- test_KErrNone(aret);
+ test(aret==KErrNone);
TInt count=pos&0xff;
aret=TheFile.Read(tbuf,aLength);
if (bret<KErrNone)
@@ -128,7 +127,7 @@
CheckDisk();
TInt newpos=aPos;
aret=TheFile.Seek(ESeekStart,newpos);
- test_KErrNone(aret);
+ test(aret==KErrNone);
test(newpos==aPos);
CheckDisk();
}
@@ -166,7 +165,7 @@
bret=KErrAccessDenied; bwrite(1); bret=0;
bclose();
aret=TheFile.Open(TheFs,tzzz,EFileRead);
- test_Value(aret, aret == KErrNotFound);
+ test(aret==KErrNotFound);
test.End();
}
@@ -200,15 +199,15 @@
bposa(0);
bret=1100; bread(1100); bret=0;
aret=TheFile.Flush();
- test_KErrNone(aret);
+ test(aret==KErrNone);
aret=TheFile.SetSize(2000);
- test_KErrNone(aret);
+ test(aret==KErrNone);
TInt pos=0;
aret=TheFile.Seek(ESeekCurrent,pos);
- test_Value(aret, aret == KErrNone && pos==1100);
+ test(aret==KErrNone && pos==1100);
pos=0;
aret=TheFile.Seek(ESeekEnd,pos);
- test_Value(aret, aret == KErrNone && pos==2000);
+ test(aret==KErrNone && pos==2000);
bclose();
test.End();
}
@@ -226,32 +225,32 @@
test.Start(_L("RNDTEST..."));
TInt64 seed(0),zero(0);
aret=TheFile.Replace(TheFs,rndm,EFileWrite|aMode);
- test_KErrNone(aret);
+ test(aret==KErrNone);
for (cnt=0;cnt<KRandomNumbers;cnt++)
{
TBuf8<0x10> b;
b.Format(TPtrC8((TUint8*)"%8x"),Math::Rand(seed));
aret=TheFile.Write(b);
- test_KErrNone(aret);
+ test(aret==KErrNone);
}
TheFile.Close();
//
test.Next(_L("Reading back"));
seed=zero;
aret=TheFile.Open(TheFs,rndm,aMode);
- test_KErrNone(aret);
+ test(aret==KErrNone);
for (cnt=0;cnt<KRandomNumbers;cnt++)
{
TBuf8<8> b;
b.Format(TPtrC8((TUint8*)"%8x"),Math::Rand(seed));
TBuf8<8> r;
aret=TheFile.Read(r);
- test_KErrNone(aret);
+ test(aret==KErrNone);
test(b==r);
}
TheFile.Close();
aret=TheFs.Delete(rndm);
- test_KErrNone(aret);
+ test(aret==KErrNone);
//
test.End();
}
@@ -265,14 +264,14 @@
test.Start(_L("TAutoClose..."));
TAutoClose<RFile> f;
aret=f.iObj.Replace(TheFs,rndm,EFileWrite);
- test_KErrNone(aret);
+ test(aret==KErrNone);
TInt64 seed;
for (TInt cnt=0;cnt<KRandomNumbers;cnt++)
{
TBuf8<0x10> b;
b.Format(TPtrC8((TUint8*)"%8x"),Math::Rand(seed));
aret=f.iObj.Write(b);
- test_KErrNone(aret);
+ test(aret==KErrNone);
}
test.End();
}
@@ -284,7 +283,7 @@
TRequestStatus status = KRequestPending;
TheFile.Open(TheFs,tbin,EFileRead);
ret = TheFile.Read(0,tbuf,-1); // sync
- test_Value(ret, ret == KErrArgument);
+ test ( ret == KErrArgument);
TheFile.Read(0,tbuf,-1,status); // async
User::WaitForRequest(status);
test(status.Int() == KErrArgument);
@@ -300,16 +299,16 @@
RFile f;
MakeFile(_L("C:\\F32-TST\\TFILE\\hello2.txt"));
TInt r=f.Open(TheFs,_L("C:\\F32-TST\\TFILE\\hello2.txt"),EFileRead);
- test_KErrNone(r);
+ test(r==KErrNone);
TBuf8<0x100> a;
test.Next(_L("Check Negative length when file is empty"));
r=f.Read(a, -10);
- test_Value(r, r == KErrArgument);
+ test(r==KErrArgument);
r=f.Read(0,a, -1);
- test_Value(r, r == KErrArgument);
+ test(r==KErrArgument);
r=f.Read(0,a, -10);
- test_Value(r, r == KErrArgument);
+ test(r==KErrArgument);
TRequestStatus stat1;
f.Read(0,a,-5,stat1);
User::WaitForRequest(stat1);