landmarks/locationlandmarks/tsrc/LandmarkTestModule/src/FT_CPosTp151.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());
    77 
    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 
    78 
    91     iLog->Log(_L("CloseTest Done"));
    79     iLog->Log(_L("CloseTest Done"));
    92     }
    80     }
    93     
    81     
    94 // ---------------------------------------------------------
    82 // ---------------------------------------------------------
    99 //
    87 //
   100 void CPosTp151::StartL()
    88 void CPosTp151::StartL()
   101     {
    89     {
   102     BaflUtils::EnsurePathExistsL( iFileSession, KKMZFile );
    90     BaflUtils::EnsurePathExistsL( iFileSession, KKMZFile );
   103 
    91 
   104     // Use same lm db as in composite search test
    92  
   105     iDatabase = UseCompositeLandmarksDbFileL();
       
   106     if (iDatabase->IsInitializingNeeded())
       
   107        {
       
   108        ExecuteAndDeleteLD(iDatabase->InitializeL());
       
   109        }
       
   110 
       
   111     // Delete the trace file
    93     // Delete the trace file
   112     DeleteFileL(KFileTrace);
    94     DeleteFileL(KFileTrace);
   113 
    95 
   114     delete iDatabase;
       
   115     iDatabase = NULL;
       
   116 
       
   117     iDatabase = CPosLandmarkDatabase::OpenL();
       
   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 
    96 
   131     HBufC8* emptyBuffer=NULL;
    97     HBufC8* emptyBuffer=NULL;
   132     
    98     
   133    	iLog->Log(_L("Test with Tp151KMZFile.kmz"));
    99    	iLog->Log(_L("Test with Tp151KMZFile.kmz"));
   134 	PrintParsedDataFromEncoderL(KKMZFile, *emptyBuffer, KErrNone, KKmzMimeType );
   100 	PrintParsedDataFromEncoderL(KKMZFile, *emptyBuffer, KErrNone, KKmzMimeType );