landmarks/locationlandmarks/tsrc/LandmarkTestModule/src/FT_CPosTp160.cpp
changeset 40 16118e24b93b
parent 33 834e27cad510
equal deleted inserted replaced
33:834e27cad510 40:16118e24b93b
     1 /*
     1 /*
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Symbian Foundation License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8 *
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    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 CPosTp160::StartL()
    87 void CPosTp160::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     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 
    95 
   130     HBufC8* emptyBuffer=NULL;
    96     HBufC8* emptyBuffer=NULL;
   131     
    97     
   132    	iLog->Log(_L("Test with Tp160KMZFile.kmz"));
    98    	iLog->Log(_L("Test with Tp160KMZFile.kmz"));
   133 	PrintParsedDataFromEncoderL(KKMZFile, *emptyBuffer, KErrNone, KKmzMimeType );
    99 	PrintParsedDataFromEncoderL(KKMZFile, *emptyBuffer, KErrNone, KKmzMimeType );