landmarks/locationlandmarks/tsrc/LandmarkTestModule/src/FT_CPosTp149.cpp
changeset 39 3efc7a0e8755
parent 35 1a92308afc46
equal deleted inserted replaced
37:e175e2ba2fb0 39:3efc7a0e8755
    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;
       
    67     iDatabase=NULL;
       
    68 
    66 
    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());
       
    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 
    76 
    90     iLog->Log(_L("CloseTest Done"));
    77     iLog->Log(_L("CloseTest Done"));
    91     }
    78     }
    92     
    79     
    93 // ---------------------------------------------------------
    80 // ---------------------------------------------------------
    98 //
    85 //
    99 void CPosTp149::StartL()
    86 void CPosTp149::StartL()
   100     {
    87     {
   101     BaflUtils::EnsurePathExistsL( iFileSession, KKMZFile );
    88     BaflUtils::EnsurePathExistsL( iFileSession, KKMZFile );
   102 
    89 
   103     // Use same lm db as in composite search test
       
   104     iDatabase = UseCompositeLandmarksDbFileL();
       
   105     if (iDatabase->IsInitializingNeeded())
       
   106        {
       
   107        ExecuteAndDeleteLD(iDatabase->InitializeL());
       
   108        }
       
   109 
    90 
   110     // Delete the trace file
    91     // Delete the trace file
   111     DeleteFileL(KFileTrace);
    92     DeleteFileL(KFileTrace);
   112 
    93 
   113     delete iDatabase;
       
   114     iDatabase = NULL;
       
   115 
       
   116     iDatabase = CPosLandmarkDatabase::OpenL();
       
   117     	
       
   118     	
       
   119 if (iDatabase->IsInitializingNeeded())
       
   120        {
       
   121        ExecuteAndDeleteLD(iDatabase->InitializeL());
       
   122        }
       
   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 
    94 
   131     HBufC8* emptyBuffer=NULL;
    95     HBufC8* emptyBuffer=NULL;
   132     
    96     
   133    	iLog->Log(_L("Test with Tp149KMZFile.kmz"));
    97    	iLog->Log(_L("Test with Tp149KMZFile.kmz"));
   134 	PrintParsedDataFromEncoderL(KKMZFile, *emptyBuffer, KErrNone, KKmzMimeType );
    98 	PrintParsedDataFromEncoderL(KKMZFile, *emptyBuffer, KErrNone, KKmzMimeType );