diff -r ef2a444a7410 -r b3a1d9898418 kerneltest/f32test/server/t_fsrv.cpp --- a/kerneltest/f32test/server/t_fsrv.cpp Mon May 03 13:47:38 2010 +0300 +++ b/kerneltest/f32test/server/t_fsrv.cpp Fri May 14 17:13:29 2010 +0300 @@ -99,9 +99,9 @@ test.Start(_L("Path test thread")); RFs f; TInt r=f.Connect(); - test(r==KErrNone); + test_KErrNone(r); r=f.SessionPath(tPath); - test(r==KErrNone); + test_KErrNone(r); f.Close(); return(KErrNone); @@ -209,59 +209,55 @@ test.Printf(_L("Dismounting the Remote Drive returned %d\n"),r); - test(r==KErrNone ); + test_Value(r, r == KErrNone ); } LOCAL_C void CreateSubstDrive() { - test.Printf(_L("Create Substitute Drive \n")); - - TDriveList driveList; - TInt i ; - - TInt r=TheFs.SessionPath(gTestSessionPath); - test(r==KErrNone); + test.Printf(_L("Create Substitute Drive \n")); + + TDriveList driveList; + + TInt r=TheFs.SessionPath(gTestSessionPath); + test_KErrNone(r); r=TheFs.DriveList(driveList, KDriveAttExclude|KDriveAttLocal); - test( r==KErrNone ); + test_KErrNone(r); - for ( i = EDriveO; i < KMaxDrives; i++) - { - - if ( driveList[i] == 0) - { - if (i == EDriveQ) continue; // Q reserved to mount a virtual Remote Drive, as part of the test. - substDrive = i; - break; - } - } - - + for (TInt i = EDriveO; i < KMaxDrives; i++) + { + if (driveList[i] == 0) + { + if (i == EDriveQ) + continue; // Q reserved to mount a virtual Remote Drive, as part of the test. + substDrive = i; + break; + } + } + if (substDrive) { TDriveInfo driveInfo; r=TheFs.Drive(driveInfo,substDrive); - test(r==KErrNone); + test_KErrNone(r); if (driveInfo.iDriveAtt==KDriveAttLocal) - { + { return; // Subst local drives fails } TFileName n; r=TheFs.Subst(n,substDrive); - test(r==KErrNone); - test(n.Length()==0); + test_KErrNone(r); + test_Value(n.Length(), n.Length() == 0); r=TheFs.SetSubst(gTestSessionPath,substDrive); - test(r==KErrNone); + test_KErrNone(r); r=TheFs.Subst(n,substDrive); - test(r==KErrNone); - test(n==gTestSessionPath); + test_KErrNone(r); + test(n==gTestSessionPath); } - - } @@ -269,9 +265,9 @@ { if( substDrive) { - test.Printf(_L("Removing Substitute Drive \n")); - TInt r =TheFs.SetSubst(_L(""),substDrive); - test(r ==KErrNone); + test.Printf(_L("Removing Substitute Drive \n")); + TInt r =TheFs.SetSubst(_L(""),substDrive); + test_KErrNone(r); } } @@ -284,16 +280,16 @@ // { - test(anInfo.iConnectionBusType==EConnectionBusInternal || anInfo.iConnectionBusType==EConnectionBusUsb); + test_Value(anInfo.iConnectionBusType, anInfo.iConnectionBusType==EConnectionBusInternal || anInfo.iConnectionBusType==EConnectionBusUsb); if (aDrive==EDriveZ) { if (anInfo.iType==EMediaNotPresent) return; - test(anInfo.iMediaAtt==KMediaAttWriteProtected); - test(anInfo.iDriveAtt==(KDriveAttRom|KDriveAttInternal)); - test(anInfo.iType==EMediaRom); + test_Value(anInfo.iMediaAtt, anInfo.iMediaAtt==KMediaAttWriteProtected); + test_Value(anInfo.iDriveAtt, anInfo.iDriveAtt==(KDriveAttRom|KDriveAttInternal)); + test_Value(anInfo.iType, anInfo.iType==EMediaRom); } else if (GetDriveLFFS()==aDrive) @@ -301,9 +297,9 @@ if (anInfo.iType==EMediaNotPresent) return; - test(anInfo.iDriveAtt&(KDriveAttLocal|KDriveAttInternal)==KDriveAttLocal|KDriveAttInternal); // LFFS sets KDriveAttTransaction as well - test(anInfo.iType==EMediaFlash); - test(anInfo.iMediaAtt==KMediaAttFormattable); + test_Value(anInfo.iDriveAtt, anInfo.iDriveAtt&(KDriveAttLocal|KDriveAttInternal)==KDriveAttLocal|KDriveAttInternal); // LFFS sets KDriveAttTransaction as well + test_Value(anInfo.iType, anInfo.iType==EMediaFlash); + test_Value(anInfo.iMediaAtt, anInfo.iMediaAtt==KMediaAttFormattable); } /* Why assume certain drive letters can only refer to certain drive types? @@ -381,17 +377,17 @@ test.Printf(_L("Test existing DriveList \n")); err = TheFs.DriveList(driveList); - test( err == KErrNone ); + test_KErrNone(err); for ( i = 0; i < KMaxDrives; i++) { if (driveList[i]) { err = TheFs.Drive(info, i); - test( err == KErrNone ); - test( info.iType != EMediaRemote ); - test( !(info.iDriveAtt & KDriveAttRemote ) ); - test( !(info.iDriveAtt & KDriveAttHidden ) ); + test_KErrNone(err); + test_Value(info.iType, info.iType != EMediaRemote); + test_Value(info.iDriveAtt, !(info.iDriveAtt & KDriveAttRemote)); + test_Value(info.iDriveAtt, !(info.iDriveAtt & KDriveAttHidden)); drivecount++; if( info.iDriveAtt & KDriveAttRemovable) @@ -430,13 +426,13 @@ flags = KDriveAttAll; err = TheFs.DriveList(driveList, flags); - test( err == KErrNone ); + test_KErrNone(err); for ( i = 0; i < KMaxDrives; i++) { if (driveList[i]) { err = TheFs.Drive(info,i); - test( err == KErrNone ); + test_KErrNone(err); allDrivecount++; if( info.iDriveAtt & KDriveAttSubsted ) @@ -462,9 +458,6 @@ } } - test(allDrivecount == drivecount + hiddenOrRemoteDriveCount); - test(hiddenOrRemoteDriveCount - hiddenDriveCount == 1); - test.Printf(_L("Found %d substitute drives\n"), substDriveCount); test.Printf(_L("Found %d exclusively substitute drives \n"),exclusiveSubstDriveCount); test.Printf(_L("Found %d hidden drives\n"), hiddenDriveCount); @@ -475,6 +468,9 @@ test.Printf(_L("Found %d physically removable drives \n"),physicallyRemovable); test.Printf(_L("Found %d logically removable drives \n"),logicallyRemovableDriveCount); + test(allDrivecount == drivecount + hiddenOrRemoteDriveCount); + test(hiddenOrRemoteDriveCount - hiddenDriveCount == 1); + //--------------------------------------------- //! @SYMTestCaseID PBASE-T_FSRV-0546 @@ -495,22 +491,22 @@ flags = KDriveAttRemovable; err = TheFs.DriveList(driveList, flags); - test( err == KErrNone ); + test_KErrNone(err); for ( i = 0; i < KMaxDrives; i++) { if (driveList[i]) { err = TheFs.Drive(info, i); - test( err == KErrNone ); - test( info.iDriveAtt & KDriveAttRemovable ); - drivecount++; + test_KErrNone(err); + test_Value(info.iDriveAtt, info.iDriveAtt & KDriveAttRemovable); + drivecount++; printDriveAtt(i,info.iDriveAtt); } } - test( drivecount == removableDriveCount ); // no removable drive was added + test_Value(drivecount, drivecount == removableDriveCount); // no removable drive was added //--------------------------------------------- @@ -531,14 +527,14 @@ drivecount = 0; flags = KDriveAttRemovable | KDriveAttRemote; err = TheFs.DriveList(driveList, flags); - test( err == KErrNone ); + test_KErrNone(err); for ( i = 0; i < KMaxDrives; i++) { if (driveList[i]) { err = TheFs.Drive(info, i); - test( err == KErrNone ); - test( (info.iDriveAtt & KDriveAttRemovable ) || (info.iDriveAtt & KDriveAttRemote)); + test_KErrNone(err); + test_Value(info.iDriveAtt, (info.iDriveAtt & KDriveAttRemovable ) || (info.iDriveAtt & KDriveAttRemote)); drivecount++; printDriveAtt(i,info.iDriveAtt); @@ -546,7 +542,7 @@ } } - test( drivecount == removableDriveCount + 1 ); //contains the remote drive we mounted + test_Value(drivecount, drivecount == removableDriveCount + 1 ); //contains the remote drive we mounted //--------------------------------------------- @@ -568,21 +564,21 @@ flags = KDriveAttExclusive | KDriveAttRemote; TUint match = KDriveAttRemote; err = TheFs.DriveList(driveList, flags); - test( err == KErrNone ); + test_KErrNone(err); for ( i = 0; i < KMaxDrives; i++) { if (driveList[i]) { err = TheFs.Drive(info, i); - test( err == KErrNone ); - test( (info.iDriveAtt == match)); + test_KErrNone(err); + test_Value(info.iDriveAtt, (info.iDriveAtt == match)); drivecount++; printDriveAtt(i,info.iDriveAtt); } } - test( drivecount == 1 ); //The remote drive we mounted. + test_Value(drivecount, drivecount == 1); //The remote drive we mounted. //--------------------------------------------- @@ -603,22 +599,22 @@ drivecount = 0; flags = KDriveAttExclude | KDriveAttRemovable; err = TheFs.DriveList(driveList, flags); - test( err == KErrNone ); + test_KErrNone(err); for (i = 0; i < KMaxDrives; i++) { if (driveList[i]) { err = TheFs.Drive(info, i); - test( err == KErrNone ); - test( (!(info.iDriveAtt & KDriveAttRemovable ) )); + test_KErrNone(err); + test_Value(info.iDriveAtt, (!(info.iDriveAtt & KDriveAttRemovable ) )); drivecount++; printDriveAtt(i,info.iDriveAtt); } } - test ( drivecount == allDrivecount - removableDriveCount); - test ( drivecount == nonRemovables + hiddenDriveCount + 1) ; //The remote drive we added is non removable + test_Value(drivecount, drivecount == allDrivecount - removableDriveCount); + test_Value (drivecount, drivecount == nonRemovables + hiddenDriveCount + 1) ; //The remote drive we added is non removable @@ -643,21 +639,21 @@ flags = KDriveAttExclude | KDriveAttRemovable | KDriveAttRemote; err = TheFs.DriveList(driveList, flags); - test( err == KErrNone ); + test_KErrNone(err); for ( i = 0; i < KMaxDrives; i++) { if (driveList[i]) { err = TheFs.Drive(info,i); - test( err == KErrNone ); - test( (!(info.iDriveAtt & KDriveAttRemovable ) && (!(info.iDriveAtt & KDriveAttRemote )))); + test_KErrNone(err); + test_Value(info.iDriveAtt, (!(info.iDriveAtt & KDriveAttRemovable ) && (!(info.iDriveAtt & KDriveAttRemote )))); drivecount++; printDriveAtt(i,info.iDriveAtt); } } - test(drivecount == (allDrivecount - removableDriveCount - 1) ); // also excluding the removables and the remote drive + test_Value(drivecount, drivecount == (allDrivecount - removableDriveCount - 1) ); // also excluding the removables and the remote drive @@ -687,21 +683,21 @@ flags = KDriveAttExclude | KDriveAttRemote | KDriveAttSubsted; err = TheFs.DriveList(driveList, flags); - test( err == KErrNone ); + test_KErrNone(err); for ( i = 0; i < KMaxDrives; i++) { if (driveList[i]) { err = TheFs.Drive(info,i); - test( err == KErrNone ); - test( (!(info.iDriveAtt & KDriveAttRemote ) && (!(info.iDriveAtt & KDriveAttSubsted )))); + test_KErrNone(err); + test_Value(info.iDriveAtt, (!(info.iDriveAtt & KDriveAttRemote ) && (!(info.iDriveAtt & KDriveAttSubsted )))); drivecount++; printDriveAtt(i,info.iDriveAtt); } } - test(drivecount == (allDrivecount - substDriveCount- 1) ); + test_Value(drivecount, drivecount == (allDrivecount - substDriveCount- 1) ); @@ -711,15 +707,15 @@ flags = KDriveAttExclusive | KDriveAttExclude | KDriveAttSubsted; err = TheFs.DriveList(driveList, flags); - test( err == KErrNone ); + test_KErrNone(err); for ( i = 0; i < KMaxDrives; i++) { if (driveList[i]) { err = TheFs.Drive(info,i); - test( err == KErrNone ); - test( info.iDriveAtt != KDriveAttSubsted ); + test_KErrNone(err); + test_Value(info.iDriveAtt, info.iDriveAtt != KDriveAttSubsted); drivecount++; printDriveAtt(i,info.iDriveAtt); @@ -727,7 +723,7 @@ } - test(drivecount == (allDrivecount - exclusiveSubstDriveCount) ); + test_Value(drivecount, drivecount == (allDrivecount - exclusiveSubstDriveCount) ); } @@ -767,14 +763,14 @@ TDriveList fullDriveList; err = TheFs.DriveList(fullDriveList, KDriveAttAll); - test( err == KErrNone ); + test_KErrNone(err); for ( i = 0; i < KMaxDrives; i++) { if (driveList[i]) { err = TheFs.Drive(info,i); - test( err == KErrNone ); + test_KErrNone(err); printDriveAtt(i,info.iDriveAtt); } } @@ -794,14 +790,14 @@ //test.Printf(_L("Expected Result : %d \n"), testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts); //test.Printf(_L(" Actual Result : 0x%08x \n"), err); - test( err == (testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts) ); + test_Value(err, err == (testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts)); if(err == KErrNone) { //printDriveAtt(0, testAtt); //Prints attributes for ( i = 0; i < KMaxDrives; i++) { - TBool expectMatch = EFalse; + TBool expectMatch = EFalse; switch(testCombinations[matchIdx].iMatchMask) { @@ -813,11 +809,11 @@ expectMatch = ETrue; break; - case KDriveAttExclude : + case KDriveAttExclude: expectMatch = (fullDriveList[i] & testAtt) == 0; break; - case KDriveAttExclusive : + case KDriveAttExclusive: expectMatch = (fullDriveList[i] == testAtt); break; @@ -825,20 +821,14 @@ expectMatch = (fullDriveList[i] != testAtt); break; - case KDriveAttAll | KDriveAttExclude : - test(0); // Invalid - should never get here as this returns KErrArgument for all cases - break; - - case KDriveAttAll | KDriveAttExclusive : - test(0); // Invalid - should never get here as this returns KErrArgument for all cases - break; - - case KDriveAttAll | KDriveAttExclude | KDriveAttExclusive : - test(0); // Invalid - should never get here as this returns KErrArgument for all cases - break; - + case KDriveAttAll | KDriveAttExclude: + // Invalid - should never get here as this returns KErrArgument for all cases + case KDriveAttAll | KDriveAttExclusive: + // Invalid - should never get here as this returns KErrArgument for all cases + case KDriveAttAll | KDriveAttExclude | KDriveAttExclusive: + // Invalid - should never get here as this returns KErrArgument for all cases default: - test.Printf(_L("Unexpected Match Mask %08x"), testCombinations[matchIdx].iMatchMask); + test.Printf(_L("Unexpected or invalid Match Mask %08x"), testCombinations[matchIdx].iMatchMask); test(0); break; } @@ -846,7 +836,7 @@ if(expectMatch) { //test.Printf(_L(" %c MATCHED OK "), 'A' + i); - test(newDriveList[i] == fullDriveList[i]); + test_Value(newDriveList[i], newDriveList[i] == fullDriveList[i]); } else { @@ -859,7 +849,7 @@ test.Printf(_L(" %c NOT MATCHED "), 'A' + i); } */ - test(newDriveList[i] == 0); + test_Value(newDriveList[i], newDriveList[i] == 0); } } } @@ -885,14 +875,14 @@ drivecount = 0; flags = KDriveAttLogicallyRemovable; err = TheFs.DriveList(driveList, flags); - test( err == KErrNone ); + test_KErrNone(err); for ( i = 0; i < KMaxDrives; i++) { if (driveList[i]) { err = TheFs.Drive(info, i); - test( err == KErrNone ); - test( info.iDriveAtt & KDriveAttLogicallyRemovable ); + test_KErrNone(err); + test_Value(info.iDriveAtt, info.iDriveAtt & KDriveAttLogicallyRemovable); drivecount++; printDriveAtt(i,info.iDriveAtt); @@ -900,8 +890,7 @@ } - test( drivecount == logicallyRemovableDriveCount ); // no logically removable drive was added - + test_Value(drivecount, drivecount == logicallyRemovableDriveCount); // no logically removable drive was added test.End(); } @@ -921,7 +910,7 @@ test.Start(_L("The drive info")); TDriveList list; TInt r=TheFs.DriveList(list); - test(r==KErrNone); + test_KErrNone(r); for (TInt i=0;idef"),driveNum); - test(r==KErrBadName); + test_Value(r, r == KErrBadName); r=TheFs.SetVolumeLabel(_L("ghi*jkl"),driveNum); - test(r==KErrBadName); + test_Value(r, r == KErrBadName); r=TheFs.SetVolumeLabel(_L("mno?pqr"),driveNum); - test(r==KErrBadName); + test_Value(r, r == KErrBadName); r=TheFs.SetVolumeLabel(_L("stu|vwx"),driveNum); - test(r==KErrBadName); + test_Value(r, r == KErrBadName); r=TheFs.SetVolumeLabel(_L("yz=50 && dateTime.Second()<=51); // Dos stores seconds %2 r=f.Modified(checkTime); - test(r==KErrNone); + test_KErrNone(r); dateTime=checkTime.DateTime(); + test.Printf(_L("T_FSRV.CPP last modified via RFile::Modified() %d/%d/%d %d:%d:%d.%-06d\n"),dateTime.Day()+1,dateTime.Month()+1,dateTime.Year(),dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond()); test(dateTime.Year()==1997); test(dateTime.Month()==EJanuary); test(dateTime.Day()==1); @@ -1503,9 +1501,10 @@ f.Close(); r=TheFs.Modified(_L("\\F32-TST\\TFSRV\\T_FSRV.CPP"),checkTime); - test(r==KErrNone); + test_KErrNone(r); dateTime=checkTime.DateTime(); + test.Printf(_L("T_FSRV.CPP last modified via RFs::Modified() %d/%d/%d %d:%d:%d.%-06d\n"),dateTime.Day()+1,dateTime.Month()+1,dateTime.Year(),dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond()); test(dateTime.Year()==1997); test(dateTime.Month()==EJanuary); test(dateTime.Day()==1); @@ -1529,23 +1528,27 @@ RFile file; TInt r=file.Open(TheFs, KFileName, 0 ); - if (r!=KErrNone) - { - test.Printf(_L("Error %d opening file %S\n"), r, &KFileName); - test(0); - } + test_KErrNone(r); TFileName fileName; // Check RFile::Name just retuns the file name, without path and drive r=file.Name(fileName); - test(r==KErrNone); - test(fileName==KFileName()); + test_KErrNone(r); + if (fileName != KFileName) + { + test.Printf(_L("%S\n"), &fileName); + test(0); + } // Check RFile::FullName returns the complete file name and path r=file.FullName(fileName); - test(r==KErrNone); - test(fileName.Mid(2)==KFileNameAndPath); // chop off drive letter + ':' + test_KErrNone(r); + if (fileName.Mid(2)!=KFileNameAndPath) // chop off drive letter + ':' + { + test.Printf(_L("%S\n"), &fileName); + test(0); + } file.Close(); @@ -1565,13 +1568,7 @@ TInt r=file.Replace(TheFs,fileName,EFileWrite); if (r==KErrDiskFull) return(r); - if (r!=KErrNone) - { - test.Printf(_L("ERROR:: Replace returned %d\n"),r); - test(0); - //test.Getch(); - return(KErrDiskFull); - } + test_KErrNone(r); if (!IsTestingLFFS()) r=file.SetSize(LargeFileSize); @@ -1588,14 +1585,7 @@ file.Close(); return(r); } - if (r!=KErrNone) - { - test.Printf(_L("ERROR:: SetSize/Write returned %d\n"),r); - test(0); - //test.Getch(); - file.Close(); - return(KErrDiskFull); - } + test_KErrNone(r); file.Close(); // r=TheFs.CheckDisk(fileName); @@ -1618,12 +1608,12 @@ TBuf<128> fileName=aBaseName; fileName.AppendNum(aX); TInt r=TheFs.Delete(fileName); - test(r==KErrNone); + test_KErrNone(r); // r=TheFs.CheckDisk(fileName); // if (r!=KErrNone && r!=KErrNotSupported) // { // test.Printf(_L("ERROR:: CheckDisk returned %d\n"),r); -// test(r==KErrNone); +// test_KErrNone(r); // } test.Printf(_L("Deleted File %d\n"),aX); return(KErrNone); @@ -1637,43 +1627,37 @@ test.Start(_L("Create and delete large files")); TInt r=TheFs.MkDirAll(_L("\\F32-TST\\SMALLDIRECTORY\\")); - test(r==KErrNone || r==KErrAlreadyExists); + test_Value(r, r == KErrNone || r==KErrAlreadyExists); TBuf<128> fileName=_L("\\F32-TST\\SMALLDIRECTORY\\FILE"); r=CreateFileX(fileName,0); - test(r==KErrNone); + test_KErrNone(r); r=CreateFileX(fileName,1); - test(r==KErrNone); + test_KErrNone(r); r=DeleteFileX(fileName,0); - test(r==KErrNone); + test_KErrNone(r); r=CreateFileX(fileName,2); - test(r==KErrNone); + test_KErrNone(r); r=CreateFileX(fileName,1); - test(r==KErrNone); + test_KErrNone(r); r=CreateFileX(fileName,3); - test(r==KErrNone); + test_KErrNone(r); r=DeleteFileX(fileName,1); - test(r==KErrNone); + test_KErrNone(r); r=CreateFileX(fileName,4); - test(r==KErrNone); + test_KErrNone(r); r=DeleteFileX(fileName,2); - test(r==KErrNone); + test_KErrNone(r); r=DeleteFileX(fileName,3); - test(r==KErrNone); + test_KErrNone(r); r=DeleteFileX(fileName,4); - test(r==KErrNone); + test_KErrNone(r); r=CreateFileX(fileName,1); - test(r==KErrNone); + test_KErrNone(r); r=DeleteFileX(fileName,1); - test(r==KErrNone); + test_KErrNone(r); r=TheFs.CheckDisk(fileName); - if (r!=KErrNone && r!=KErrNotSupported) - { - test.Printf(_L("ERROR:: CheckDisk returned %d\n"),r); - test(0); - //test.Getch(); - } - + test_Value(r, r == KErrNone || r == KErrNotSupported); test.End(); } @@ -1685,18 +1669,18 @@ test.Start(_L("Fill disk to capacity")); TInt r=TheFs.MkDirAll(_L("\\F32-TST\\BIGDIRECTORY\\")); - test(r==KErrNone || r==KErrAlreadyExists); + test_Value(r, r == KErrNone || r==KErrAlreadyExists); TInt count=0; TFileName sessionPath; r=TheFs.SessionPath(sessionPath); - test(r==KErrNone); + test_KErrNone(r); TBuf<128> fileName=_L("\\F32-TST\\BIGDIRECTORY\\FILE"); FOREVER { TInt r=CreateFileX(fileName,count); if (r==KErrDiskFull) break; - test(r==KErrNone); + test_KErrNone(r); count++; #if defined(__WINS__) if (count==32 && sessionPath[0]=='C') @@ -1705,23 +1689,13 @@ } r=TheFs.CheckDisk(fileName); - if (r!=KErrNone && r!=KErrNotSupported) - { - test.Printf(_L("ERROR:: CheckDisk returned %d\n"),r); - test(0); - //test.Getch(); - } + test_Value(r, r == KErrNone || r == KErrNotSupported); while(count--) DeleteFileX(fileName,count); r=TheFs.CheckDisk(fileName); - if (r!=KErrNone && r!=KErrNotSupported) - { - test.Printf(_L("ERROR:: CheckDisk returned %d\n"),r); - test(0); - //test.Getch(); - } + test_Value(r, r == KErrNone || r == KErrNotSupported); test.End(); } @@ -1736,31 +1710,31 @@ fn[0] = gExeFileName[0]; TParse f; TInt r=TheFs.Parse(fn,f); - test(r==KErrNone); + test_KErrNone(r); test.Next(_L("Copying file to test directory")); TParse fCopy; r=TheFs.Parse(f.NameAndExt(),fCopy); - test(r==KErrNone); + test_KErrNone(r); RFile f1; r=f1.Open(TheFs,f.FullName(),EFileStreamText|EFileShareReadersOnly); - test(r==KErrNone); + test_KErrNone(r); RFile f2; r=f2.Replace(TheFs,fCopy.FullName(),EFileWrite); - test(r==KErrNone); + test_KErrNone(r); TBuf8<512> copyBuf; TInt rem; r=f1.Size(rem); - test(r==KErrNone); + test_KErrNone(r); TInt pos=0; while (rem) { TInt s=Min(rem,copyBuf.MaxSize()); r=f1.Read(pos,copyBuf,s); - test(r==KErrNone); - test(copyBuf.Length()==s); + test_KErrNone(r); + test_Value(copyBuf.Length(), copyBuf.Length() == s); r=f2.Write(pos,copyBuf,s); - test(r==KErrNone); + test_KErrNone(r); pos+=s; rem-=s; } @@ -1790,26 +1764,26 @@ //========== just create a file nRes = TheFs.SetErrorCondition(KMyError,0); //-- set up FS error simulation - test(nRes == KErrNone); + test_KErrNone(nRes); //-- this shall fail immediately nRes = file.Replace(TheFs, KFileName, EFileWrite); - test(nRes == KMyError); + test_Value(nRes, nRes == KMyError); nRes = TheFs.SetErrorCondition(KErrNone); //-- disable FS error simulation file.Close(); //========== create file & duplicate a handle #1 nRes = TheFs.SetErrorCondition(KMyError,1); //-- set up FS error simulation - test(nRes == KErrNone); + test_KErrNone(nRes); //-- this shall succeed nRes = file.Replace(TheFs, KFileName, EFileWrite); //-- err cnt -> 0 - test(nRes == KErrNone); + test_KErrNone(nRes); //-- this shall fail inside RFile::Duplicate() half way through in the RFile::DuplicateHandle() nRes = file1.Duplicate(file); - test(nRes == KMyError); + test_Value(nRes, nRes == KMyError); file1.Close(); nRes = TheFs.SetErrorCondition(KErrNone); //-- disable FS error simulation @@ -1817,19 +1791,19 @@ //-- check that the file isn't locked nRes = TheFs.Delete(KFileName); - test(nRes == KErrNone); + test_KErrNone(nRes); //========== create file & duplicate a handle #2 nRes = TheFs.SetErrorCondition(KMyError,2); //-- set up FS error simulation - test(nRes == KErrNone); + test_KErrNone(nRes); //-- this shall succeed nRes = file.Replace(TheFs, KFileName, EFileWrite); //-- err cnt -> 1 - test(nRes == KErrNone); + test_KErrNone(nRes); //-- this must not fail, because EFsFileAdopt is excluded from the erros simulation nRes = file1.Duplicate(file); - test(nRes == KErrNone); + test_KErrNone(nRes); file1.Close(); nRes = TheFs.SetErrorCondition(KErrNone); //-- disable FS error simulation @@ -1837,7 +1811,7 @@ //-- check that the file isn't locked nRes = TheFs.Delete(KFileName); - test(nRes == KErrNone); + test_KErrNone(nRes); //========== crazy loop, for DEF103757 @@ -1859,7 +1833,7 @@ //-- check that the file isn't locked nRes = TheFs.Delete(KFileName); - test(nRes == KErrNone); + test_KErrNone(nRes); #endif @@ -1877,14 +1851,14 @@ F32_Test_Utils::SetConsole(test.Console()); TInt nRes=TheFs.CharToDrive(gDriveToTest, gDrive); - test(nRes==KErrNone); + test_KErrNone(nRes); PrintDrvInfo(TheFs, gDrive); TVolumeInfo v; TInt r=TheFs.Volume(v, CurrentDrive()); - test(r==KErrNone); + test_KErrNone(r); LargeFileSize=Max((TUint32)I64LOW(v.iFree >> 7), (TUint32)65536u); if (gFirstTime)