--- a/kerneltest/f32test/server/t_appins.cpp Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_appins.cpp Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
//
//
-#define __E32TEST_EXTENSION__
#include <f32file.h>
#include <e32test.h>
#include <hal.h>
@@ -54,11 +53,11 @@
path=_L("?:\\F32-TST\\T_APPINS\\");
TInt r=TheNotifyFs.SessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
TChar driveChar;
r=RFs::DriveToChar(RemovableDrive,driveChar);
- test_KErrNone(r);
+ test(r==KErrNone);
if (gSessionPath[0]=='C')
(gSessionPath[0] == (TText)gDriveToTest)? (path[0] = (TText)driveChar):(path[0] = (TText)gDriveToTest);
@@ -77,7 +76,7 @@
TRequestStatus statWilder(KRequestPending);
r=TheFs.RmDir(path);
- test_Value(r, (r == KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
+ test((r==KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
test.Printf(_L("Notify Session Path %S\n"),&gSessionPath);
@@ -90,7 +89,7 @@
TheNotifyFs.NotifyChange(ENotifyEntry,statWilder,_L("*:\\"));
r=TheFs.MkDir(path);
- test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+ test((r==KErrNone)||(r==KErrAlreadyExists));
User::WaitForAnyRequest();
test(statEntry==KErrNone);
test(statFile==KErrNone);
@@ -113,7 +112,7 @@
r=file.Replace(TheFs,filePath,EFileRead|EFileWrite);
file.Close();
User::WaitForAnyRequest();
- test_KErrNone(r);
+ test(r==KErrNone);
test (statEntry==KErrNone);
test(statFile==KErrNone);
test(statDir==KRequestPending);
@@ -128,7 +127,7 @@
TheNotifyFs.NotifyChange(ENotifyEntry,statWilder,_L("*:\\"));
r=TheFs.Delete(filePath);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForAnyRequest();
test (statEntry==KErrNone);
test(statFile==KErrNone);
@@ -144,7 +143,7 @@
TheNotifyFs.NotifyChange(ENotifyFile,statWilder,_L("*:\\"));
r=TheFs.RmDir(path);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForAnyRequest();
test (statEntry==KErrNone);
test(statFile==KRequestPending);
@@ -167,7 +166,7 @@
TChar driveChar;
TInt err=RFs::DriveToChar(RemovableDrive,driveChar);
- test_KErrNone(err);
+ test(err==KErrNone);
if (gSessionPath[0]=='C')
(gSessionPath[0] == (TText)gDriveToTest)? (sessionPath[0] = (TText)driveChar):(sessionPath[0] = (TText)gDriveToTest);
@@ -180,13 +179,13 @@
//return;
TInt r=TheFs.SetSessionPath(sessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
TFileName path;
path=_L("\\F32-TST\\T_APPINS\\"); // Takes drive implicitly from associated session path
r=TheFs.RmDir(path);
- test_Value(r, (r == KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
+ test((r==KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
TRequestStatus statEntry(KRequestPending);
TRequestStatus statFile(KRequestPending);
@@ -207,7 +206,7 @@
TheNotifyFs.NotifyChange(ENotifyAll,statWilder,_L("*:\\"));
r=TheFs.MkDir(path); // Creates the directory on the drive
- test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists)); // associated with TheFs session path
+ test((r==KErrNone)||(r==KErrAlreadyExists)); // associated with TheFs session path
test (statEntry==KRequestPending);
test(statFile==KRequestPending);
test(statDir==KRequestPending); // No notification because it's watching a different drive!
@@ -225,7 +224,7 @@
RFile file;
r=file.Replace(TheFs,filePath,EFileRead|EFileWrite);
file.Close();
- test_KErrNone(r);
+ test(r==KErrNone);
test (statEntry==KRequestPending); // No notification!
test(statFile==KRequestPending);
@@ -238,7 +237,7 @@
TheNotifyFs.NotifyChange(ENotifyDir,statWilder,_L("*:\\"));
r=TheFs.Delete(filePath);
- test_KErrNone(r);
+ test(r==KErrNone);
// Still no notification
test (statEntry==KRequestPending);
test(statFile==KRequestPending);
@@ -251,7 +250,7 @@
TheNotifyFs.NotifyChange(ENotifyDir,statWild,_L("?:\\F32-TST\\T_APPINS\\"));
// TheNotifyFs.NotifyChange(ENotifyDir,statWilder,_L("*:\\"));
r=TheFs.RmDir(path);
- test_KErrNone(r);
+ test(r==KErrNone);
// Still no notification
test (statEntry==KRequestPending);
test(statFile==KRequestPending);
@@ -272,7 +271,7 @@
TFileName path;
path=_L("\\F32-TST\\T_APPINS\\");
TInt r=TheFs.RmDir(path);
- test_Value(r, (r == KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
+ test((r==KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
TRequestStatus statEntry(KRequestPending);
TRequestStatus statFile(KRequestPending);
@@ -284,7 +283,7 @@
// Set the session path of the session which creates the file/directory to be
// the same as the notification session's session path
r=TheFs.SetSessionPath(gSessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
// Submit notify change requests (requesting ahead)
test.Printf(_L("Create a directory %S\n"),&path);
@@ -295,7 +294,7 @@
TheNotifyFs.NotifyChange(ENotifyEntry,statWilder,_L("*:\\"));
r=TheFs.MkDir(path);
- test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+ test((r==KErrNone)||(r==KErrAlreadyExists));
User::WaitForAnyRequest();
test (statEntry==KErrNone);
test(statFile==KErrNone);
@@ -319,7 +318,7 @@
r=file.Replace(TheFs,filePath,EFileRead|EFileWrite);
file.Close();
User::WaitForAnyRequest();
- test_KErrNone(r);
+ test(r==KErrNone);
test (statEntry==KErrNone);
test(statFile==KErrNone);
test(statDir==KRequestPending);
@@ -334,7 +333,7 @@
TheNotifyFs.NotifyChange(ENotifyEntry,statWilder,_L("*:\\"));
r=TheFs.Delete(filePath);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForAnyRequest();
test (statEntry==KErrNone);
test(statFile==KErrNone);
@@ -350,7 +349,7 @@
TheNotifyFs.NotifyChange(ENotifyEntry,statWilder,_L("*:\\"));
r=TheFs.RmDir(path);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForAnyRequest();
test (statEntry==KErrNone);
test(statFile==KRequestPending);
@@ -375,7 +374,7 @@
TChar driveChar;
TInt r=RFs::DriveToChar(RemovableDrive,driveChar);
- test_KErrNone(r);
+ test(r==KErrNone);
if (gDriveToTest =='C')
pathBuf[0]=driveChar;
@@ -384,21 +383,21 @@
path = pathBuf;
r=TheFs.RmDir(path);
- test_Value(r, (r == KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
+ test((r==KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
TInt result;
result=TheFs.MkDir(_L("C:\\SILLY\\"));
- test_Value(result, (result == KErrNone)||(result==KErrAlreadyExists));
+ test((result==KErrNone)||(result==KErrAlreadyExists));
result=TheFs.MkDir(_L("C:\\SILLY\\SILLIER\\"));
- test_Value(result, (result == KErrNone)||(result==KErrAlreadyExists));
+ test((result==KErrNone)||(result==KErrAlreadyExists));
result=TheFs.MkDir(_L("C:\\SILLY\\SILLIER\\SILLIEST\\"));
- test_Value(result, (result == KErrNone)||(result==KErrAlreadyExists));
+ test((result==KErrNone)||(result==KErrAlreadyExists));
result=TheNotifyFs.SetSessionPath(_L("C:\\SILLY\\SILLIER\\SILLIEST\\"));
- test_KErrNone(result);
+ test(result==KErrNone);
result=TheNotifyFs.SessionPath(gSessionPath);
- test_KErrNone(result);
+ test(result==KErrNone);
test.Printf(_L("Session Path %S\n"),&gSessionPath);
TRequestStatus statEntry(KRequestPending);
@@ -412,7 +411,7 @@
TheNotifyFs.NotifyChange(ENotifyDir,statDir,path);
r=TheFs.MkDir(path);
- test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+ test((r==KErrNone)||(r==KErrAlreadyExists));
User::WaitForAnyRequest();
test (statEntry==KErrNone);
test(statFile==KErrNone);
@@ -431,7 +430,7 @@
r=file.Replace(TheFs,filePath,EFileRead|EFileWrite);
file.Close();
User::WaitForAnyRequest();
- test_KErrNone(r);
+ test(r==KErrNone);
test (statEntry==KErrNone);
test(statFile==KErrNone);
test(statDir==KRequestPending);
@@ -442,7 +441,7 @@
TheNotifyFs.NotifyChange(ENotifyFile,statFile,path);
r=TheFs.Delete(filePath);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForAnyRequest();
test (statEntry==KErrNone);
test(statFile==KErrNone);
@@ -453,18 +452,18 @@
TheNotifyFs.NotifyChange(ENotifyEntry,statEntry,path);
TheNotifyFs.NotifyChange(ENotifyFile,statFile,path);
r=TheFs.RmDir(path);
- test_KErrNone(r);
+ test(r==KErrNone);
User::WaitForAnyRequest();
test (statEntry==KErrNone);
test(statFile==KRequestPending);
test(statDir==KErrNone);
result=TheFs.RmDir(_L("C:\\SILLY\\SILLIER\\SILLIEST\\"));
- test_Value(result, (result == KErrNone)||(result==KErrAlreadyExists));
+ test((result==KErrNone)||(result==KErrAlreadyExists));
result=TheFs.RmDir(_L("C:\\SILLY\\SILLIER\\"));
- test_Value(result, (result == KErrNone)||(result==KErrAlreadyExists));
+ test((result==KErrNone)||(result==KErrAlreadyExists));
result=TheFs.RmDir(_L("C:\\SILLY\\"));
- test_Value(result, (result == KErrNone)||(result==KErrAlreadyExists));
+ test((result==KErrNone)||(result==KErrAlreadyExists));
}
#endif
@@ -499,7 +498,7 @@
test.Start(_L("Testing filesystem"));
TInt r=TheNotifyFs.Connect();
- test_KErrNone(r);
+ test(r==KErrNone);
TFileName sessionPath;
TInt uid;
test(HAL::Get(HAL::EMachineUid,uid)==KErrNone);
@@ -512,7 +511,7 @@
#if !defined(__WINS__)
// MARM TESTS
r=TheFs.MkDir(_L("C:\\F32-TST\\"));
- test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+ test((r==KErrNone)||(r==KErrAlreadyExists));
if(KErrNone == TheFs.DriveList(drvList))
{
@@ -544,7 +543,7 @@
}
r=RFs::DriveToChar(RemovableDrive,driveChar);
- test_KErrNone(r);
+ test(r==KErrNone);
if(gDriveToTest == 'C')
dirBuf[0] = (TText)driveChar;
@@ -559,12 +558,12 @@
//test.Getch();
r=TheFs.MkDir(dirBuf);
}
- test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+ test((r==KErrNone)||(r==KErrAlreadyExists));
// Set the notification session path to the test directory on C drive
sessionPath=_L("C:\\F32-TST\\");
r=TheNotifyFs.SetSessionPath(sessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
// Run tests
TRAP(r,DoTests());
if (r!=KErrNone)
@@ -580,9 +579,9 @@
r=TheNotifyFs.SetSessionPath(sessionPath);
- test_KErrNone(r);
+ test(r==KErrNone);
- test_KErrNone(r);
+ test(r==KErrNone);
TRAP(r,DoTests());
if (r!=KErrNone)
test.Printf(_L("Error: %d\n"),r);
@@ -590,12 +589,12 @@
CheckDisk();
#elif defined (__WINS__)
r=TheFs.MkDir(_L("X:\\F32-TST\\"));
- test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+ test((r==KErrNone)||(r==KErrAlreadyExists));
r=TheFs.MkDir(_L("Y:\\F32-TST\\"));
- test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+ test((r==KErrNone)||(r==KErrAlreadyExists));
// Set session path to test directory on Y drive
r=TheNotifyFs.SetSessionPath(_L("Y:\\F32-TST\\"));
- test_KErrNone(r);
+ test(r==KErrNone);
TRAP(r,DoTests());
if (r!=KErrNone)
test.Printf(_L("Error: %d\n"),r);
@@ -605,7 +604,7 @@
//we have no X drive on eka2 yet
// Set session path to test directory on X drive
// r=TheNotifyFs.SetSessionPath(_L("X:\\F32-TST\\"));
-// test_KErrNone(r);
+// test(r==KErrNone);
// TRAP(r,DoTests());
if (r!=KErrNone)