--- a/kerneltest/f32test/server/t_file64bit.cpp Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_file64bit.cpp Wed Sep 01 12:34:56 2010 +0100
@@ -25,7 +25,6 @@
//
-#define __E32TEST_EXTENSION__
#include <f32file.h>
#include <e32test.h>
#include <e32svr.h>
@@ -58,7 +57,7 @@
RBuf8 buf;
r = buf.CreateMax(KBufSize);
- test_KErrNone(r);
+ test(r == KErrNone);
RFile64 file;
TFileName fileName;
@@ -66,10 +65,10 @@
fileName.Append(KTestPath);
fileName.Append(_L("File4GBMinusOne.txt"));
r = file.Replace(TheFs,fileName, EFileWrite);
- test_KErrNone(r);
+ test(r == KErrNone);
r = file.SetSize(K4GBMinusOne);
- test_KErrNone(r);
+ test(r == KErrNone);
TInt64 nNumberOfBytesToWrite = 0;
TInt64 nNumberOfBytesWritten = 0;
@@ -90,7 +89,7 @@
}
r = file.Flush();
- test_KErrNone(r);
+ test(r == KErrNone);
test.Printf(_L("\nFile writing is completed!!"));
@@ -178,7 +177,7 @@
{
test.Printf(_L("%S File Replaced with %S\n"),&anOldName,&aNewName);\
TInt r = TheFs.Replace(anOldName,aNewName);
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -191,9 +190,20 @@
TInt r = TheFs.ReadFileSection(aName,aPos,aBuffer,aLen);
TInt len = aBuffer.Length();
- test_KErrNone(r);
- if(KFileSizeMaxLargerThan4GBMinusOne == EFalse && aPos >= K4GB)
- test(len == 0);
+ if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
+ {
+ if(aPos < K4GB)
+ test(r == KErrNone);
+ else
+ {
+ test(r == KErrNone);
+ test(len == 0);
+ }
+ }
+ else
+ {
+ test (r == KErrNone);
+ }
return(*this);
}
@@ -205,7 +215,7 @@
{
test.Printf(_L("Name of the directory for which listing is required %S\n"),&aName);
TInt r = TheFs.GetDir(aName,anEntryAttMask,anEntrySortKey,anEntryList);
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -216,7 +226,7 @@
{
test.Printf(_L("Name of the directory for which directory and file listing is required %S\n"),&aName);
TInt r = TheFs.GetDir(aName,anEntryAttMask,anEntrySortKey,anEntryList,aDirList);
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -227,7 +237,7 @@
{
test.Printf(_L("Name of the directory for which listing is required %S\n"),&aName);
TInt r = TheFs.GetDir(aName,anEntryUid,anEntrySortKey,aFileList);
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -246,7 +256,7 @@
{
test.Printf(_L("%S create %S in %d Mode\n"),&iName,&aName,aFileMode);
TInt r = RFile64::Create(TheFs,aName,aFileMode);
- test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+ test(r == KErrNone || r == KErrAlreadyExists);
return(*this);
}
@@ -258,7 +268,7 @@
{
test.Printf(_L("%S replace %S\n"),&iName,&aName);
TInt r = RFile64::Replace(TheFs,aName,EFileStream|EFileWrite);
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -270,7 +280,10 @@
{
test.Printf(_L("%S replace %S in %d Mode\n"),&iName,&aName, aFileMode);
TInt r = RFile64::Replace(TheFs,aName,aFileMode);
- test_Value(r, r == KErrNone || r == KErrBadName);
+ if (r == KErrNone)
+ test(r == KErrNone);
+ else
+ test(r == KErrBadName);
return(*this);
}
@@ -281,7 +294,7 @@
{
test.Printf(_L("%S open %S\n"),&iName,&aName);
TInt r = RFile64::Open(TheFs,aName,EFileWrite|EFileShareAny);
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -292,7 +305,7 @@
{
test.Printf(_L("%S open %S in %d Mode\n"),&iName,&aName, aFileMode);
TInt r = RFile64::Open(TheFs,aName,aFileMode);
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -303,7 +316,7 @@
{
test.Printf(_L("%S Temp file %S in %d Mode\n"),&iName,&aName, aFileMode);
TInt r = RFile64::Temp(TheFs,aPath,aName,aFileMode);
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -322,7 +335,7 @@
{
test.Printf(_L("%S lock 0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
TInt r = RFile64::Lock(aPos,aLen);
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -333,7 +346,7 @@
{
test.Printf(_L("%S lockE 0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
TInt r = RFile64::Lock(aPos,aLen);
- test_Value(r, r == KErrLocked);
+ test(r == KErrLocked);
return(*this);
}
@@ -344,7 +357,7 @@
{
test.Printf(_L("%S ulock 0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
TInt r = RFile64::UnLock(aPos,aLen);
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -355,7 +368,7 @@
{
test.Printf(_L("%S ulockE 0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
TInt r = RFile64::UnLock(aPos,aLen);
- test_Value(r, r == KErrNotFound);
+ test(r == KErrNotFound);
return(*this);
}
@@ -378,17 +391,13 @@
if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
{
if((seekPos + aDes.Length()) < K4GB)
- {
- test_KErrNone(r);
- }
+ test(r == KErrNone);
else
- {
- test_Value(r, r == KErrNotSupported);
- }
+ test(r == KErrNotSupported);
}
else
{
- test_KErrNone(r);
+ test (r == KErrNone);
}
return(*this);
}
@@ -414,13 +423,10 @@
if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
{
if((seekPos + aDes.Length()) < K4GB)
- {
test(aStatus.Int() == KErrNone);
- }
else
- {
test(aStatus.Int() == KErrNotSupported);
- }
+
}
else
{
@@ -446,17 +452,13 @@
if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
{
if((seekPos + aLength) < K4GB)
- {
- test_KErrNone(r);
- }
+ test(r == KErrNone);
else
- {
- test_Value(r, r == KErrNotSupported);
- }
+ test(r == KErrNotSupported);
}
else
{
- test_KErrNone(r);
+ test(r == KErrNone);
}
return(*this);
}
@@ -506,17 +508,13 @@
if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
{
if ((aPos + aDes.Length()) < K4GB)
- {
- test_KErrNone(r);
- }
+ test(r == KErrNone);
else
- {
- test_Value(r, r == KErrNotSupported);
- }
+ test(r == KErrNotSupported);
}
else
{
- test_KErrNone(r);
+ test(r == KErrNone);
}
return(*this);
}
@@ -531,7 +529,7 @@
TInt r = RFile64::Write(aPos,aDes);
if( KErrNone == r) // this is to ensure that the written data is committed and not cached.
r = RFile64::Flush();
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -550,29 +548,19 @@
if ((aPos + aLen) < K4GB)
{
if (aLen < 0)
- {
- test_Value(r, r == KErrArgument);
- }
+ test(r == KErrArgument);
else
- {
- test_KErrNone(r);
- }
+ test(r == KErrNone);
}
else
- {
- test_Value(r, r == KErrNotSupported);
- }
+ test(r == KErrNotSupported);
}
else
{
if (aLen < 0)
- {
- test_Value(r, r == KErrArgument);
- }
+ test(r == KErrArgument);
else
- {
- test_KErrNone(r);
- }
+ test(r == KErrNone);
}
return(*this);
}
@@ -587,7 +575,7 @@
TInt r = RFile64::Write(aPos,aDes,aLen);
if( KErrNone == r) // this is to ensure that the written data is committed and not cached.
r = RFile64::Flush();
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -599,7 +587,10 @@
{
test.Printf(_L("%S writeE 0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
TInt r = RFile64::Write(aPos,aDes,aLen);
- test_Value(r, r == (aLen < 0) ? KErrArgument : KErrLocked);
+ if (aLen < 0)
+ test(r == KErrArgument);
+ else
+ test(r == KErrLocked);
return(*this);
}
@@ -710,7 +701,7 @@
{
test.Printf(_L("%S read \n"),&iName);
TInt r = RFile64::Read(aDes);
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -779,7 +770,10 @@
{
test.Printf(_L("%S read 0x%08x bytes\n"),&iName,aLen);
TInt r = RFile64::Read(aDes,aLen);
- test_Value(r, r == (aLen < 0) ? KErrArgument : KErrNone);
+ if(aLen < 0)
+ test(r == KErrArgument);
+ else
+ test(r == KErrNone);
return(*this);
}
@@ -791,7 +785,10 @@
test.Printf(_L("%S read 0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
TInt r = RFile64::Read(aPos,aDes,aLen);
TInt len = aDes.Length();
- test_Value(r, r == (aLen < 0) ? KErrArgument : KErrNone);
+ if(aLen < 0)
+ test(r == KErrArgument);
+ else
+ test(r == KErrNone);
if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
{
if(aPos >= K4GB)
@@ -807,7 +804,7 @@
{
test.Printf(_L("%S readE 0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
TInt r = RFile64::Read(aPos,aDes,aLen);
- test_Value(r, r == KErrLocked);
+ test(r == KErrLocked);
return(*this);
}
@@ -839,7 +836,7 @@
{
test.Printf(_L("%S read 0x%lx\n"),&iName,aPos);
TInt r = RFile64::Read(aPos,aDes);
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -851,7 +848,7 @@
{
test.Printf(_L("%S read 0x%lx\n"),&iName,aPos);
TInt r = RFile64::Read(aPos,aDes);
- test_KErrNone(r);
+ test(r == KErrNone);
return(*this);
}
@@ -876,7 +873,10 @@
{
test.Printf(_L("%S read 0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
TInt r = RFile64::Read(aPos,aDes,aLen);
- test_Value(r, r == (aLen < 0) ? KErrArgument : KErrNone);
+ if(aLen < 0)
+ test(r == KErrArgument);
+ else
+ test(r == KErrNone);
return(*this);
}
@@ -919,17 +919,13 @@
if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
{
if(aSize < K4GB)
- {
- test_KErrNone(r);
- }
+ test(r == KErrNone);
else
- {
- test_Value(r, r == KErrNotSupported);
- }
+ test(r == KErrNotSupported);
}
else
{
- test_KErrNone(r);
+ test(r == KErrNone);
}
return(*this);
}
@@ -941,7 +937,7 @@
{
test.Printf(_L("%S sizeE: 0x%lx\n"),&iName,aSize);
TInt r = RFile64::SetSize(aSize);
- test_Value(r, r == KErrLocked);
+ test(r == KErrLocked);
return(*this);
}
@@ -956,17 +952,13 @@
if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
{
if(aSize < K4GB)
- {
- test_KErrNone(r);
- }
+ test(r == KErrNone);
else
- {
- test_Value(r, r == KErrTooBig);
- }
+ test(r == KErrTooBig);
}
else
{
- test_KErrNone(r);
+ test(r == KErrNone);
}
return(*this);
@@ -978,7 +970,10 @@
{
test.Printf(_L("Seek to pos %LD in %d Mode\n"),aPos, aMode);
TInt r = RFile64::Seek(aMode, aPos);
- test_Value(r, r == (aPos < 0) ? KErrArgument : KErrNone);
+ if(aPos < 0)
+ test(r == KErrArgument);
+ else
+ test(r == KErrNone);
return(*this);
}
@@ -1017,7 +1012,7 @@
test.Next(_L("2GB File: Open"));
TInt r = TheFs.Entry(fileName, entry);
- test_KErrNone(r);
+ test(r == KErrNone);
test((TUint) entry.iSize == testSize);
TestRFile1.Open(fileName, EFileRead);
@@ -1028,7 +1023,7 @@
TestRFile1.Close();
r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -1065,7 +1060,7 @@
test.Next(_L("3GB File: Open"));
r = TheFs.Entry(fileName, entry);
- test_KErrNone(r);
+ test(r == KErrNone);
test((TUint) entry.iSize == testSize);
TestRFile1.Open(fileName,EFileRead);
@@ -1075,7 +1070,7 @@
TestRFile1.Close();
r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -1112,7 +1107,7 @@
test.Next(_L("4GB-1 File: Open"));
r = TheFs.Entry(fileName, entry);
- test_KErrNone(r);
+ test(r == KErrNone);
test((TUint) entry.iSize == testSize);
@@ -1124,7 +1119,7 @@
TestRFile1.Close();
r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -1161,7 +1156,7 @@
test.Next(_L("4GB File: Open"));
r = TheFs.Entry(fileName, entry);
- test_KErrNone(r);
+ test(r == KErrNone);
if ((TUint) entry.iSize == testSize)
{
@@ -1172,7 +1167,7 @@
}
r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
@@ -1259,10 +1254,10 @@
RFile64 file64;
TInt r = file64.Open(TheFs,fileName,EDeleteOnClose);
- test_Value(r, r == KErrArgument);
+ test (r == KErrArgument);
r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
@@ -1315,7 +1310,7 @@
test.Start(_L("Test opening a file using RFile and RFile64 in file sharing mode\n"));
TInt r = file.Replace(TheFs,fileName,EFileShareAny|EFileWrite);
- test_KErrNone(r);
+ test(r == KErrNone);
TBuf8<100> writeBuf;
TBuf8<100> readBuf;
@@ -1327,11 +1322,11 @@
test.Next(_L("Write 100 bytes to the file\n"));
r = file.Write(0, writeBuf, 100);
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Read 100 bytes from position 0"));
r = file.Read(0, readBuf, 100);
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Compare the read data to the written data"));
test(readBuf == writeBuf);
@@ -1345,13 +1340,13 @@
test.Next(_L("Query the file size using Rfile::Size()\n"));
r = file.Size(size);
- test_Value(r, r == KErrTooBig);
+ test (r == KErrTooBig);
test.Next(_L("Seek to the file position using 2GB+5 using RFile::Seek()\n"));
TUint seekPos1 = K2GB + 5;
TInt seekPos = (TInt)seekPos1;
r = file.Seek(ESeekStart,seekPos);
- test_Value(r, r == KErrArgument);
+ test(r == KErrArgument);
test.Next(_L("Get the file size using RFile64::Size()\n"));
TestRFile1.Size(size64);
@@ -1379,14 +1374,14 @@
test.Next(_L("Open the file using Rfile::Open()\n"));
r = file.Open(TheFs,fileName,EFileShareAny|EFileWrite);
- test_Value(r, r == KErrTooBig);
+ test(r == KErrTooBig);
test.Next(_L("Open the file using Rfile64::Open() and close\n"));
TestRFile1.Open(fileName,EFileShareAny|EFileWrite);
TestRFile1.Close();
r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -1430,7 +1425,7 @@
testDir.Append(KTestPath);
TInt r = TheFs.MkDir(testDir);
- test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+ test(r == KErrNone || r == KErrAlreadyExists);
TFileName fileName;
TestRFile1.Temp(testDir, fileName, EFileWrite|EDeleteOnClose);
@@ -1491,7 +1486,7 @@
test.Next(_L("Delete the temporary file\n"));
r = TheFs.Delete(fileName);
- test_Value(r, r == KErrNotFound);
+ test(r == KErrNotFound);
test.Next(_L("Create a temporary file using RFile64::Temp without EDeleteOnClose flag\n"));
TestRFile1.Temp(testDir, fileName, EFileWrite);
@@ -1501,7 +1496,7 @@
test.Next(_L("Delete the temporary the file\n"));
r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
@@ -1630,10 +1625,10 @@
test.Next(_L("create a file with InvalidPath and fileName\n"));
RFile64 file64;
TInt r = file64.Create(TheFs, _L("C:\\InvalidPathName\\FileName"),EFileWrite);
- test_Value(r, r == KErrPathNotFound);
+ test(r == KErrPathNotFound);
r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -1780,10 +1775,10 @@
test.Next(_L("Replace a file FileLargeOne.txt with invalid path\n"));
RFile64 file64;
TInt r = file64.Replace(TheFs,_L("C:\\InvalidPath\\FileLargeOne.Txt"),EFileWrite);
- test_Value(r, r == KErrPathNotFound);
+ test (r == KErrPathNotFound);
r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -1875,7 +1870,7 @@
test.Next(_L("Close the file and delete\n"));
TestRFile1.Close();
TInt r = TheFs.Delete(fileNameReplace);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -1906,39 +1901,39 @@
RProcess p;
TInt r = p.Create(_L("FHServer64Bit.exe"), KNullDesC);
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Connect to the File server \n"));
RFs fs;
r = fs.Connect();
- test_KErrNone(r);
+ test(r == KErrNone);
// Check the number of open file handles
TInt resCount = fs.ResourceCount();
test(resCount == 0);
r = fs.ShareProtected();
- test_KErrNone(r);
+ test(r == KErrNone);
r = fs.CreatePrivatePath(gDrive);
- test_KErrNone(r);
+ test(r == KErrNone);
r = fs.SetSessionToPrivate(gDrive);
test.Next(_L("Create a file and set the file size to 4GB-1\n"));
RFile64 file1;
r = file1.Replace(fs,KClientFileName,EFileWrite);
- test_KErrNone(r);
+ test(r == KErrNone);
r = file1.SetSize(K4GB-1);
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Write few bytes to the location 4GB-10, length = 9bytes\n"));
r = file1.Write(K4GB-10,KTestData3(),9);
- test_KErrNone(r);
+ test(r == KErrNone);
file1.Close();
r = p.SetParameter(3, gDrive);
- test_KErrNone(r);
+ test(r == KErrNone);
p.Resume();
@@ -1950,39 +1945,39 @@
r = handsvr.Connect();
}
while(r == KErrNotFound);
- test_KErrNone(r);
+ test(r == KErrNone);
r = handsvr.SetTestDrive(gDrive);
- test_KErrNone(r);
+ test(r == KErrNone);
r = fs.SetSessionToPrivate(gDrive);
- test_KErrNone(r);
+ test(r == KErrNone);
r = file1.Open(fs,KClientFileName,EFileRead);
- test_KErrNone(r);
+ test(r == KErrNone);
// pass the file handle to FHServer
test.Next(_L("RFile::TransferToServer()"));
TIpcArgs ipcArgs;
r = file1.TransferToServer(ipcArgs, 0, 1);
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Adopt the already open file from a client using RFile64::AdoptFromClient()\n"));
r = handsvr.PassFileHandleProcessLargeFileClient(ipcArgs);
- test_KErrNone(r);
+ test(r == KErrNone);
// verify that the original file handle's position is unchanged
TInt64 pos = 0;
r = file1.Seek(ESeekCurrent, pos);
- test_KErrNone(r);
+ test(r == KErrNone);
test(pos == 0);
// make sure we can still use it
test.Next(_L("Read the file from position 4GB-10 and compare the data\n"));
TBuf8<9> rbuf;
r = file1.Read(K4GB-10,rbuf);
- test_KErrNone(r);
+ test(r == KErrNone);
test (rbuf == KTestData3);
// Close the file
@@ -1990,14 +1985,14 @@
handsvr.Exit();
handsvr.Close();
r = fs.MkDir(_L("C:\\mdir"));
- test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+ test(r == KErrNone || r == KErrAlreadyExists);
// Check the number of open file handles
resCount = fs.ResourceCount();
test(resCount == 0);
r = fs.Delete(KClientFileName);
- test_KErrNone(r);
+ test(r == KErrNone);
fs.Close();
}
@@ -2036,39 +2031,39 @@
test.Next(_L("Create a process named FHServer64Bit.exe\n"));
RProcess p;
r = p.Create(_L("FHServer64Bit.exe"), KNullDesC);
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Connect to the file server\n"));
RFs fs;
r = fs.Connect();
- test_KErrNone(r);
+ test(r == KErrNone);
// Check the number of open file handles
TInt resCount = fs.ResourceCount();
test(resCount == 0);
r = fs.ShareProtected();
- test_KErrNone(r);
+ test(r == KErrNone);
r = fs.CreatePrivatePath(gDrive);
- test_KErrNone(r);
+ test(r == KErrNone);
r = fs.SetSessionToPrivate(gDrive);
test.Next(_L("Create a file and set the file size to 4GB-1\n"));
RFile64 file1;
r = file1.Replace(fs,KClientFileName,EFileWrite);
- test_KErrNone(r);
+ test(r == KErrNone);
r = file1.SetSize(K4GB-1);
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Write few bytes to the location 4GB-10, length = 3bytes\n"));
r = file1.Write(K4GB-10,KTestData2(),3);
- test_KErrNone(r);
+ test(r == KErrNone);
file1.Close();
r = file1.Open(fs, KClientFileName, EFileWrite);
- test_KErrNone(r);
+ test(r == KErrNone);
// NB slot 0 is reserved for the command line
@@ -2077,21 +2072,21 @@
r = file1.TransferToProcess(p, 1, 2);
r = p.SetParameter(3, gDrive);
- test_KErrNone(r);
+ test(r == KErrNone);
r = fs.SetSessionToPrivate(gDrive);
- test_KErrNone(r);
+ test(r == KErrNone);
// make sure we can still read from the file
TBuf8<3> rbuf;
r = file1.Read(K4GB-10,rbuf,3);
- test_KErrNone(r);
+ test(r == KErrNone);
r = rbuf.CompareF(KTestData2());
- test_KErrNone(r);
+ test(r == KErrNone);
file1.Close();
r = fs.MkDir(_L("C:\\mdir"));
- test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+ test(r == KErrNone || r == KErrAlreadyExists);
// Check the number of open file handles -
// should be 1 (the one duplicated for the other process)
@@ -2111,13 +2106,13 @@
r = handsvr.Connect();
}
while(r == KErrNotFound);
- test_KErrNone(r);
+ test(r == KErrNone);
r = handsvr.SetTestDrive(gDrive);
- test_KErrNone(r);
+ test(r == KErrNone);
// wait for server to read the file
r = handsvr.PassFileHandleProcessLargeFileCreator();
- test_KErrNone(r);
+ test (r == KErrNone);
// cleanup
@@ -2156,37 +2151,37 @@
test.Next(_L("Connect to the file server\n"));
RFs fs;
r = fs.Connect();
- test_KErrNone(r);
+ test(r == KErrNone);
// Check the number of open file handles
TInt resCount = fs.ResourceCount();
test(resCount == 0);
r = fs.ShareProtected();
- test_KErrNone(r);
+ test(r == KErrNone);
r = fs.CreatePrivatePath(gDrive);
- test_KErrNone(r);
+ test(r == KErrNone);
r = fs.SetSessionToPrivate(gDrive);
test.Next(_L("Create a file and set the file size to 4GB-1\n"));
RFile64 file1;
r = file1.Replace(fs,KClientFileName,EFileWrite);
- test_KErrNone(r);
+ test(r == KErrNone);
r = file1.SetSize(K4GB-1);
- test_KErrNone(r);
+ test(r == KErrNone);
r = file1.Write(K4GB-10,KTestData3(),9);
- test_KErrNone(r);
+ test(r == KErrNone);
file1.Close();
r = fs.Delete(KClientFileName);
- test_KErrNone(r);
+ test(r == KErrNone);
RProcess p;
r = p.Create(_L("FHServer64Bit.exe"), KNullDesC);
- test_KErrNone(r);
+ test(r == KErrNone);
// Request an open file (write mode) from the server
// using RFile64::AdoptFromServer()
@@ -2198,10 +2193,10 @@
r = handsvr.Connect();
}
while(r == KErrNotFound);
- test_KErrNone(r);
+ test(r == KErrNone);
r = handsvr.SetTestDrive(gDrive);
- test_KErrNone(r);
+ test(r == KErrNone);
TInt ssh;
TInt fsh = handsvr.GetFileHandleLargeFile2(ssh, EFileWrite);
@@ -2220,30 +2215,30 @@
RFile64 file;
r = file.AdoptFromServer(fsh, ssh);
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Read the file from position 4GB-10 and compare the data\n"));
TBuf8<9> rbuf;
r = file.Read(K4GB-10,rbuf);
- test_KErrNone(r);
+ test(r == KErrNone);
// server should write KTestData1 ("Server!!!") to file
test (rbuf == KTestData4);
TFileName fileName;
r = file.FullName(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
file.Close();
//cleanup
r = fs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
TFileName sessionPath;
r = fs.SessionPath(sessionPath);
- test_KErrNone(r);
+ test(r == KErrNone);
r = fs.RmDir(sessionPath);
- test_KErrNone(r);
+ test(r == KErrNone);
fs.Close();
@@ -2276,7 +2271,7 @@
TBuf8<KBufSize> readBuf2;
TUint i;
TInt r = GenerateBigFileContents();
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Open & Read Synchronously Large File From Diff Offset:"));
@@ -2906,7 +2901,7 @@
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -3043,7 +3038,7 @@
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -3182,7 +3177,7 @@
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -3347,7 +3342,7 @@
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -3527,7 +3522,7 @@
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -3599,7 +3594,7 @@
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
@@ -3708,7 +3703,7 @@
TestRFile2.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -3802,7 +3797,7 @@
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -3909,7 +3904,7 @@
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -4016,7 +4011,7 @@
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -4053,9 +4048,9 @@
fileName.Append(_L("File4GBMinusOne.txt"));
TInt r = file.Replace(TheFs,fileName,EFileWrite);
- test_KErrNone(r);
+ test(r == KErrNone);
r = file.SetSize(K4GBMinusOne);
- test_KErrNone(r);
+ test(r == KErrNone);
file.Close();
test.Next(_L("Read from a big file using RFs::ReadFileSection() from position 3GB-1,52byte lengths of data\n"));
@@ -4086,7 +4081,7 @@
}
r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -4150,11 +4145,11 @@
test.Next(_L("Get the directory listing, sort by size\n"));
RDir dir;
TInt r = dir.Open(TheFs, dirName, KEntryAttNormal);
- test_KErrNone(r);
+ test (r == KErrNone);
TEntryArray entryArray;
r = dir.Read(entryArray);
- test_Value(r, r == KErrEof);
+ test (r == KErrEof);
test.Next(_L("Check the files count in the directory. Number of files in a directory is 4\n"));
test(entryArray.Count() == gFilesInDirectory);
@@ -4302,12 +4297,12 @@
test.Next(_L("Open the directory containing large file, using RDir open()\n"));
RDir dir;
TInt r = dir.Open(TheFs, dirName, KEntryAttNormal);
- test_KErrNone(r);
+ test (r == KErrNone);
test.Next(_L("Read the directory entry using TEntryArray as parameter\n"));
TEntryArray entryArray;
r = dir.Read(entryArray);
- test_Value(r, r == KErrEof);
+ test (r == KErrEof);
test.Next(_L("Check the count\n"));
test(entryArray.Count() == gFilesInDirectory);
@@ -4346,7 +4341,7 @@
testDir0.Append(_L("F32-TEST"));
TInt r = TheFs.MkDir(testDir0);
- test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+ test(r == KErrNone || r == KErrAlreadyExists);
test.Next(_L("Sort with number of entries =0\n"));
TestRFs.GetDir(testDir0, KEntryAttMaskSupported, ESortBySize, anEntryList);
@@ -4473,13 +4468,13 @@
file3GB.Append(_L("File3GB.txt"));
TInt r = TheFs.Delete(file4GBMinusOne);
- test_KErrNone(r);
+ test(r == KErrNone);
r = TheFs.Delete(file2GBMinusOne);
- test_KErrNone(r);
+ test(r == KErrNone);
r = TheFs.Delete(file2GB);
- test_KErrNone(r);
+ test(r == KErrNone);
r = TheFs.Delete(file3GB);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@@ -4526,20 +4521,20 @@
test.Next(_L("Open test file and get the file size using RFile64::Size() and set the file handle to TFileText object\n"));
r = file64.Replace(TheFs,fileName,EFileRead|EFileWrite);
- test_KErrNone(r);
+ test(r == KErrNone);
r = file64.SetSize(sizeK3GB);
- test_KErrNone(r);
+ test(r == KErrNone);
TFileText fileText;
fileText.Set(file64);
test.Next(_L("Seek to the file end using TFileText::Seek()\n"));
r = fileText.Seek(ESeekEnd);
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Get current file position using RFile64::Seek() and verify it is at file end.\n"));
TInt64 pos = 0;
r = file64.Seek(ESeekCurrent, pos);
- test_KErrNone(r);
+ test(r == KErrNone);
test(pos == sizeK3GB);
test.Next(_L("Write data to the file using RFile64::Write\n"));
@@ -4549,7 +4544,7 @@
TPtrC8 bufPtr;
bufPtr.Set((TUint8*)record->Ptr(),record->Size()); // Size() returns length in bytes
r = file64.Write(pos,bufPtr);
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Read data using TFileText::Read\n"));
TBuf<20> fileTextReadBuf;
@@ -4559,26 +4554,26 @@
test.Next(_L("Seek to the file end using TFileText::Seek(ESeekEnd)\n"));
r = fileText.Seek(ESeekEnd);
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Write known data using TFileText::Write\n"));
TBuf<20> fileTextWriteBuf(_L("AAAAAAAAAA"));
pos = 0;
r = file64.Seek(ESeekCurrent,pos);
r = fileText.Write(fileTextWriteBuf);
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Read the data using RFile64::Read\n"));
TBuf8<20> file64ReadBuf;
file64ReadBuf.Zero();
r = file64.Read(pos,file64ReadBuf);
r = bufPtr.Compare(file64ReadBuf);
- test_KErrNone(r);
+ test (r == KErrNone);
file64.Close();
r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
User::Free(record);
}
@@ -4671,7 +4666,7 @@
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
test.End();
}
@@ -4751,13 +4746,13 @@
fileName1.Append(_L("File2GB.txt"));
RFile64 file;
TInt r = file.Replace(TheFs, fileName1, EFileWrite);
- test_KErrNone(r);
+ test (r == KErrNone);
file.SetSize(K2GB);
- test_KErrNone(r);
+ test (r == KErrNone);
file.Close();
TestRFs.ReadFileSection(fileName1,0,readBuf,100);
r = TheFs.Delete(fileName1);
- test_KErrNone(r);
+ test (r == KErrNone);
test.Next(_L("Creating test pattern"));
TBuf8<0x63> writeBuf63;
@@ -4791,7 +4786,7 @@
TestRFile1.Close();
r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
test.End();
}
@@ -4942,7 +4937,7 @@
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
test.End();
}
@@ -5081,7 +5076,7 @@
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
test.End();
}
@@ -5228,7 +5223,7 @@
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
test.End();
}
/**
@@ -5380,7 +5375,7 @@
}
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
test.End();
}
/**
@@ -5464,7 +5459,7 @@
}
TestRFile1.Close();
TInt r = TheFs.Delete(fileName);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@SYMTestCaseID PBASE-T_FILE64BIT-2354
@@ -5592,20 +5587,20 @@
test.Next(_L("Copy the files from one folder to another using CFileMan::Copy()\n"));
TInt r = fileMan->Copy(filePathOld, filePathNew, CFileMan::ERecurse | CFileMan::EOverWrite);
- test_Value(r, r == KErrNone || r == KErrTooBig);
+ test(r == KErrNone || r == KErrTooBig);
test.Next(_L("Get the directory entry and find how many files are copied\n"));
// check SMALL and LARGE files have been copied
r = dir.Open(TheFs, filePathNew, KEntryAttNormal);
- test_KErrNone(r);
+ test (r == KErrNone);
r = dir.Read(entryArray);
- test_Value(r, r == KErrEof);
+ test (r == KErrEof);
test(entryArray.Count() == gFilesInDirectory);
dir.Close();
// then delete the new directory
r = fileMan->Delete(filePathNew);
- test_KErrNone(r);
+ test(r == KErrNone);
test.Next(_L("Set file man observer\n"));
// attempt to copy to new directory again - this time with an observer
@@ -5613,7 +5608,7 @@
test.Next(_L("Copy the files from one folder to another, source folder has 3 small files and a large file\n"));
r = fileMan->Copy(filePathOld, filePathNew, CFileMan::ERecurse | CFileMan::EOverWrite);
- test_Value(r, r == KErrNone || r == KErrTooBig);
+ test(r == KErrNone || r == KErrTooBig);
test.Next(_L("Check observer for number of successful copy and failed copy\n"));
// test that 3 small files and 1 large file were copied
@@ -5624,28 +5619,28 @@
test.Next(_L("Get the directory entry and find how many files copied\n"));
// check SMALL files have been copied
r = dir.Open(TheFs, filePathNew, KEntryAttNormal);
- test_KErrNone(r);
+ test (r == KErrNone);
r = dir.Read(entryArray);
- test_Value(r, r == KErrEof);
+ test (r == KErrEof);
test(entryArray.Count() == gFilesInDirectory);
dir.Close();
// then delete the new directory
r = fileMan->Delete(filePathNew);
- test_KErrNone(r);
+ test(r == KErrNone);
delete observer;
delete fileMan;
r = TheFs.Delete(fileSmall1);
- test_KErrNone(r);
+ test(r == KErrNone);
r = TheFs.Delete(fileSmall2);
- test_KErrNone(r);
+ test(r == KErrNone);
r = TheFs.Delete(fileSmall3);
- test_KErrNone(r);
+ test(r == KErrNone);
r = TheFs.Delete(fileLarge1);
- test_KErrNone(r);
+ test(r == KErrNone);
}
/**
@SYMTestCaseID PBASE-T_FILE64BIT-2355
@@ -5723,21 +5718,21 @@
// move to new directory
TInt r = fileMan->Move(filePathOld, filePathNew, CFileMan::ERecurse | CFileMan::EOverWrite);
- test_Value(r, r == KErrNone || r == KErrTooBig);
+ test(r == KErrNone || r == KErrTooBig);
// check SMALL and LARGE files have been moved
RDir dir;
r = dir.Open(TheFs, filePathNew, KEntryAttNormal);
- test_KErrNone(r);
+ test (r == KErrNone);
TEntryArray entryArray;
r = dir.Read(entryArray);
- test_Value(r, r == KErrEof);
+ test (r == KErrEof);
test(entryArray.Count() == 4);
dir.Close();
// then delete the new directory
r = fileMan->Delete(filePathNew);
- test_KErrNone(r);
+ test(r == KErrNone);
delete fileMan;
}
@@ -5761,13 +5756,13 @@
TInt r;
RFs fs;
r = fs.Connect();
- test_KErrNone(r);
+ test(r == KErrNone);
r = fs.ShareProtected();
- test_KErrNone(r);
+ test(r == KErrNone);
TFileName sessionp;
fs.SessionPath(sessionp);
r = fs.MkDirAll(sessionp);
- test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+ test(r == KErrNone || r == KErrAlreadyExists);
fs.Close();
TestRFile64AdoptFromCreator();
TestRFile64AdoptFromClient();
@@ -5907,11 +5902,11 @@
// If a zero length is passed into the Write function, KErrNone should be returned.
r=aFile.Write(aPos,gBuf);
- test_KErrNone(r);
+ test(r==KErrNone);
// If the length is a negative, KErrArgument should be returned.
r=aFile.Write(aPos,gBuf,aLen);
- test_Value(r, r == KErrArgument);
+ test(r==KErrArgument);
// Test the asynchronous requests
aFile.Write(aPos,gBuf,aLen,status1);
@@ -5923,7 +5918,7 @@
aFile.Close();
r = TheFs.Delete(_L("\\testRFile64NegLen.txt"));
- test_KErrNone(r);
+ test(r == KErrNone);
test.End();
}
//-------------------------------------------------------------------------------------------------------------------
@@ -5961,11 +5956,9 @@
{
KFileSizeMaxLargerThan4GBMinusOne = EFalse; //-- FAT doesn't support >= 4G files
}
- else if(Is_SimulatedSystemDrive(TheFs, aDrive))
- {
- //-- This is the emulator's windows drive or PlatSim's HVFS.
- //-- The maximal file size depends on the Windows FS used for this drive.
- //-- If it is NTFS, files >= 4G are supported.
+ else if(Is_Win32(TheFs, aDrive))
+ {//-- this is the emulator's windows drive. The maximal file size depends on the Windows FS used for this drive.
+ //-- if it is NTFS, files >= 4G are supported.
r = CreateEmptyFile(TheFs, _L("\\test_file"), K4GB);
KFileSizeMaxLargerThan4GBMinusOne = (r == KErrNone);
@@ -5987,7 +5980,7 @@
{
TInt r;
r = RFs::CharToDrive(gDriveToTest, gDrive);
- test_KErrNone(r);
+ test(r == KErrNone);
//-- set up console output
F32_Test_Utils::SetConsole(test.Console());
@@ -6036,7 +6029,7 @@
dirName.Append(gDriveToTest);
dirName.Append(KTestPath);
r = TheFs.RmDir(dirName);
- test_KErrNone(r);
+ test(r == KErrNone);
}