62 iEncoderBuffer = NULL; |
62 iEncoderBuffer = NULL; |
63 |
63 |
64 iLandmarks.ResetAndDestroy(); |
64 iLandmarks.ResetAndDestroy(); |
65 iLandmarks.Close(); |
65 iLandmarks.Close(); |
66 |
66 |
67 delete iDatabase; |
|
68 iDatabase=NULL; |
|
69 |
67 |
70 delete iLandmarkEncoder; |
68 delete iLandmarkEncoder; |
71 iLandmarkEncoder = NULL; |
69 iLandmarkEncoder = NULL; |
72 |
70 |
73 delete iLandmarkParser; |
71 delete iLandmarkParser; |
74 iLandmarkParser = NULL; |
72 iLandmarkParser = NULL; |
75 |
73 |
76 delete iOperation; |
74 delete iOperation; |
77 iOperation = NULL; |
75 iOperation = NULL; |
78 |
76 |
79 TRAPD(err, RemoveGlobalCategoriesL()); |
|
80 if (err != KErrNone && err != KErrNotFound) |
|
81 { |
|
82 HBufC* buf = HBufC::NewLC( 128 ); |
|
83 TPtr buffer = buf->Des(); |
|
84 |
|
85 buffer.Format(_L("RemoveGlobalCategoriesL leaved with %d"), err); |
|
86 iLog->Log( buffer ); |
|
87 |
|
88 CleanupStack::PopAndDestroy( buf ); |
|
89 } |
|
90 |
77 |
91 iLog->Log(_L("CloseTest Done")); |
78 iLog->Log(_L("CloseTest Done")); |
92 } |
79 } |
93 |
80 |
94 // --------------------------------------------------------- |
81 // --------------------------------------------------------- |
99 // |
86 // |
100 void CPosTp159::StartL() |
87 void CPosTp159::StartL() |
101 { |
88 { |
102 BaflUtils::EnsurePathExistsL( iFileSession, KKMZFile ); |
89 BaflUtils::EnsurePathExistsL( iFileSession, KKMZFile ); |
103 |
90 |
104 // Use same lm db as in composite search test |
|
105 iDatabase = UseCompositeLandmarksDbFileL(); |
|
106 if (iDatabase->IsInitializingNeeded()) |
|
107 { |
|
108 ExecuteAndDeleteLD(iDatabase->InitializeL()); |
|
109 } |
|
110 |
91 |
111 // Delete the trace file |
92 // Delete the trace file |
112 DeleteFileL(KFileTrace); |
93 DeleteFileL(KFileTrace); |
113 |
94 |
114 delete iDatabase; |
|
115 iDatabase = NULL; |
|
116 |
|
117 iDatabase = CPosLandmarkDatabase::OpenL(); |
|
118 |
|
119 |
|
120 if (iDatabase->IsInitializingNeeded()) |
|
121 { |
|
122 ExecuteAndDeleteLD(iDatabase->InitializeL()); |
|
123 } |
|
124 // Do reset so that global categories are included |
|
125 CPosLmCategoryManager* categoryManager = CPosLmCategoryManager::NewL(*iDatabase); |
|
126 CleanupStack::PushL(categoryManager); |
|
127 |
|
128 ExecuteAndDeleteLD(categoryManager->ResetGlobalCategoriesL()); |
|
129 CleanupStack::PopAndDestroy(categoryManager); |
|
130 |
95 |
131 HBufC8* emptyBuffer=NULL; |
96 HBufC8* emptyBuffer=NULL; |
132 |
97 |
133 iLog->Log(_L("Test with Tp159KMZFile.kmz")); |
98 iLog->Log(_L("Test with Tp159KMZFile.kmz")); |
134 PrintParsedDataFromEncoderL(KKMZFile, *emptyBuffer, KErrPosLmUnknownFormat, KKmzMimeType ); |
99 PrintParsedDataFromEncoderL(KKMZFile, *emptyBuffer, KErrPosLmUnknownFormat, KKmzMimeType ); |