kerneltest/f32test/shostmassstorage/msman/test/t_mssbcerr.cpp
changeset 300 1d28c8722707
parent 0 a41df078684a
equal deleted inserted replaced
293:0659d0e1a03c 300:1d28c8722707
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    26 
    26 
    27 #include "cblockdevicetester.h"
    27 #include "cblockdevicetester.h"
    28 #include "cmsdrive.h"
    28 #include "cmsdrive.h"
    29 #include "tmsprintdrive.h"
    29 #include "tmsprintdrive.h"
    30 #include "ttestutils.h"
    30 #include "ttestutils.h"
    31 #include "tmslog.h"
       
    32 
    31 
    33 extern CMsDrive* msDrive;
    32 extern CMsDrive* msDrive;
    34 
    33 
    35 RTest test(_L("T_MSSBCERR"));
    34 RTest test(_L("T_MSSBCERR"));
    36 RFs fsSession;
    35 RFs fsSession;
    55     };
    54     };
    56 
    55 
    57 
    56 
    58 CTestSbcErr* CTestSbcErr::NewL()
    57 CTestSbcErr* CTestSbcErr::NewL()
    59     {
    58     {
    60     __MSFNSLOG
    59     CTestSbcErr* r = new (ELeave) CTestSbcErr();
    61 	CTestSbcErr* r = new (ELeave) CTestSbcErr();
    60     CleanupStack::PushL(r);
    62 	CleanupStack::PushL(r);
       
    63 
    61 
    64 	r->ConstructL();
    62     r->ConstructL();
    65 	CleanupStack::Pop();
    63     CleanupStack::Pop();
    66 	return r;
    64     return r;
    67     }
    65     }
    68 
    66 
    69 
    67 
    70 void CTestSbcErr::ConstructL()
    68 void CTestSbcErr::ConstructL()
    71     {
    69     {
    72     __MSFNLOG
       
    73     TInt driveNumber = msDrive->DriveNumber();
    70     TInt driveNumber = msDrive->DriveNumber();
    74     iSbcErrTester = CSbcErrTester::NewL(driveNumber);
    71     iSbcErrTester = CSbcErrTester::NewL(driveNumber);
    75     }
    72     }
    76 
    73 
    77 
    74 
    78 CTestSbcErr::CTestSbcErr()
    75 CTestSbcErr::CTestSbcErr()
    79     {
    76     {
    80     __MSFNLOG
       
    81     }
    77     }
    82 
    78 
    83 
    79 
    84 
    80 
    85 CTestSbcErr::~CTestSbcErr()
    81 CTestSbcErr::~CTestSbcErr()
    86     {
    82     {
    87     __MSFNLOG
       
    88     delete iSbcErrTester;
    83     delete iSbcErrTester;
    89     }
    84     }
    90 
    85 
    91 
    86 
    92 void CTestSbcErr::tTest1()
    87 void CTestSbcErr::tTest1()
    93     {
    88     {
    94     __MSFNLOG
       
    95     TInt res;
    89     TInt res;
    96     test.Start(_L("tTest1\n"));
    90     test.Start(_L("tTest1\n"));
    97 
    91 
    98     // write a file
    92     // write a file
    99     res = iSbcErrTester->WriteTestFile();
    93     res = iSbcErrTester->WriteTestFile();
   107     }
   101     }
   108 
   102 
   109 
   103 
   110 void CTestSbcErr::tTest2()
   104 void CTestSbcErr::tTest2()
   111     {
   105     {
   112     __MSFNLOG
       
   113     TInt res;
   106     TInt res;
   114     test.Start(_L("tTest2\n"));
   107     test.Start(_L("tTest2\n"));
   115 
   108 
   116     // Configure client with SENSE ERROR condition
   109     // Configure client with SENSE ERROR condition
   117     test.Next(_L("Set SENSE ERROR to MEDIA NOT PRESENT"));
   110     test.Next(_L("Set SENSE ERROR to MEDIA NOT PRESENT"));
   136     }
   129     }
   137 
   130 
   138 
   131 
   139 void CTestSbcErr::tTest3()
   132 void CTestSbcErr::tTest3()
   140     {
   133     {
   141     __MSFNLOG
       
   142     TInt res;
   134     TInt res;
   143     test.Start(_L("tTest3\n"));
   135     test.Start(_L("tTest3\n"));
   144 
   136 
   145     // Configure client with SENSE ERROR condition
   137     // Configure client with SENSE ERROR condition
   146     test.Next(_L("Set SENSE ERROR to UNIT ATTENTION"));
   138     test.Next(_L("Set SENSE ERROR to UNIT ATTENTION"));