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