tsrc/VCXTestUtilModule/src/IptvTestUtilModule.cpp
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <Stiftestinterface.h>
       
    22 #include "IptvTestUtilModule.h"
       
    23 
       
    24 #include <commdb.h>
       
    25 
       
    26 #include "VCXTestCommon.h"
       
    27 
       
    28 // ============================ MEMBER FUNCTIONS ===============================
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CIptvTestUtilModule::CIptvTestUtilModule
       
    32 // C++ default constructor can NOT contain any code, that
       
    33 // might leave.
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 CIptvTestUtilModule::CIptvTestUtilModule(
       
    37     CTestModuleIf& aTestModuleIf ):
       
    38         CScriptBase( aTestModuleIf )
       
    39     {
       
    40     }
       
    41 
       
    42 // -----------------------------------------------------------------------------
       
    43 // CIptvTestUtilModule::ConstructL
       
    44 // Symbian 2nd phase constructor can leave.
       
    45 // -----------------------------------------------------------------------------
       
    46 //
       
    47 void CIptvTestUtilModule::ConstructL()
       
    48     {
       
    49     iLog = CStifLogger::NewL( KIptvTestUtilModuleLogPath,
       
    50                           KIptvTestUtilModuleLogFile,
       
    51                           CStifLogger::ETxt,
       
    52                           CStifLogger::EFile,
       
    53                           EFalse );
       
    54     User::LeaveIfError( iFs.Connect() );
       
    55     iTestCommon = CVCXTestCommon::NewL();
       
    56     TRAP_IGNORE( iTestCommon->DeleteDummyFilesL( EDriveC ) );
       
    57     TRAP_IGNORE( iTestCommon->DeleteDummyFilesL( EDriveE ) );
       
    58     TRAP_IGNORE( iTestCommon->DeleteDummyFilesL( EDriveF ) );
       
    59     TRAP_IGNORE( iTestCommon->DeleteDummyFilesL( EDriveG ) );
       
    60     
       
    61     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles );
       
    62     
       
    63     CStifItemParser* nullParser( NULL );
       
    64     CreateMobilecrashWatcherL( *nullParser );    
       
    65     }
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // CIptvTestUtilModule::NewL
       
    69 // Two-phased constructor.
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 CIptvTestUtilModule* CIptvTestUtilModule::NewL(
       
    73     CTestModuleIf& aTestModuleIf )
       
    74     {
       
    75     CIptvTestUtilModule* self = new (ELeave) CIptvTestUtilModule( aTestModuleIf );
       
    76 
       
    77     CleanupStack::PushL( self );
       
    78     self->ConstructL();
       
    79     CleanupStack::Pop();
       
    80 
       
    81     return self;
       
    82     }
       
    83 
       
    84 // Destructor
       
    85 CIptvTestUtilModule::~CIptvTestUtilModule()
       
    86     {
       
    87 
       
    88     // Delete resources allocated from test methods
       
    89     Delete();
       
    90 
       
    91     // Delete logger
       
    92     delete iLog;
       
    93 
       
    94     delete iTestCommon;
       
    95     iTestCommon = NULL;
       
    96 
       
    97     iFs.Close();
       
    98     }
       
    99 
       
   100 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   101 
       
   102 // -----------------------------------------------------------------------------
       
   103 // LibEntryL is a polymorphic Dll entry point.
       
   104 // Returns: CScriptBase: New CScriptBase derived object
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 EXPORT_C CScriptBase* LibEntryL(
       
   108     CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
       
   109     {
       
   110 
       
   111     return ( CScriptBase* ) CIptvTestUtilModule::NewL( aTestModuleIf );
       
   112 
       
   113     }
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 // E32Dll is a DLL entry point function.
       
   117 // Returns: KErrNone
       
   118 // -----------------------------------------------------------------------------
       
   119 //
       
   120 #ifndef EKA2 // Hide Dll entry point to EKA2
       
   121 GLDEF_C TInt E32Dll(
       
   122     TDllReason /*aReason*/) // Reason code
       
   123     {
       
   124     return(KErrNone);
       
   125 
       
   126     }
       
   127 #endif // EKA2
       
   128 
       
   129 //  End of File