|
1 /* |
|
2 * Copyright (c) 2004 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 CPOSTP43_H |
|
21 #define CPOSTP43_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "FT_CLandmarkTestProcedureBase.h" |
|
25 |
|
26 // CLASS DECLARATION |
|
27 class CPosLandmarkEncoder; |
|
28 class CPosLandmarkParser; |
|
29 |
|
30 /** |
|
31 * Test procedure 43 |
|
32 */ |
|
33 class CPosTp43 :public CLandmarkTestProcedureBase |
|
34 { |
|
35 public: // Constructors and destructor |
|
36 |
|
37 /** |
|
38 * C++ default constructor. |
|
39 */ |
|
40 |
|
41 CPosTp43(TInt tpno, CStifLogger* aLog) : CLandmarkTestProcedureBase(tpno, aLog) {iErrorsFound=KErrNone;}; |
|
42 /** |
|
43 * Destructor. |
|
44 */ |
|
45 ~CPosTp43() {}; |
|
46 |
|
47 public: // Functions from base classes |
|
48 |
|
49 void CloseTest(); |
|
50 |
|
51 /** |
|
52 * From CLandmarkTestProcedureBase |
|
53 * Runs the test in the module |
|
54 */ |
|
55 void StartL(); |
|
56 |
|
57 private: |
|
58 void TestErrorScenariosL(); |
|
59 |
|
60 /** |
|
61 * Test that CPosLandmarkEncoder::SetOutputFileL leaves with |
|
62 * KErrAlreadyExists if file already exists |
|
63 */ |
|
64 void ErrorScenario1L(); |
|
65 |
|
66 /** |
|
67 * Test that CPosLandmarkEncoder::SetOutputFileL is opened in exclusive mode |
|
68 */ |
|
69 void ErrorScenario2L(); |
|
70 |
|
71 /** |
|
72 * Test that CPosLandmarkEncoder::AddCollectionDataL leaves with KErrAlreadyExists if |
|
73 * collection ID is used twice (or more) |
|
74 */ |
|
75 void ErrorScenario3L(); |
|
76 |
|
77 /** |
|
78 * Test that it is not possible to set collection data "out-of-range" from TPosLmCollectionDataId |
|
79 * (will be silently ignored) |
|
80 * Test that it is possible to set collection meta data, |
|
81 * the data will however not be encoded to the XML file (silently ignored) |
|
82 */ |
|
83 void ErrorScenario4L(); |
|
84 |
|
85 /** |
|
86 * Test that it is possible to use XML tags as name/description/ etc |
|
87 * verify that they are correct enocded |
|
88 */ |
|
89 void ErrorScenario5L(); |
|
90 |
|
91 /** |
|
92 * Create all landmark items that should be encoded with the encoder |
|
93 */ |
|
94 void CreateEncoderPartsL(); |
|
95 |
|
96 |
|
97 /** |
|
98 * Check the data (XML) created by the eoncoder |
|
99 */ |
|
100 void ParseAndCheckDataFromEncoderL(const TDesC& aFile, const TDesC& aCollectionName, |
|
101 const TDesC& aCollectiondDescription ,const TDesC8& aBuffer); |
|
102 |
|
103 /** |
|
104 * Used for debugging |
|
105 */ |
|
106 void PrintParsedDataFromEncoderL(const TDesC& aFile, /*const TDesC& aCollectionName, |
|
107 const TDesC& aCollectiondDescription, */const TDesC8& aBuffer); |
|
108 |
|
109 void PrintLandmarkIdFieldsL(const CPosLandmark& aLandmark); |
|
110 |
|
111 /** |
|
112 * Test with long collection data field |
|
113 */ |
|
114 void TestLongCollectionFieldsL(TBool aUseFile); |
|
115 |
|
116 /** |
|
117 * Compare two files |
|
118 */ |
|
119 void CompareTwoFilesL(const TDesC16& aCorrectFile, const TDesC16& aFile); |
|
120 |
|
121 /** |
|
122 * Test with long filename as file output |
|
123 */ |
|
124 void TestWithLongFileNameL(); |
|
125 |
|
126 |
|
127 void SetupGlobalCategoriesL(); |
|
128 |
|
129 |
|
130 private: |
|
131 CPosLandmarkEncoder* iLandmarkEncoder; |
|
132 CPosLandmarkParser* iLandmarkParser; |
|
133 RPointerArray<CPosLandmark> iLandmarks; |
|
134 TInt iErrorsFound; |
|
135 RArray<TUint> iGlobalCategoryIds; |
|
136 RArray<TPtrC> iGlobalCategoryNames; |
|
137 RArray<TPtrC> iGlobalCategoryTestNames; |
|
138 |
|
139 |
|
140 }; |
|
141 |
|
142 #endif // CPOSTP43_H |
|
143 |
|
144 // End of File |