landmarks/locationlandmarks/tsrc/LandmarkTestModule/src/FT_CPosTp155.cpp
changeset 39 3efc7a0e8755
parent 35 1a92308afc46
equal deleted inserted replaced
37:e175e2ba2fb0 39:3efc7a0e8755
    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 CPosTp155::StartL()
    87 void CPosTp155::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        
       
   125 
       
   126     // Do reset so that global categories are included
       
   127     CPosLmCategoryManager* categoryManager = CPosLmCategoryManager::NewL(*iDatabase);
       
   128     CleanupStack::PushL(categoryManager);
       
   129 
       
   130     ExecuteAndDeleteLD(categoryManager->ResetGlobalCategoriesL());
       
   131     CleanupStack::PopAndDestroy(categoryManager);
       
   132 
    95 
   133     HBufC8* emptyBuffer=NULL;
    96     HBufC8* emptyBuffer=NULL;
   134     
    97     
   135    	iLog->Log(_L("Test with Tp155KMZFile.kmz"));
    98    	iLog->Log(_L("Test with Tp155KMZFile.kmz"));
   136 	PrintParsedDataFromEncoderL(KKMZFile, *emptyBuffer, KErrNone, KKmzMimeType );
    99 	PrintParsedDataFromEncoderL(KKMZFile, *emptyBuffer, KErrNone, KKmzMimeType );