diff -r c1f20ce4abcf -r 3e88ff8f41d5 kerneltest/f32test/server/t_chkuid.cpp --- a/kerneltest/f32test/server/t_chkuid.cpp Tue Aug 31 16:34:26 2010 +0300 +++ b/kerneltest/f32test/server/t_chkuid.cpp Wed Sep 01 12:34:56 2010 +0100 @@ -15,7 +15,6 @@ // // -#define __E32TEST_EXTENSION__ #include #include #include "t_server.h" @@ -38,67 +37,67 @@ // Create \\gSessionPath\\UIDCHKNO.SHT - no uid, zero length RFile file; TInt r=file.Replace(TheFs,_L("UIDCHKNO.SHT"),EFileRead|EFileWrite); - test_KErrNone(r); + test(r==KErrNone); file.Close(); // Create \\gSessionPath\\UIDCHKNO.LNG - no uid, long length r=file.Replace(TheFs,_L("UIDCHKNO.LNG"),EFileRead|EFileWrite); - test_KErrNone(r); + test(r==KErrNone); r=file.Write(_L8("Hello World needs to be over 16 bytes")); file.Close(); // Create \\gSessionPath\\UIDCHK.BLG - with uid no data r=file.Replace(TheFs,_L("UIDCHK.BLG"),EFileRead|EFileWrite); - test_KErrNone(r); + test(r==KErrNone); TUidType uidType(TUid::Uid('U'),TUid::Uid('I'),TUid::Uid('D')); TCheckedUid checkedUid(uidType); TPtrC8 buf((TUint8*)&checkedUid,sizeof(TCheckedUid)); r=file.Write(buf); - test_KErrNone(r); + test(r==KErrNone); file.Close(); // Create \\gSessionPath\\UIDCHK.MSG - with uid and data r=file.Replace(TheFs,_L("UIDCHK.MSG"),EFileRead|EFileWrite); - test_KErrNone(r); + test(r==KErrNone); TUidType uidType2(TUid::Uid('X'),TUid::Uid('Y'),TUid::Uid('Z')); checkedUid.Set(uidType2); buf.Set((TUint8*)&checkedUid,sizeof(TCheckedUid)); r=file.Write(buf); - test_KErrNone(r); + test(r==KErrNone); r=file.Write(_L8("More file data")); - test_KErrNone(r); + test(r==KErrNone); file.Close(); // Create \\gSessionPath\\UIDCHK.DAT - uid stored only in the file r=file.Replace(TheFs,_L("UIDCHK.DAT"),EFileRead|EFileWrite); - test_KErrNone(r); + test(r==KErrNone); TUidType uidType3(TUid::Uid('D'),TUid::Uid('A'),TUid::Uid('T')); checkedUid.Set(uidType3); buf.Set((TUint8*)&checkedUid,sizeof(TCheckedUid)); r=file.Write(buf); - test_KErrNone(r); + test(r==KErrNone); r=file.Write(_L8("More file data")); - test_KErrNone(r); + test(r==KErrNone); file.Close(); // Create \\gSessionPath\\UIDCHK.PE - uid stored in WINS PE file header r=file.Replace(TheFs,_L("UIDWINS.PE"),EFileRead|EFileWrite); - test_KErrNone(r); + test(r==KErrNone); #if defined(__WINS__) if (!IsTestingLFFS()) { RFile fileSource; r=fileSource.Open(TheFs,_L("Z:\\TEST\\T_CHKUID.EXE"),EFileShareReadersOnly|EFileRead); - test_KErrNone(r); + test(r==KErrNone); TBuf8<0x100> buffer; do { r=fileSource.Read(buffer); - test_KErrNone(r); + test(r==KErrNone); r=file.Write(buffer); - test_KErrNone(r); + test(r==KErrNone); } while (buffer.Length()==buffer.MaxLength()); @@ -107,11 +106,11 @@ else { r=file.Write(_L8("Some zany stuff here!")); - test_KErrNone(r); + test(r==KErrNone); } #else r=file.Write(_L8("Some zany stuff here!")); - test_KErrNone(r); + test(r==KErrNone); #endif file.Close(); } @@ -126,7 +125,7 @@ CDir* dum=NULL; TInt r=TheFs.GetDir(_L("UID*"),KEntryAttAllowUid,ESortByName,dum); CDir& dir=*dum; - test_KErrNone(r); + test(r==KErrNone); TInt count=dir.Count(); test(count==6); @@ -181,7 +180,7 @@ CDir* dum=NULL; TInt r=TheFs.GetDir(_L("UID*"),0,ESortByName,dum); CDir& dir=*dum; - test_KErrNone(r); + test(r==KErrNone); TInt count=dir.Count(); test(count==6); @@ -220,35 +219,35 @@ test.Next(_L("Use RFs::EntryL() to check files")); TEntry entry; TInt r=TheFs.Entry(_L("UIDCHKNO.SHT"),entry); - test_KErrNone(r); + test(r==KErrNone); test(entry.iName==_L("UIDCHKNO.SHT")); test(entry.IsTypeValid()==EFalse); r=TheFs.Entry(_L("UIDCHKNO.LNG"),entry); - test_KErrNone(r); + test(r==KErrNone); test(entry.iName==_L("UIDCHKNO.LNG")); test(entry.IsTypeValid()==EFalse); r=TheFs.Entry(_L("UIDCHK.MSG"),entry); - test_KErrNone(r); + test(r==KErrNone); test(entry.iName==_L("UIDCHK.MSG")); test(entry.IsTypeValid()); test(entry.iType[0]==TUid::Uid('X') && entry.iType[1]==TUid::Uid('Y') && entry.iType[2]==TUid::Uid('Z')); r=TheFs.Entry(_L("UIDCHK.BLG"),entry); - test_KErrNone(r); + test(r==KErrNone); test(entry.iName==_L("UIDCHK.BLG")); test(entry.IsTypeValid()); test(entry.iType[0]==TUid::Uid('U') && entry.iType[1]==TUid::Uid('I') && entry.iType[2]==TUid::Uid('D')); r=TheFs.Entry(_L("UIDCHK.DAT"),entry); - test_KErrNone(r); + test(r==KErrNone); test(entry.iName==_L("UIDCHK.DAT")); test(entry.IsTypeValid()); test(entry.iType[0]==TUid::Uid('D') && entry.iType[1]==TUid::Uid('A') && entry.iType[2]==TUid::Uid('T')); r=TheFs.Entry(_L("UIDWINS.PE"),entry); - test_KErrNone(r); + test(r==KErrNone); test(entry.iName==_L("UIDWINS.PE")); #if defined(__WINS__) TFileName sessionPath; @@ -279,34 +278,34 @@ RFile f; TEntry entry; TInt r=f.Open(TheFs,_L("UIDCHK.DAT"),EFileShareExclusive|EFileRead); - test_KErrNone(r); + test(r==KErrNone); r=TheFs.Entry(_L("UIDCHK.DAT"),entry); - test_KErrNone(r); + test(r==KErrNone); test(entry.iName==_L("UIDCHK.DAT")); test(entry.IsTypeValid()); test(entry.iType[0]==TUid::Uid('D') && entry.iType[1]==TUid::Uid('A') && entry.iType[2]==TUid::Uid('T')); f.Close(); r=f.Open(TheFs,_L("UIDCHK.DAT"),EFileShareExclusive|EFileWrite); - test_KErrNone(r); + test(r==KErrNone); r=TheFs.Entry(_L("UIDCHK.DAT"),entry); - test_KErrNone(r); + test(r==KErrNone); test(entry.iName==_L("UIDCHK.DAT")); test(entry.IsTypeValid()); test(entry.iType[0]==TUid::Uid('D') && entry.iType[1]==TUid::Uid('A') && entry.iType[2]==TUid::Uid('T')); r=f.SetSize(256); - test_KErrNone(r); + test(r==KErrNone); TBuf8<16> des; r=TheFs.ReadFileSection(_L("UIDCHK.DAT"),0,des,16); - test_KErrNone(r); + test(r==KErrNone); f.Close(); r=f.Open(TheFs,_L("UIDCHK.DAT"),EFileShareReadersOnly|EFileRead); - test_KErrNone(r); + test(r==KErrNone); r=TheFs.Entry(_L("UIDCHK.DAT"),entry); - test_KErrNone(r); + test(r==KErrNone); test(entry.iName==_L("UIDCHK.DAT")); test(entry.IsTypeValid()); test(entry.iType[0]==TUid::Uid('D') && entry.iType[1]==TUid::Uid('A') && entry.iType[2]==TUid::Uid('T')); @@ -315,27 +314,27 @@ // EFileShareReadersOnly|EFileWrite is illegal r=f.Open(TheFs,_L("UIDCHK.DAT"),EFileShareAny|EFileRead); - test_KErrNone(r); + test(r==KErrNone); r=TheFs.Entry(_L("UIDCHK.DAT"),entry); - test_KErrNone(r); + test(r==KErrNone); test(entry.iName==_L("UIDCHK.DAT")); test(entry.IsTypeValid()); test(entry.iType[0]==TUid::Uid('D') && entry.iType[1]==TUid::Uid('A') && entry.iType[2]==TUid::Uid('T')); f.Close(); r=f.Open(TheFs,_L("UIDCHK.DAT"),EFileShareAny|EFileWrite); - test_KErrNone(r); + test(r==KErrNone); RFile secondFile; r=secondFile.Open(TheFs,_L("UIDCHK.DAT"),EFileShareAny|EFileWrite); - test_KErrNone(r); + test(r==KErrNone); RFile thirdFile; r=thirdFile.Open(TheFs,_L("UIDCHK.DAT"),EFileShareAny|EFileRead); - test_KErrNone(r); + test(r==KErrNone); r=TheFs.Entry(_L("UIDCHK.DAT"),entry); - test_KErrNone(r); + test(r==KErrNone); test(entry.iName==_L("UIDCHK.DAT")); test(entry.IsTypeValid()); test(entry.iType[0]==TUid::Uid('D') && entry.iType[1]==TUid::Uid('A') && entry.iType[2]==TUid::Uid('T')); @@ -344,10 +343,10 @@ thirdFile.Close(); r=f.Open(TheFs,_L("UIDWINS.PE"),EFileShareAny|EFileWrite); - test_KErrNone(r); + test(r==KErrNone); r=TheFs.Entry(_L("UIDWINS.PE"),entry); - test_KErrNone(r); + test(r==KErrNone); test(entry.iName==_L("UIDWINS.PE")); #if defined(__WINS__) TFileName sessionPath; @@ -380,7 +379,7 @@ test.Printf(_L("Error: Unable to open Z:\n")); return; } - test_KErrNone(r); + test(r==KErrNone); CDir& dir=*dum; TInt count=dir.Count(); if (count==0) @@ -414,7 +413,7 @@ TFileName sessionPath; TInt r=TheFs.SessionPath(sessionPath); - test_KErrNone(r); + test(r==KErrNone); TChar driveLetter=sessionPath[0]; b.Format(_L("Testing filesystem on %c:"),(TText)driveLetter); test.Next(b);