kerneltest/f32test/filesystem/fat/t_scn32dr2.cpp
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
equal deleted inserted replaced
256:c1f20ce4abcf 257:3e88ff8f41d5
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 // f32test\filesystem\fat\t_scn32dr2.cpp
    14 // f32test\scndrv\t_scn32dr2.cpp
    15 //
    15 //
    16 
    16 //
    17 #define __E32TEST_EXTENSION__
       
    18 
    17 
    19 #include <f32file.h>
    18 #include <f32file.h>
    20 #include <e32test.h>
    19 #include <e32test.h>
    21 #include "t_server.h"
    20 #include "t_server.h"
    22 
    21 
    70     const TInt KWriteFailStd=-100; // error -100 returned from write fail
    69     const TInt KWriteFailStd=-100; // error -100 returned from write fail
    71 
    70 
    72     TInt gDriveNumber;
    71     TInt gDriveNumber;
    73 
    72 
    74     TInt r = TheFs.CharToDrive( gSessionPath[0], gDriveNumber );
    73     TInt r = TheFs.CharToDrive( gSessionPath[0], gDriveNumber );
    75     test_KErrNone(r);
    74     test( KErrNone == r );
    76 
    75 
    77     //-- set up console output
    76     //-- set up console output
    78     Fat_Test_Utils::SetConsole(test.Console());
    77     Fat_Test_Utils::SetConsole(test.Console());
    79 
    78 
    80     //-- print drive information
    79     //-- print drive information
    94 
    93 
    95     // ensure that fat filing system is rugged
    94     // ensure that fat filing system is rugged
    96     TUint8 oldFsys;
    95     TUint8 oldFsys;
    97     TPtr8 pRugged(&oldFsys,1,1);
    96     TPtr8 pRugged(&oldFsys,1,1);
    98     r=TheFs.ControlIo(gDriveNumber,KControlIoIsRugged,pRugged);
    97     r=TheFs.ControlIo(gDriveNumber,KControlIoIsRugged,pRugged);
    99     test_KErrNone(r);
    98     test(r==KErrNone);
   100     if(oldFsys==0)
    99     if(oldFsys==0)
   101         {
   100         {
   102         r=TheFs.ControlIo(gDriveNumber,KControlIoRuggedOn);
   101         r=TheFs.ControlIo(gDriveNumber,KControlIoRuggedOn);
   103         test_KErrNone(r);
   102         test(r==KErrNone);
   104         }
   103         }
   105     DoTests();
   104     DoTests();
   106     // if nec, set filing system back to !rugged
   105     // if nec, set filing system back to !rugged
   107     if(oldFsys==0)
   106     if(oldFsys==0)
   108         {
   107         {
   109         r=TheFs.ControlIo(gDriveNumber,KControlIoRuggedOff);
   108         r=TheFs.ControlIo(gDriveNumber,KControlIoRuggedOff);
   110         test_KErrNone(r);
   109         test(r==KErrNone);
   111         }
   110         }
   112 
   111 
   113     return;
   112     return;
   114 #endif
   113 #endif
   115     }
   114     }