|
1 /* |
|
2 * Copyright (c) 2005 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 "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: |
|
15 * ?description_line |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CPOSTP55_H |
|
21 #define CPOSTP55_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "FT_CLandmarkTestProcedureBase.h" |
|
25 |
|
26 // CLASS DECLARATION |
|
27 |
|
28 /** |
|
29 * Test procedure 55 |
|
30 */ |
|
31 class CPosTp55 : public CLandmarkTestProcedureBase, |
|
32 public MProgressObserver |
|
33 { |
|
34 public: // Constructors and destructor |
|
35 |
|
36 /** |
|
37 * C++ default constructor. |
|
38 */ |
|
39 CPosTp55() : CLandmarkTestProcedureBase(55) {}; |
|
40 |
|
41 /** |
|
42 * Destructor. |
|
43 */ |
|
44 ~CPosTp55() {}; |
|
45 |
|
46 public: // Functions from base classes |
|
47 |
|
48 /** |
|
49 * From CUtfwTestBase |
|
50 * Retrieves the test module name |
|
51 * @param aName The name of the test module. |
|
52 */ |
|
53 void GetName( |
|
54 TDes& aName |
|
55 ) const; |
|
56 |
|
57 /** |
|
58 * From CUtfwTestBase |
|
59 */ |
|
60 void CloseTest(); |
|
61 |
|
62 /** |
|
63 * From CUtfwTestBase |
|
64 */ |
|
65 void InitTestL(); |
|
66 |
|
67 /** |
|
68 * From CPosTestProcedureBase |
|
69 * Runs the test in the module |
|
70 */ |
|
71 void StartL(); |
|
72 |
|
73 /** |
|
74 * From MProgressObserver |
|
75 * Notifies the progress of the execution of a CPosLmOperation object. |
|
76 * |
|
77 * @param sProgress the progress of the operation |
|
78 */ |
|
79 void NotifyProgress(TReal aProgress); |
|
80 |
|
81 private: // New functions |
|
82 |
|
83 void TestCriticalLevelL(); |
|
84 |
|
85 void RecreateAndOpenFilesL(); |
|
86 |
|
87 void ExportLandmarksTestL(); |
|
88 |
|
89 void ImportLandmarksTestL(TBool aCriticalLevelPassed); |
|
90 |
|
91 void ConsumeDiskSpaceL(RFile& aFile, TInt aSizeLimit); |
|
92 |
|
93 /** |
|
94 * Imports landmarks from an XML file or a buffer to the database. |
|
95 * |
|
96 * @param aInputFile file to import from. KNullDesC if buffer is to be |
|
97 * used as target. |
|
98 * @param aInputBuffer buffer to import landmarks from. NULL if not used. |
|
99 * @param aArrayOfIds to export when calling ExportLandmarksL(). NULL |
|
100 * if encoder is to be used stand-alone. |
|
101 * @param aExecuteIncrementally ETrue if CPosLmOperations should be |
|
102 * executed incrementally, EFalse if CPosLmOperations should be |
|
103 * synchronously. |
|
104 * @param aTestBeyondCriticalLevel ETrue if critical level is passed, EFalse otherwise |
|
105 */ |
|
106 void ImportLandmarksL( |
|
107 const TDesC& aInputFile, |
|
108 RArray<TUint>* aArrayOfIds, |
|
109 TBool aExecuteIncrementally, |
|
110 TBool aTestBeyondCriticalLevel); |
|
111 |
|
112 void InitiateCriticalLevelL(); |
|
113 |
|
114 void LogVolumeInfoL(); |
|
115 |
|
116 void DeleteFileL(const TDesC& aFile); |
|
117 |
|
118 void FillFile3L(); |
|
119 |
|
120 HBufC8* CreateInputBufferL(); |
|
121 |
|
122 void ReInitializeEncoderEtcL(); |
|
123 |
|
124 TInt ExecuteLmOperationL(TBool aExecuteIncrementally); |
|
125 |
|
126 void SetOutputBufferL(); |
|
127 |
|
128 void AddCollectionDataToEncoderL(); |
|
129 |
|
130 void AddLandmarksToEncoderL(TBool aAddAll); |
|
131 |
|
132 void ExportWithExportLandmarksMethodL( |
|
133 RArray<TPosLmItemId>& aArrayOfIds, |
|
134 TBool aExecuteIncrementally); |
|
135 |
|
136 void FinalizeEncoderL(TBool aExecuteIncrementally); |
|
137 |
|
138 void PopulateArrayL( |
|
139 RArray<TPosLmItemId>& aArray, |
|
140 TBool aDoAddAllLms); |
|
141 |
|
142 void CopyResourceFileL(const TDesC& aResourceFile = KNullDesC); |
|
143 |
|
144 void TryRestoreResourceFile(); |
|
145 |
|
146 private: // Data |
|
147 |
|
148 RFs iFileServer; |
|
149 RFile iFile1; |
|
150 RFile iFile2; |
|
151 RFile iFile3; |
|
152 RFile iXmlOutputFile; |
|
153 TInt iCriticalLevel; |
|
154 TInt iCriticalThreshold; |
|
155 TInt iSizeLimit1; |
|
156 TInt iSizeLimit2; |
|
157 TBuf<150> iMsg; |
|
158 TInt iProgress; |
|
159 |
|
160 CBufBase* iOutputBuffer; |
|
161 HBufC8* iInputBuffer; |
|
162 CPosLandmarkEncoder* iLandmarkEncoder; |
|
163 CPosLandmarkParser* iLandmarkParser; |
|
164 CPosLmOperation* iOperation; |
|
165 CActiveLmOperation* iOperationWrapper; |
|
166 }; |
|
167 |
|
168 #endif // CPOSTP55_H |
|
169 |
|
170 // End of File |