--- a/kerneltest/f32test/server/t_bigfile.cpp Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_bigfile.cpp Wed Sep 01 12:34:56 2010 +0100
@@ -34,7 +34,6 @@
//
-#define __E32TEST_EXTENSION__
#include <f32file.h>
#include <e32test.h>
#include <e32svr.h>
@@ -115,7 +114,6 @@
MFileManObserver::TControl CFileManObserver::NotifyFileManStarted()
{
- (void)MFileManObserver::NotifyFileManStarted();
TInt lastError = iFileMan->GetLastError();
TFileName fileName = iFileMan->CurrentEntry().iName;
test.Printf(_L("NotifyFileManStarted(): Error %d File %S\n"),lastError, &fileName);
@@ -124,7 +122,6 @@
MFileManObserver::TControl CFileManObserver::NotifyFileManOperation()
{
- (void)MFileManObserver::NotifyFileManOperation();
TInt lastError = iFileMan->GetLastError();
TFileName fileName = iFileMan->CurrentEntry().iName;
test.Printf(_L("NotifyFileManOperation(): Error %d File %S\n"),lastError, &fileName);
@@ -171,27 +168,27 @@
test.Next(_L("2GBMinusOne File: Open"));
r = f.Open(TheFs, fname, EFileRead);
- test_KErrNone(r);
+ test(r==KErrNone);
testSize = K2GbMinusOne;
test.Next(_L("2GBMinusOne File: Read"));
r=f.Size((TInt&) size);
- test_KErrNone(r);
+ test(r==KErrNone);
test(size == testSize);
r = TheFs.Entry(fname, entry);
- test_KErrNone(r);
+ test(r==KErrNone);
test ((TUint) entry.iSize == testSize);
// seek to just below 2GB
testPos = (K2GbMinusOne - K1Kb) & KPosMask;
r = f.Seek(ESeekStart, (TInt&) testPos);
- test_KErrNone(r);
+ test(r==KErrNone);
r = f.Read(bufPtr);
- test_KErrNone(r);
+ test(r==KErrNone);
TUint posRead = * ((TUint*) &bufPtr[0]);
test.Printf(_L("position read %08X, expected %08X\n"), posRead, testPos);
@@ -224,13 +221,13 @@
test.Next(_L("2GB File: Test the size with RFs::Entry"));
r = TheFs.Entry(fname, entry);
- test_KErrNone(r);
+ test(r==KErrNone);
test ((TUint) entry.iSize == testSize);
test.Next(_L("2GB File: Attempt to open (should fail with KErrToBig)"));
r = f.Open(TheFs, fname, EFileRead);
- test_Value(r, r == KErrTooBig);
+ test(r==KErrTooBig);
}
//----------------------------------------------------------------------------------------------
@@ -257,13 +254,13 @@
test.Next(_L("3GB File: Test the size with RFs::Entry"));
r = TheFs.Entry(fname, entry);
- test_KErrNone(r);
+ test(r==KErrNone);
test ((TUint) entry.iSize == testSize);
test.Next(_L("3GB File: Attempt to open (should fail with KErrToBig)"));
r = f.Open(TheFs, fname, EFileRead);
- test_Value(r, r == KErrTooBig);
+ test(r==KErrTooBig);
}
//----------------------------------------------------------------------------------------------
@@ -291,13 +288,13 @@
test.Next(_L("4GB File: Test the size with RFs::Entry"));
r = TheFs.Entry(fname, entry);
- test_KErrNone(r);
+ test(r==KErrNone);
test ((TUint) entry.iSize == testSize);
test.Next(_L("4GB File: Attempt to open (should fail with KErrToBig)"));
r = f.Open(TheFs, fname, EFileRead);
- test_Value(r, r == KErrTooBig);
+ test(r==KErrTooBig);
}
//----------------------------------------------------------------------------------------------
@@ -327,27 +324,27 @@
test.Next(_L("2GBMinusOne File: Open"));
r = f.Open(TheFs, fname, EFileRead | EFileWrite);
- test_KErrNone(r);
+ test(r==KErrNone);
test.Next(_L("2GBMinusOne File: Attempt to extend"));
r=f.Size((TInt&) size);
- test_KErrNone(r);
+ test(r==KErrNone);
test(size == testSize);
r = TheFs.Entry(fname, entry);
- test_KErrNone(r);
+ test(r==KErrNone);
test ((TUint) entry.iSize == testSize);
// seek to end
testPos = 0;
r = f.Seek(ESeekEnd, (TInt&) testPos);
- test_KErrNone(r);
+ test(r==KErrNone);
bufPtr.SetLength(1);
r = f.Write(bufPtr);
- test_Value(r, r == KErrTooBig);
+ test(r==KErrTooBig);
f.Close();
}
@@ -368,7 +365,7 @@
test.Printf(_L("Deleting %S\n"), &aFileName);
TInt r = TheFs.Delete(aFileName);
- test_KErrNone(r);
+ test(r==KErrNone);
CheckDisk();
}
@@ -391,11 +388,11 @@
RDir dir;
TInt r = dir.Open(TheFs, _L("*.*"), KEntryAttNormal);
- test_KErrNone(r);
+ test (r == KErrNone);
TEntryArray entryArray;
r = dir.Read(entryArray);
- test_Value(r, r == KErrEof);
+ test (r == KErrEof);
test(entryArray.Count() == gFilesInDirectory);
@@ -428,7 +425,7 @@
test.Next(_L("Read a directory containing large files using CDir & sort by size"));
CDir* dirList;
r=TheFs.GetDir(_L("*.*"), KEntryAttMaskSupported, ESortBySize, dirList);
- test_KErrNone(r);
+ test(r==KErrNone);
test(dirList->Count() == gFilesInDirectory);
for (n=0; n<dirList->Count(); n++)
{
@@ -486,16 +483,16 @@
TPath filePathNew = _L("?:\\TEST\\");
TChar driveLetter;
TInt r=TheFs.DriveToChar(gDrive,driveLetter);
- test_KErrNone(r);
+ test(r==KErrNone);
filePathNew[0] = (TText) driveLetter;
// move to new directory
r = fileMan->Move(filePathOld, filePathNew, CFileMan::ERecurse | CFileMan::EOverWrite);
- test_KErrNone(r);
+ test(r == KErrNone);
// then move back again
r = fileMan->Move(filePathNew, filePathOld);
- test_KErrNone(r);
+ test(r == KErrNone);
delete fileMan;
}
@@ -525,7 +522,7 @@
TPath filePathNew = _L("?:\\TEST\\");
TChar driveLetter;
TInt r = TheFs.DriveToChar(gDrive,driveLetter);
- test_KErrNone(r);
+ test(r == KErrNone);
filePathNew[0] = (TText) driveLetter;
// create some small files in the source directory
@@ -535,47 +532,47 @@
_LIT(KFileSmall2, "FileSmallTwo.txt");
_LIT(KFileSmall3, "FileSmallThree.txt");
r = file.Create(TheFs, KFileSmall1(), EFileWrite | EFileShareAny);
- test_KErrNone(r);
+ test(r == KErrNone);
r = file.Write(_L8("1"));
- test_KErrNone(r);
+ test(r == KErrNone);
file.Close();
r = file.Create(TheFs, KFileSmall2(), EFileWrite | EFileShareAny);
- test_KErrNone(r);
+ test(r == KErrNone);
r = file.Write(_L8("12"));
- test_KErrNone(r);
+ test(r == KErrNone);
file.Close();
r = file.Create(TheFs, KFileSmall3(), EFileWrite | EFileShareAny);
- test_KErrNone(r);
+ test(r == KErrNone);
r = file.Write(_L8("123"));
- test_KErrNone(r);
+ test(r == KErrNone);
file.Close();
// copy to new directory
r = fileMan->Copy(filePathOld, filePathNew, CFileMan::ERecurse | CFileMan::EOverWrite);
- test_Value(r, r == KErrNone || r == KErrTooBig);
+ test(r == KErrNone || r == KErrTooBig);
// check SMALL files have been copied
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() == 3);
dir.Close();
// then delete the new directory
r = fileMan->Delete(filePathNew);
- test_KErrNone(r);
+ test(r == KErrNone);
// attempt to copy to new directory again - this time with an observer
fileMan->SetObserver(observer);
r = fileMan->Copy(filePathOld, filePathNew, CFileMan::ERecurse | CFileMan::EOverWrite);
- test_Value(r, r == KErrNone || r == KErrTooBig);
+ test(r == KErrNone || r == KErrTooBig);
// test that 3 small files were copied and 1 or 2 large files failed to copy
// (For 8 GB disk, the 4GB file is missing)
@@ -584,15 +581,15 @@
// 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() == 3);
dir.Close();
// then delete the new directory
r = fileMan->Delete(filePathNew);
- test_KErrNone(r);
+ test(r == KErrNone);
delete observer;
delete fileMan;
@@ -615,17 +612,17 @@
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;
TInt filesFound = 0;
for (;;)
{
TRAP(r, scanner->NextL(entryList));
- test_Value(r, r == aError);
+ test(r == aError);
if (entryList==NULL)
break;
TInt count = entryList->Count();
@@ -672,11 +669,11 @@
TInt r;
r = TheFs.CharToDrive(gDriveToTest, gDrive);
- test_KErrNone(r);
+ test(r==KErrNone);
#ifdef __MOUNT_RAW_EXT__
r=TheFs.FileSystemName(gOldFsName, gDrive);
- test_KErrNone(r);
+ test(r==KErrNone);
if (gOldFsName.CompareF(KFATName) != 0)
{
@@ -685,9 +682,9 @@
}
r = TheFs.AddExtension(KExtName);
- test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+ test(r==KErrNone || r==KErrAlreadyExists);
r = TheFs.MountExtension(KExtName, gDrive);
- test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+ test(r==KErrNone || r==KErrAlreadyExists);
#endif
TVolumeInfo vi;
@@ -718,7 +715,7 @@
test.Next(_L("Scan Drive"));
r = TheFs.ScanDrive(gSessionPath);
- test_KErrNone(r);
+ test (r == KErrNone);
// NB the 4GB file will not be present unless the disk is > 8GB (because it doesn't fit)
if (!FilePresent(KFile4GBMinusOne()))
@@ -764,10 +761,10 @@
#ifdef __MOUNT_RAW_EXT__
r = TheFs.DismountExtension(KExtName, gDrive);
- test_KErrNone(r);
+ test(r==KErrNone);
r = TheFs.RemoveExtension(KExtName);
- test_KErrNone(r);
+ test(r==KErrNone);
#endif