videoutils_plat/videoconnutility_api/tsrc/src/VCXConnUtilTest.cpp
branchRCL_3
changeset 48 13a33d82ad98
parent 0 822a42b6c3f1
equal deleted inserted replaced
47:826cea16efd9 48:13a33d82ad98
       
     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 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:   ?Description*
       
    15 */
       
    16 
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include <Stiftestinterface.h>
       
    20 #include "VCXConnUtilTest.h"
       
    21 #include <SettingServerClient.h>
       
    22 
       
    23 // ============================= LOCAL FUNCTIONS ===============================
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CVCXConnUtilTest::CVCXConnUtilTest
       
    29 // C++ default constructor can NOT contain any code, that
       
    30 // might leave.
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 CVCXConnUtilTest::CVCXConnUtilTest(
       
    34     CTestModuleIf& aTestModuleIf ):
       
    35         CScriptBase( aTestModuleIf )
       
    36     {
       
    37     }
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 // CVCXConnUtilTest::ConstructL
       
    41 // Symbian 2nd phase constructor can leave.
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 void CVCXConnUtilTest::ConstructL()
       
    45     {
       
    46     //Read logger settings to check whether test case name is to be
       
    47     //appended to log file name.
       
    48     RSettingServer settingServer;
       
    49     TInt ret = settingServer.Connect();
       
    50     if(ret != KErrNone)
       
    51         {
       
    52         User::Leave(ret);
       
    53         }
       
    54     // Struct to StifLogger settigs.
       
    55     TLoggerSettings loggerSettings;
       
    56     // Parse StifLogger defaults from STIF initialization file.
       
    57     ret = settingServer.GetLoggerSettings(loggerSettings);
       
    58     if(ret != KErrNone)
       
    59         {
       
    60         User::Leave(ret);
       
    61         }
       
    62     // Close Setting server session
       
    63     settingServer.Close();
       
    64 
       
    65     TFileName logFileName;
       
    66 
       
    67     if(loggerSettings.iAddTestCaseTitle)
       
    68         {
       
    69         TName title;
       
    70         TestModuleIf().GetTestCaseTitleL(title);
       
    71         logFileName.Format(KVCXConnUtilTestLogFileWithTitle, &title);
       
    72         }
       
    73     else
       
    74         {
       
    75         logFileName.Copy(KVCXConnUtilTestLogFile);
       
    76         }
       
    77 
       
    78     iLog = CStifLogger::NewL( KVCXConnUtilTestLogPath,
       
    79                           logFileName,
       
    80                           CStifLogger::ETxt,
       
    81                           CStifLogger::EFile,
       
    82                           EFalse );
       
    83 
       
    84     }
       
    85 
       
    86 // -----------------------------------------------------------------------------
       
    87 // CVCXConnUtilTest::NewL
       
    88 // Two-phased constructor.
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 CVCXConnUtilTest* CVCXConnUtilTest::NewL(
       
    92     CTestModuleIf& aTestModuleIf )
       
    93     {
       
    94     CVCXConnUtilTest* self = new (ELeave) CVCXConnUtilTest( aTestModuleIf );
       
    95 
       
    96     CleanupStack::PushL( self );
       
    97     self->ConstructL();
       
    98     CleanupStack::Pop( self );
       
    99 
       
   100     return self;
       
   101     }
       
   102 
       
   103 // Destructor
       
   104 CVCXConnUtilTest::~CVCXConnUtilTest()
       
   105     {
       
   106 
       
   107     // Delete resources allocated from test methods
       
   108     Delete();
       
   109 
       
   110     // Delete logger
       
   111     delete iLog;
       
   112 
       
   113     }
       
   114 
       
   115 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   116 
       
   117 // -----------------------------------------------------------------------------
       
   118 // LibEntryL is a polymorphic Dll entry point.
       
   119 // Returns: CScriptBase: New CScriptBase derived object
       
   120 // -----------------------------------------------------------------------------
       
   121 //
       
   122 EXPORT_C CScriptBase* LibEntryL(
       
   123     CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
       
   124     {
       
   125 
       
   126     return ( CScriptBase* ) CVCXConnUtilTest::NewL( aTestModuleIf );
       
   127 
       
   128     }
       
   129 
       
   130 
       
   131 //  End of File