locsrv_plat/map_image_api/tsrc/src/testmnmapimageparams.cpp
branchRCL_3
changeset 44 2b4ea9893b66
parent 42 02ba3f1733c6
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
     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:  Helper class for TMnMapImageParams class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // System Includes
       
    20 
       
    21 
       
    22 // User Includes
       
    23 #include "testmnmapimage.h"
       
    24 #include <e32std.h>
       
    25 #include <e32const.h>
       
    26 #include <mnmapimage.h>
       
    27 #include <mnproviderfinder.h>
       
    28 #include <mnprovider.h>
       
    29 #include <mnmapimageparams.h>
       
    30 #include <LbsPosition.h>
       
    31 #include "testmnmapimageparams.h"
       
    32 
       
    33 // Constant Declarations
       
    34 
       
    35     
       
    36 // ======== MEMBER FUNCTIONS ========
       
    37 
       
    38 // ---------------------------------------------------------------------------
       
    39 // C++ Default Constructor
       
    40 // ---------------------------------------------------------------------------
       
    41 //
       
    42 CTestMapImageParams ::CTestMapImageParams (CStifLogger* aLog):iLog(aLog)
       
    43     {
       
    44         
       
    45     }
       
    46 
       
    47 // ---------------------------------------------------------------------------
       
    48 // C++ Destructor
       
    49 // ---------------------------------------------------------------------------
       
    50 //
       
    51 CTestMapImageParams ::~CTestMapImageParams ()
       
    52     {
       
    53         
       
    54         
       
    55     }
       
    56 
       
    57 // ---------------------------------------------------------------------------
       
    58 // Test case for constructor of TMnMapImageParams
       
    59 // ---------------------------------------------------------------------------
       
    60 TInt CTestMapImageParams ::CheckTMnMapImageParams()
       
    61     {
       
    62         TMnMapImageParams params;
       
    63                 
       
    64         return KErrNone;
       
    65     }
       
    66     
       
    67 // ---------------------------------------------------------------------------
       
    68 // Test case for TMnMapImageParams::SetCenterPoint & TMnMapImageParams::GetCenterPoint
       
    69 // ---------------------------------------------------------------------------
       
    70 TInt CTestMapImageParams ::CheckSetGetCenterPoint()
       
    71     {
       
    72         TMnMapImageParams params;
       
    73         TInt error = KErrNone;
       
    74         TCoordinate coordinate(31.6,62.3);
       
    75         params.SetCenterPoint(coordinate);
       
    76         
       
    77         TCoordinate coordinate1;
       
    78         params.GetCenterPoint(coordinate1);
       
    79         
       
    80         if((coordinate1.Latitude()!=coordinate.Latitude())||
       
    81         			(coordinate1.Longitude()!=coordinate.Longitude()))
       
    82                {
       
    83                 
       
    84           		error = KErrGeneral; 	
       
    85                }        
       
    86         else 
       
    87             error = KErrNone;
       
    88         
       
    89         return error;
       
    90     }
       
    91     
       
    92 // ---------------------------------------------------------------------------
       
    93 // Test case for TMnMapImageParams::SetVisibleArea & TMnMapImageParams::GetVisibleArea
       
    94 // ---------------------------------------------------------------------------
       
    95 TInt CTestMapImageParams ::CheckSetGetVisibleArea()
       
    96     {
       
    97         TMnMapImageParams params;
       
    98         TInt error = KErrNone;
       
    99         params.SetVisibleArea(20,30);
       
   100         
       
   101         TReal32 width,height;
       
   102         params.GetVisibleArea(width,height);
       
   103         if(width!=20||height!=30)
       
   104            	   {
       
   105         		error = KErrGeneral; 	
       
   106            	   }
       
   107         else
       
   108              error = KErrNone;
       
   109         
       
   110         return error;
       
   111         
       
   112     }
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 // Test case for TMnMapImageParams::SetSize & TMnMapImageParams::Size
       
   116 // ---------------------------------------------------------------------------
       
   117 TInt CTestMapImageParams ::CheckSetGetSize()
       
   118     {
       
   119         TMnMapImageParams params;
       
   120         TInt error = KErrNone;
       
   121         
       
   122         TSize size(1,2);
       
   123         params.SetSize(size);
       
   124         
       
   125         if(params.Size()!=size)
       
   126             {
       
   127                 error = KErrGeneral;
       
   128             }
       
   129         else
       
   130             error = KErrNone;
       
   131         
       
   132         return error;
       
   133     }
       
   134 
       
   135 // ---------------------------------------------------------------------------
       
   136 // Test case for TMnMapImageParams::SetDirection & TMnMapImageParams::Direction
       
   137 // ---------------------------------------------------------------------------
       
   138 TInt CTestMapImageParams ::CheckSetGetDirection()
       
   139     {
       
   140         TMnMapImageParams params;
       
   141         TInt error = KErrNone;
       
   142         
       
   143         TReal32 direction = 20.0;
       
   144         params.SetDirection(direction);
       
   145                 
       
   146         if(params.Direction() != direction)
       
   147             {
       
   148                 error = KErrGeneral;
       
   149             }
       
   150         else
       
   151             error = KErrNone;
       
   152        
       
   153         return error;        
       
   154     }
       
   155 
       
   156 // ---------------------------------------------------------------------------
       
   157 // Test case for TMnMapImageParams::SetImageType& TMnMapImageParams::ImageType
       
   158 // ---------------------------------------------------------------------------
       
   159 TInt CTestMapImageParams ::CheckSetGetImageType()
       
   160     {
       
   161         TMnMapImageParams params;
       
   162         TInt error = KErrNone;
       
   163         
       
   164         params.SetImageType(TMnMapImageParams::ETypeSatelliteImage);
       
   165         
       
   166         if(params.ImageType()!=TMnMapImageParams::ETypeSatelliteImage)
       
   167             {
       
   168                 error = KErrGeneral;
       
   169             }
       
   170         else
       
   171             error = KErrNone;
       
   172         
       
   173         return error;
       
   174     }
       
   175     
       
   176 // ---------------------------------------------------------------------------
       
   177 // Test case for TMnMapImageParams::SetProjectionId & TMnMapImageParams::ProjectionId
       
   178 // ---------------------------------------------------------------------------
       
   179 TInt CTestMapImageParams ::CheckSetGetProjectionId()
       
   180     {
       
   181         TMnMapImageParams params;
       
   182         TInt error = KErrNone;
       
   183         
       
   184         params.SetProjectionId(15);
       
   185         
       
   186         if(params.ProjectionId() != 15)
       
   187             {
       
   188                 error = KErrGeneral;
       
   189             }
       
   190         else
       
   191             error = KErrNone;
       
   192         
       
   193         return error;
       
   194     }