author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 24 Nov 2009 08:56:33 +0200 | |
changeset 33 | 50974a8b132e |
parent 19 | 989d2f495d90 |
permissions | -rw-r--r-- |
19 | 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 |
||
19 |
||
20 |
||
21 |
// INCLUDE FILES |
|
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
22 |
#include <StifTestInterface.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
23 |
#include "clmcategoriestest.h" |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
24 |
#include <EPos_CPosLandmarkDatabase.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
25 |
#include <EPos_CPosLmCategoryManager.h> |
19 | 26 |
|
27 |
||
28 |
// ============================ MEMBER FUNCTIONS =============================== |
|
29 |
||
30 |
// ----------------------------------------------------------------------------- |
|
31 |
// CClmcategoriestest::CClmcategoriestest |
|
32 |
// C++ default constructor can NOT contain any code, that |
|
33 |
// might leave. |
|
34 |
// ----------------------------------------------------------------------------- |
|
35 |
// |
|
36 |
CClmcategoriestest::CClmcategoriestest( |
|
37 |
CTestModuleIf& aTestModuleIf ): |
|
38 |
CScriptBase( aTestModuleIf ) |
|
39 |
{ |
|
40 |
} |
|
41 |
||
42 |
// ----------------------------------------------------------------------------- |
|
43 |
// CClmcategoriestest::ConstructL |
|
44 |
// Symbian 2nd phase constructor can leave. |
|
45 |
// ----------------------------------------------------------------------------- |
|
46 |
// |
|
47 |
void CClmcategoriestest::ConstructL() |
|
48 |
{ |
|
49 |
iLog = CStifLogger::NewL( KClmcategoriestestLogPath, |
|
50 |
KClmcategoriestestLogFile, |
|
51 |
CStifLogger::ETxt, |
|
52 |
CStifLogger::EFile, |
|
53 |
EFalse ); |
|
54 |
CleanupStack::PushL (iLog); |
|
55 |
||
56 |
iDatabaseManager = CPosLmDatabaseManager::NewL(); |
|
57 |
CleanupStack::PushL(iDatabaseManager); |
|
58 |
||
59 |
iDefaultLmHandle = CPosLandmarkDatabase::OpenL (); |
|
60 |
if (iDefaultLmHandle->IsInitializingNeeded()) |
|
61 |
ExecuteAndDeleteLD(iDefaultLmHandle->InitializeL()); |
|
62 |
||
63 |
iDefaultCategoryHandle = CPosLmCategoryManager::NewL(*iDefaultLmHandle); |
|
64 |
||
65 |
CleanupStack::Pop (iDatabaseManager); |
|
66 |
CleanupStack::Pop (iLog); |
|
67 |
} |
|
68 |
||
69 |
// ----------------------------------------------------------------------------- |
|
70 |
// CClmcategoriestest::NewL |
|
71 |
// Two-phased constructor. |
|
72 |
// ----------------------------------------------------------------------------- |
|
73 |
// |
|
74 |
CClmcategoriestest* CClmcategoriestest::NewL( |
|
75 |
CTestModuleIf& aTestModuleIf ) |
|
76 |
{ |
|
77 |
CClmcategoriestest* self = new (ELeave) CClmcategoriestest( aTestModuleIf ); |
|
78 |
||
79 |
CleanupStack::PushL( self ); |
|
80 |
self->ConstructL(); |
|
81 |
CleanupStack::Pop(); |
|
82 |
||
83 |
return self; |
|
84 |
||
85 |
} |
|
86 |
||
87 |
// Destructor |
|
88 |
CClmcategoriestest::~CClmcategoriestest() |
|
89 |
{ |
|
90 |
||
91 |
// Delete resources allocated from test methods |
|
92 |
Delete(); |
|
93 |
||
94 |
// Delete logger |
|
95 |
delete iLog; |
|
96 |
delete iDefaultCategoryHandle; |
|
97 |
delete iDatabaseManager; |
|
98 |
delete iDefaultLmHandle; |
|
99 |
||
100 |
ReleaseLandmarkResources (); |
|
101 |
} |
|
102 |
||
103 |
// ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
104 |
||
105 |
// ----------------------------------------------------------------------------- |
|
106 |
// LibEntryL is a polymorphic Dll entry point. |
|
107 |
// Returns: CScriptBase: New CScriptBase derived object |
|
108 |
// ----------------------------------------------------------------------------- |
|
109 |
// |
|
110 |
EXPORT_C CScriptBase* LibEntryL( |
|
111 |
CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework |
|
112 |
{ |
|
113 |
||
114 |
return ( CScriptBase* ) CClmcategoriestest::NewL( aTestModuleIf ); |
|
115 |
||
116 |
} |
|
117 |
||
118 |
// ----------------------------------------------------------------------------- |
|
119 |
// E32Dll is a DLL entry point function. |
|
120 |
// Returns: KErrNone |
|
121 |
// ----------------------------------------------------------------------------- |
|
122 |
// |
|
123 |
#ifndef EKA2 // Hide Dll entry point to EKA2 |
|
124 |
GLDEF_C TInt E32Dll( |
|
125 |
TDllReason /*aReason*/) // Reason code |
|
126 |
{ |
|
127 |
return(KErrNone); |
|
128 |
||
129 |
} |
|
130 |
#endif // EKA2 |
|
131 |
||
132 |
// End of File |