loc_pub/landmarks_ui_selector_api/tsrc/src/testlmkitemiddbcombiinf.cpp
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    LandmarksUi Content File -  Implementation for testing TLmkItemIdDbCombiInfo class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 // INCLUDE FILES
       
    25 #include <epos_landmarks.h>     // Lm typedefs, constants etc.
       
    26 #include <TLmkItemIdDbCombiInfo.h>
       
    27 #include <epos_cposlandmarkdatabase.h>
       
    28 
       
    29 #include "testlmkitemiddbcombiinf.h"
       
    30 
       
    31 // ============================ MEMBER FUNCTIONS ===============================
       
    32 // -----------------------------------------------------------------------------
       
    33 // TLmkItemIdDbCombiInf::TLmkItemIdDbCombiInf()
       
    34 // C++ default constructor can NOT contain any code, that
       
    35 // might leave.
       
    36 // -----------------------------------------------------------------------------
       
    37 TLmkItemIdDbCombiInf::TLmkItemIdDbCombiInf()
       
    38 	{
       
    39 	}
       
    40 
       
    41 // -----------------------------------------------------------------------------
       
    42 // TLmkItemIdDbCombiInf::~TLmkItemIdDbCombiInf()
       
    43 // -----------------------------------------------------------------------------
       
    44 //
       
    45 TLmkItemIdDbCombiInf::~TLmkItemIdDbCombiInf()
       
    46     {
       
    47     }
       
    48 
       
    49 // -----------------------------------------------------------------------------
       
    50 // TLmkItemIdDbCombiInf::GetItemIdL()
       
    51 //
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54  void TLmkItemIdDbCombiInf::GetItemIdL()
       
    55 	 {
       
    56 	 TLmkItemIdDbCombiInfo info;
       
    57 	 TPosLmItemId id = info.GetItemId();
       
    58 	 if( id != 0 )
       
    59 		 {
       
    60 		 User::Leave(KErrGeneral);
       
    61 		 }
       
    62 
       
    63 	 }
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // TLmkItemIdDbCombiInf::GetLmDbL()
       
    67 //
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70  void TLmkItemIdDbCombiInf::GetLmDbL()
       
    71 	{
       
    72 	TLmkItemIdDbCombiInfo info;
       
    73 	CPosLandmarkDatabase* db = info.GetLmDb();
       
    74 	 if( db )
       
    75 		 {
       
    76 		 User::Leave(KErrGeneral);
       
    77 		 }
       
    78 	}
       
    79 
       
    80 // -----------------------------------------------------------------------------
       
    81 // TLmkItemIdDbCombiInf::SetGetItemIdL()
       
    82 //
       
    83 // -----------------------------------------------------------------------------
       
    84 //
       
    85  void TLmkItemIdDbCombiInf::SetGetItemIdL()
       
    86 	 {
       
    87 	 TLmkItemIdDbCombiInfo info;
       
    88 	 TPosLmItemId id = 5;
       
    89 	 info.SetItemId(id);
       
    90 	 if( id != info.GetItemId() )
       
    91 		 {
       
    92 		 User::Leave(KErrGeneral);
       
    93 		 }
       
    94 
       
    95 	 }
       
    96 
       
    97 // -----------------------------------------------------------------------------
       
    98 // TLmkItemIdDbCombiInf::SetGetLmDbL()
       
    99 //
       
   100 // -----------------------------------------------------------------------------
       
   101 //
       
   102  void TLmkItemIdDbCombiInf::SetGetLmDbL()
       
   103 	{
       
   104 	TLmkItemIdDbCombiInfo info;
       
   105 	CPosLandmarkDatabase* db1 = CPosLandmarkDatabase::OpenL();
       
   106 	info.SetLmDb(db1);
       
   107 
       
   108 	CPosLandmarkDatabase* db2 = info.GetLmDb();
       
   109 
       
   110 	if( !db2 )
       
   111 		 {
       
   112 		 User::Leave(KErrGeneral);
       
   113 		 }
       
   114 
       
   115     delete db1;
       
   116 	ReleaseLandmarkResources();
       
   117 	}
       
   118 
       
   119  // End of file
       
   120 
       
   121 
       
   122 
       
   123 
       
   124 
       
   125