First public contribution.
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.
21 #include <Stiftestinterface.h>
22 #include "tiostreams.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 // Ctiostreams::Ctiostreams
77 // C++ default constructor can NOT contain any code, that
79 // -----------------------------------------------------------------------------
81 Ctiostreams::Ctiostreams(
82 CTestModuleIf& aTestModuleIf ):
83 CScriptBase( aTestModuleIf )
87 // -----------------------------------------------------------------------------
88 // Ctiostreams::ConstructL
89 // Symbian 2nd phase constructor can leave.
90 // -----------------------------------------------------------------------------
92 void Ctiostreams::ConstructL()
94 iLog = CStifLogger::NewL( KtiostreamsLogPath,
99 SendTestModuleVersion();
102 // -----------------------------------------------------------------------------
104 // Two-phased constructor.
105 // -----------------------------------------------------------------------------
107 Ctiostreams* Ctiostreams::NewL(
108 CTestModuleIf& aTestModuleIf )
110 Ctiostreams* self = new (ELeave) Ctiostreams( aTestModuleIf );
112 CleanupStack::PushL( self );
121 Ctiostreams::~Ctiostreams()
124 // Delete resources allocated from test methods
132 // ========================== OTHER EXPORTED FUNCTIONS =========================
134 // -----------------------------------------------------------------------------
135 // LibEntryL is a polymorphic Dll entry point.
136 // Returns: CScriptBase: New CScriptBase derived object
137 // -----------------------------------------------------------------------------
139 EXPORT_C CScriptBase* LibEntryL(
140 CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
143 return ( CScriptBase* ) Ctiostreams::NewL( aTestModuleIf );
146 //-----------------------------------------------------------------------------
147 // Ctiostreams::SendTestClassVersion
148 // Method used to send version of test class
149 //-----------------------------------------------------------------------------
151 void Ctiostreams::SendTestModuleVersion()
153 TVersion moduleVersion;
154 moduleVersion.iMajor = TEST_MODULE_VERSION_MAJOR;
155 moduleVersion.iMinor = TEST_MODULE_VERSION_MINOR;
156 moduleVersion.iBuild = TEST_MODULE_VERSION_BUILD;
158 TFileName moduleName;
159 moduleName = _L("Ctiostreams.dll");
162 TBool newVersionOfMethod = ETrue;
163 CTestModuleIf &test=TestModuleIf();
164 test.SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
165 test.SetBehavior(CTestModuleIf::ETestLeaksHandles);