contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/src/TestCntDataStoreExtn.cpp
branchRCL_3
changeset 24 8e7494275d3a
equal deleted inserted replaced
23:2bb96f4ecad8 24:8e7494275d3a
       
     1 /*
       
     2 * Copyright (c) 2002 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 "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: definition of dm constants/exported methods
       
    15 * 	This is part of remotemgmt_plat.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include<BADESCA.H>
       
    23 #include <Stiftestinterface.h>
       
    24 #include "TestCntDataStoreExtn.h"
       
    25 
       
    26 
       
    27 // ============================ MEMBER FUNCTIONS ===============================
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // CTestCntDataStoreExtn::CTestCntDataStoreExtn
       
    31 // C++ default constructor can NOT contain any code, that
       
    32 // might leave.
       
    33 // -----------------------------------------------------------------------------
       
    34 //
       
    35 CTestCntDataStoreExtn::CTestCntDataStoreExtn( 
       
    36     CTestModuleIf& aTestModuleIf ):
       
    37         CScriptBase( aTestModuleIf )
       
    38     {
       
    39     }
       
    40 
       
    41 // -----------------------------------------------------------------------------
       
    42 // CTestCntDataStoreExtn::ConstructL
       
    43 // Symbian 2nd phase constructor can leave.
       
    44 // -----------------------------------------------------------------------------
       
    45 //
       
    46 void CTestCntDataStoreExtn::ConstructL()
       
    47     {
       
    48     iLog = CStifLogger::NewL( KTestCntDataStoreExtnLogPath, 
       
    49             KTestCntDataStoreExtnLogFile,
       
    50                           CStifLogger::ETxt,
       
    51                           CStifLogger::EFile,
       
    52                           EFalse );
       
    53 
       
    54     iCntDataStoreExtension = CNsmlContactsDataStoreExtension::NewL( _L("symbian") );
       
    55     iEntryArray = new(ELeave) CArrayFixFlat<TUid>(4);
       
    56     }
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CTestCntDataStoreExtn::NewL
       
    60 // Two-phased constructor.
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 CTestCntDataStoreExtn* CTestCntDataStoreExtn::NewL( 
       
    64     CTestModuleIf& aTestModuleIf )
       
    65     {
       
    66     CTestCntDataStoreExtn* self = new (ELeave) CTestCntDataStoreExtn( aTestModuleIf );
       
    67 
       
    68     CleanupStack::PushL( self );
       
    69     self->ConstructL();
       
    70     CleanupStack::Pop( self );
       
    71 
       
    72     return self;
       
    73 
       
    74     }
       
    75 
       
    76 // Destructor
       
    77 CTestCntDataStoreExtn::~CTestCntDataStoreExtn()
       
    78     { 
       
    79 
       
    80     // Delete resources allocated from test methods
       
    81     Delete();
       
    82 
       
    83     // Delete logger
       
    84     delete iLog; 
       
    85     
       
    86     if( iEntryArray )
       
    87         {
       
    88         delete iEntryArray;
       
    89         iEntryArray = NULL;
       
    90         }
       
    91     
       
    92     if(iCntDataStoreExtension)
       
    93         {
       
    94         delete iCntDataStoreExtension;
       
    95         iCntDataStoreExtension = NULL;
       
    96         }
       
    97 
       
    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* ) CTestCntDataStoreExtn::NewL( aTestModuleIf );
       
   112 
       
   113     }
       
   114 
       
   115 
       
   116 //  End of File