landmarks/locationlandmarks/tsrc/LandmarkTestModule/src/FT_CPosTp150.cpp
changeset 39 3efc7a0e8755
parent 35 1a92308afc46
equal deleted inserted replaced
37:e175e2ba2fb0 39:3efc7a0e8755
    55 //
    55 //
    56 void CPosTp150::CloseTest()
    56 void CPosTp150::CloseTest()
    57     {
    57     {
    58     iLog->Log(_L("CloseTest"));
    58     iLog->Log(_L("CloseTest"));
    59 
    59 
    60     delete iEncoderBuffer;
    60     
    61     iEncoderBuffer = NULL;
       
    62 
    61 
    63     iLandmarks.ResetAndDestroy();
    62     iLandmarks.ResetAndDestroy();
    64     iLandmarks.Close();
    63     iLandmarks.Close();
    65 
    64 
    66     delete iDatabase;
    65     
    67     iDatabase=NULL;
    66 
    68 
    67    
    69     delete iLandmarkEncoder;
       
    70     iLandmarkEncoder = NULL;
       
    71 
    68 
    72     delete iLandmarkParser;
    69     delete iLandmarkParser;
    73     iLandmarkParser = NULL;
    70     iLandmarkParser = NULL;
    74 
    71 
    75     delete iOperation;
    72     delete iOperation;
    76     iOperation = NULL;
    73     iOperation = NULL;
    77 
    74 
    78     TRAPD(err, RemoveGlobalCategoriesL());
    75 
    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 // ---------------------------------------------------------
    97 // ---------------------------------------------------------
    84 // ---------------------------------------------------------
    98 //
    85 //
    99 void CPosTp150::StartL()
    86 void CPosTp150::StartL()
   100     {
    87     {
   101     BaflUtils::EnsurePathExistsL( iFileSession, KKMZFile );
    88     BaflUtils::EnsurePathExistsL( iFileSession, KKMZFile );
   102 
       
   103     // Use same lm db as in composite search test
       
   104     iDatabase = UseCompositeLandmarksDbFileL();
       
   105     if (iDatabase->IsInitializingNeeded())
       
   106        {
       
   107        ExecuteAndDeleteLD(iDatabase->InitializeL());
       
   108        }
       
   109 
    89 
   110     // Delete the trace file
    90     // Delete the trace file
   111     DeleteFileL(KFileTrace);
    91     DeleteFileL(KFileTrace);
   112 
    92 
   113     delete iDatabase;
       
   114     iDatabase = NULL;
       
   115 
       
   116     iDatabase = CPosLandmarkDatabase::OpenL();
       
   117     	
       
   118     	if (iDatabase->IsInitializingNeeded())
       
   119        {
       
   120        ExecuteAndDeleteLD(iDatabase->InitializeL());
       
   121        }
       
   122 
       
   123     // Do reset so that global categories are included
       
   124     CPosLmCategoryManager* categoryManager = CPosLmCategoryManager::NewL(*iDatabase);
       
   125     CleanupStack::PushL(categoryManager);
       
   126 
       
   127     ExecuteAndDeleteLD(categoryManager->ResetGlobalCategoriesL());
       
   128     CleanupStack::PopAndDestroy(categoryManager);
       
   129 
    93 
   130     HBufC8* emptyBuffer=NULL;
    94     HBufC8* emptyBuffer=NULL;
   131     
    95     
   132    	iLog->Log(_L("Test with Tp150KMZFile.kmz"));
    96    	iLog->Log(_L("Test with Tp150KMZFile.kmz"));
   133 	PrintParsedDataFromEncoderL(KKMZFile, *emptyBuffer, KErrNone, KKmzMimeType );
    97 	PrintParsedDataFromEncoderL(KKMZFile, *emptyBuffer, KErrNone, KKmzMimeType );