author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 24 Nov 2009 08:56:33 +0200 | |
changeset 33 | 50974a8b132e |
parent 22 | fc9cf246af83 |
permissions | -rw-r--r-- |
19 | 1 |
/* |
2 |
* Copyright (c) 2002 - 2007 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 |
||
19 |
||
20 |
// INCLUDE FILES |
|
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
21 |
#include <StifTestInterface.h> |
19 | 22 |
#include "tmediaprovidertesting.h" |
23 |
#include <SettingServerClient.h> |
|
24 |
||
25 |
||
26 |
||
27 |
||
28 |
// ============================ MEMBER FUNCTIONS =============================== |
|
29 |
||
30 |
// ----------------------------------------------------------------------------- |
|
31 |
// Ctmediaprovidertesting::Ctmediaprovidertesting |
|
32 |
// C++ default constructor can NOT contain any code, that |
|
33 |
// might leave. |
|
34 |
// ----------------------------------------------------------------------------- |
|
35 |
// |
|
36 |
Ctmediaprovidertesting::Ctmediaprovidertesting( |
|
37 |
CTestModuleIf& aTestModuleIf ): |
|
38 |
CScriptBase(aTestModuleIf), |
|
39 |
iExpErrorCode(-1), |
|
40 |
iResult(-2), |
|
41 |
iInList(NULL), |
|
42 |
iOutList(NULL), |
|
43 |
iServicehandler(NULL), |
|
44 |
iIface(NULL), |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
45 |
iFiletype(EOtherFile), |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
46 |
iNumberApiCall(0) |
19 | 47 |
{ |
48 |
} |
|
49 |
||
50 |
// ----------------------------------------------------------------------------- |
|
51 |
// Ctmediaprovidertesting::ConstructL |
|
52 |
// Symbian 2nd phase constructor can leave. |
|
53 |
// ----------------------------------------------------------------------------- |
|
54 |
// |
|
55 |
void Ctmediaprovidertesting::ConstructL() |
|
56 |
{ |
|
57 |
//Read logger settings to check whether test case name is to be |
|
58 |
//appended to log file name. |
|
59 |
RSettingServer settingServer; |
|
60 |
TInt ret = settingServer.Connect(); |
|
61 |
if(ret != KErrNone) |
|
62 |
{ |
|
63 |
User::Leave(ret); |
|
64 |
} |
|
65 |
// Struct to StifLogger settigs. |
|
66 |
TLoggerSettings loggerSettings; |
|
67 |
// Parse StifLogger defaults from STIF initialization file. |
|
68 |
ret = settingServer.GetLoggerSettings(loggerSettings); |
|
69 |
if(ret != KErrNone) |
|
70 |
{ |
|
71 |
User::Leave(ret); |
|
72 |
} |
|
73 |
// Close Setting server session |
|
74 |
settingServer.Close(); |
|
75 |
||
76 |
TFileName logFileName; |
|
77 |
||
78 |
if(loggerSettings.iAddTestCaseTitle) |
|
79 |
{ |
|
80 |
TName title; |
|
81 |
TestModuleIf().GetTestCaseTitleL(title); |
|
82 |
logFileName.Format(KtmediaprovidertestingLogFileWithTitle, &title); |
|
83 |
} |
|
84 |
else |
|
85 |
{ |
|
86 |
logFileName.Copy(KtmediaprovidertestingLogFile); |
|
87 |
} |
|
88 |
||
89 |
iLog = CStifLogger::NewL( KtmediaprovidertestingLogPath, |
|
90 |
logFileName, |
|
91 |
CStifLogger::ETxt, |
|
92 |
CStifLogger::EFile, |
|
93 |
EFalse ); |
|
94 |
||
95 |
SendTestClassVersion(); |
|
96 |
} |
|
97 |
||
98 |
// ----------------------------------------------------------------------------- |
|
99 |
// Ctmediaprovidertesting::NewL |
|
100 |
// Two-phased constructor. |
|
101 |
// ----------------------------------------------------------------------------- |
|
102 |
// |
|
103 |
Ctmediaprovidertesting* Ctmediaprovidertesting::NewL( |
|
104 |
CTestModuleIf& aTestModuleIf ) |
|
105 |
{ |
|
106 |
Ctmediaprovidertesting* self = new (ELeave) Ctmediaprovidertesting( aTestModuleIf ); |
|
107 |
||
108 |
CleanupStack::PushL( self ); |
|
109 |
self->ConstructL(); |
|
110 |
CleanupStack::Pop(); |
|
111 |
||
112 |
return self; |
|
113 |
||
114 |
} |
|
115 |
||
116 |
// Destructor |
|
117 |
Ctmediaprovidertesting::~Ctmediaprovidertesting() |
|
118 |
{ |
|
119 |
||
120 |
// Delete resources allocated from test methods |
|
121 |
Delete(); |
|
122 |
// Delete logger |
|
123 |
delete iLog; |
|
124 |
||
125 |
} |
|
126 |
||
127 |
//----------------------------------------------------------------------------- |
|
128 |
// Ctmediaprovidertesting::SendTestClassVersion |
|
129 |
// Method used to send version of test class |
|
130 |
//----------------------------------------------------------------------------- |
|
131 |
// |
|
132 |
void Ctmediaprovidertesting::SendTestClassVersion() |
|
133 |
{ |
|
134 |
TVersion moduleVersion; |
|
135 |
moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; |
|
136 |
moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; |
|
137 |
moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; |
|
138 |
||
139 |
TFileName moduleName; |
|
140 |
moduleName = _L("tmediaprovidertesting.dll"); |
|
141 |
||
142 |
TBool newVersionOfMethod = ETrue; |
|
143 |
TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); |
|
144 |
} |
|
145 |
||
146 |
// ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
147 |
||
148 |
// ----------------------------------------------------------------------------- |
|
149 |
// LibEntryL is a polymorphic Dll entry point. |
|
150 |
// Returns: CScriptBase: New CScriptBase derived object |
|
151 |
// ----------------------------------------------------------------------------- |
|
152 |
// |
|
153 |
EXPORT_C CScriptBase* LibEntryL( |
|
154 |
CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework |
|
155 |
{ |
|
156 |
return ( CScriptBase* ) Ctmediaprovidertesting::NewL( aTestModuleIf ); |
|
157 |
} |
|
158 |
||
159 |
||
160 |
// End of File |