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