imstutils/xmppadapter/tsrc/xmppadapter_test/src/tstxmppadapter.cpp
branchRCL_3
changeset 29 9a48e301e94b
parent 0 5e5d6b214f4f
equal deleted inserted replaced
28:3104fc151679 29:9a48e301e94b
       
     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 "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:   tstxmppadapter.cpp
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <StifTestInterface.h>
       
    23 #include "tstxmppadapter.h"
       
    24 #include <e32cons.h>
       
    25 
       
    26 // ============================= LOCAL FUNCTIONS ===============================
       
    27 
       
    28 // -----------------------------------------------------------------------------
       
    29 // ?function_name ?description.
       
    30 // ?description
       
    31 // Returns: ?value_1: ?description
       
    32 //          ?value_n: ?description_line1
       
    33 //                    ?description_line2
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 /*
       
    37 ?type ?function_name(
       
    38     ?arg_type arg,  // ?description
       
    39     ?arg_type arg)  // ?description
       
    40     {
       
    41 
       
    42     ?code  // ?comment
       
    43 
       
    44     // ?comment
       
    45     ?code
       
    46     }
       
    47 */
       
    48 
       
    49 // ============================ MEMBER FUNCTIONS ===============================
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // CtstXmppAdapter::CtstXmppAdapter
       
    53 // C++ default constructor can NOT contain any code, that
       
    54 // might leave.
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57 CtstXmppAdapter::CtstXmppAdapter( 
       
    58     CTestModuleIf& aTestModuleIf ):
       
    59         CScriptBase( aTestModuleIf )
       
    60     {
       
    61     
       
    62     }
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CtstXmppAdapter::ConstructL
       
    66 // Symbian 2nd phase constructor can leave.
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 void CtstXmppAdapter::ConstructL()
       
    70     {
       
    71     iLog = CStifLogger::NewL( KtstXmppadapterLogPath, 
       
    72                           KtstxmppadapterLogFile,
       
    73                           CStifLogger::ETxt,
       
    74                           CStifLogger::EFile,
       
    75                           EFalse );
       
    76     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksMem );
       
    77    	TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksRequests  );
       
    78 	TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles   );
       
    79 
       
    80 
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CtstXmppAdapter::NewL
       
    85 // Two-phased constructor.
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 CtstXmppAdapter* CtstXmppAdapter::NewL( 
       
    89     CTestModuleIf& aTestModuleIf )
       
    90     {
       
    91     CtstXmppAdapter* self = new (ELeave) CtstXmppAdapter( aTestModuleIf );
       
    92 
       
    93     CleanupStack::PushL( self );
       
    94     self->ConstructL();
       
    95     CleanupStack::Pop();
       
    96 
       
    97     return self;
       
    98 
       
    99     }
       
   100 
       
   101 // Destructor
       
   102 CtstXmppAdapter::~CtstXmppAdapter()
       
   103     { 
       
   104 
       
   105     // Delete resources allocated from test methods
       
   106     Delete();
       
   107 
       
   108     // Delete logger
       
   109     delete iLog; 
       
   110 
       
   111     }
       
   112 
       
   113 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 // LibEntryL is a polymorphic Dll entry point.
       
   117 // Returns: CScriptBase: New CScriptBase derived object
       
   118 // -----------------------------------------------------------------------------
       
   119 //
       
   120 EXPORT_C CScriptBase* LibEntryL( 
       
   121     CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
       
   122     {
       
   123 
       
   124     return ( CScriptBase* ) CtstXmppAdapter::NewL( aTestModuleIf );
       
   125 
       
   126     }
       
   127 
       
   128 // -----------------------------------------------------------------------------
       
   129 // E32Dll is a DLL entry point function.
       
   130 // Returns: KErrNone
       
   131 // -----------------------------------------------------------------------------
       
   132 //
       
   133 #ifndef EKA2 // Hide Dll entry point to EKA2
       
   134 GLDEF_C TInt E32Dll(
       
   135     TDllReason /*aReason*/) // Reason code
       
   136     {
       
   137     return(KErrNone);
       
   138 
       
   139     }
       
   140 #endif // EKA2
       
   141 
       
   142 //  End of File