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