Update contrib.
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
20 #include <Stiftestinterface.h>
21 #include "BCException.h"
22 #include <SettingServerClient.h>
24 // EXTERNAL DATA STRUCTURES
25 //extern ?external_data;
27 // EXTERNAL FUNCTION PROTOTYPES
28 //extern ?external_function( ?arg_type,?arg_type );
31 //const ?type ?constant_var = ?constant;
34 //#define ?macro ?macro_def
36 // LOCAL CONSTANTS AND MACROS
37 //const ?type ?constant_var = ?constant;
38 //#define ?macro_name ?macro_def
40 // MODULE DATA STRUCTURES
42 //typedef ?declaration
44 // LOCAL FUNCTION PROTOTYPES
45 //?type ?function_name( ?arg_type, ?arg_type );
47 // FORWARD DECLARATIONS
48 //class ?FORWARD_CLASSNAME;
50 // ============================= LOCAL FUNCTIONS ===============================
52 // -----------------------------------------------------------------------------
53 // ?function_name ?description.
55 // Returns: ?value_1: ?description
56 // ?value_n: ?description_line1
58 // -----------------------------------------------------------------------------
62 ?arg_type arg, // ?description
63 ?arg_type arg) // ?description
73 // ============================ MEMBER FUNCTIONS ===============================
75 // -----------------------------------------------------------------------------
76 // CBCException::CBCException
77 // C++ default constructor can NOT contain any code, that
79 // -----------------------------------------------------------------------------
81 CBCException::CBCException(
82 CTestModuleIf& aTestModuleIf ):
83 CScriptBase( aTestModuleIf )
87 // -----------------------------------------------------------------------------
88 // CBCException::ConstructL
89 // Symbian 2nd phase constructor can leave.
90 // -----------------------------------------------------------------------------
92 void CBCException::ConstructL()
94 //Read logger settings to check whether test case name is to be
95 //appended to log file name.
96 RSettingServer settingServer;
97 TInt ret = settingServer.Connect();
102 // Struct to StifLogger settigs.
103 TLoggerSettings loggerSettings;
104 // Parse StifLogger defaults from STIF initialization file.
105 ret = settingServer.GetLoggerSettings(loggerSettings);
110 // Close Setting server session
111 settingServer.Close();
113 TFileName logFileName;
115 if(loggerSettings.iAddTestCaseTitle)
118 TestModuleIf().GetTestCaseTitleL(title);
119 logFileName.Format(KBCExceptionLogFileWithTitle, &title);
123 logFileName.Copy(KBCExceptionLogFile);
126 iLog = CStifLogger::NewL( KBCExceptionLogPath,
132 SendTestClassVersion();
135 // -----------------------------------------------------------------------------
136 // CBCException::NewL
137 // Two-phased constructor.
138 // -----------------------------------------------------------------------------
140 CBCException* CBCException::NewL(
141 CTestModuleIf& aTestModuleIf )
143 CBCException* self = new (ELeave) CBCException( aTestModuleIf );
145 CleanupStack::PushL( self );
154 CBCException::~CBCException()
157 // Delete resources allocated from test methods
165 //-----------------------------------------------------------------------------
166 // CBCException::SendTestClassVersion
167 // Method used to send version of test class
168 //-----------------------------------------------------------------------------
170 void CBCException::SendTestClassVersion()
172 TVersion moduleVersion;
173 moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
174 moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
175 moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
177 TFileName moduleName;
178 moduleName = _L("BCException.dll");
180 TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName);
183 // ========================== OTHER EXPORTED FUNCTIONS =========================
185 // -----------------------------------------------------------------------------
186 // LibEntryL is a polymorphic Dll entry point.
187 // Returns: CScriptBase: New CScriptBase derived object
188 // -----------------------------------------------------------------------------
190 EXPORT_C CScriptBase* LibEntryL(
191 CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
194 return ( CScriptBase* ) CBCException::NewL( aTestModuleIf );