LbsApi/src/dataclassesstep.cpp
author Maciej Seroka <maciejs@symbian.org>
Wed, 28 Jul 2010 13:24:28 +0100
branchSymbian3
changeset 54 a4835904093b
permissions -rw-r--r--
Added new LbsApi smoke test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
54
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     7
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    10
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    11
// Contributors:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    12
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    13
// Description:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    14
// Example CTestStep derived implementation
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    15
// 
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    16
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    17
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    18
/**
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    19
 @file DataClassesStep.cpp
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    20
 @internalTechnology
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    21
*/
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    22
#include "dataclassesstep.h"
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    23
#include "te_lbsapisuitedefs.h"
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    24
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    25
#include "lcfsbucommondefinitions.h"
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    26
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    27
#include <lbs.h>
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    28
#include <lbs/lbsextendedsatellite.h>
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    29
#include <lbs/lbsgpstimingmeasurement.h>
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    30
#include <lbs/lbsgpsmeasurement.h>
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    31
   
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    32
// used to confirm that PositionXInfo class sizes do not change
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    33
const TUint KPositionSatelliteInfoSize = 920;  
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    34
const TUint KPositionGpsMeasurementInfoSize = 832;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    35
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    36
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    37
CDataClassesStep::~CDataClassesStep()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    38
/**
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    39
 * Destructor
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    40
 */
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    41
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    42
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    43
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    44
CDataClassesStep::CDataClassesStep()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    45
/**
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    46
 * Constructor
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    47
 */
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    48
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    49
	// **MUST** call SetTestStepName in the constructor as the controlling
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    50
	// framework uses the test step name immediately following construction to set
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    51
	// up the step's unique logging ID.
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    52
	SetTestStepName(KDataClassesStep);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    53
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    54
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    55
TVerdict CDataClassesStep::doTestStepPreambleL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    56
/**
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    57
 * @return - TVerdict code
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    58
 * Override of base class virtual
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    59
 */
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    60
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    61
	 CTe_LbsApiSuiteStepBase::doTestStepPreambleL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    62
	 if (TestStepResult()!=EPass)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    63
	    return   TestStepResult();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    64
	// process some pre setting to this test step then set SetTestStepResult to EFail or Epass.
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    65
	SetTestStepResult(EPass);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    66
	return TestStepResult();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    67
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    68
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    69
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    70
TVerdict CDataClassesStep::doTestStepL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    71
/**
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    72
 * @return - TVerdict code
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    73
 * Override of base class pure virtual
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    74
 * Our implementation only gets called if the base class doTestStepPreambleL() did
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    75
 * not leave. That being the case, the current test result value will be EPass.
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    76
 */
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    77
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    78
	  if (TestStepResult()==EPass)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    79
		{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    80
		TInt test;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    81
		if(!GetIntFromConfig(ConfigSection(),KTe_LbsApiSuiteInt,test)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    82
			)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    83
			{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    84
			// Leave if there's any error.
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    85
			User::Leave(KErrNotFound);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    86
			}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    87
		SetTestStepResult(EPass);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    88
		StartL(test);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    89
		}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    90
	  return TestStepResult();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    91
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    92
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    93
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    94
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    95
TVerdict CDataClassesStep::doTestStepPostambleL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    96
/**
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    97
 * @return - TVerdict code
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    98
 * Override of base class virtual
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    99
 */
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   100
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   101
	// process something post setting to the test step
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   102
	// uncomment the following line if you have common post setting to all the test steps in there
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   103
	// CTe_LbsApiVariant2SuiteStepBase::doTestStepPostambleL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   104
	// uncomment the following line if you have post process or remove the following line if no post process
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   105
	// SetTestStepResult(EPass);		// or EFail
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   106
	return TestStepResult();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   107
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   108
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   109
void CDataClassesStep::StartL(TInt aIndex)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   110
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   111
	switch (aIndex)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   112
		{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   113
	case 0:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   114
		TCoordinate_BlankConstructionL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   115
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   116
	case 1:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   117
		TCoordinate_ConstructorsL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   118
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   119
	case 2:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   120
		TCoordinate_Constructors2L ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   121
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   122
	case 3:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   123
		TCoordinate_InvalidL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   124
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   125
	case 4:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   126
		TCoordinate_NormalizationWithNansL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   127
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   128
	case 5:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   129
		TLocality_BlankConstructionL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   130
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   131
	case 6:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   132
		TLocality_ConstructorsL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   133
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   134
	case 7:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   135
		TLocality_Constructors2L ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   136
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   137
	case 8:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   138
		TLocality_NegativeL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   139
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   140
	case 9:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   141
		TPosition_ConstructionL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   142
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   143
	case 10:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   144
		TPosition_SettersL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   145
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   146
	case 11:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   147
		TPositionInfo_ConstructionL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   148
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   149
	case 12:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   150
		TPositionInfo_ModificationL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   151
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   152
	case 13:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   153
		CourseClasses_ConstructionL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   154
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   155
	case 14:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   156
		CourseClasses_Modification2L ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   157
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   158
	case 15:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   159
		CourseClasses_ModificationL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   160
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   161
	case 16:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   162
		CourseClasses_InvalidL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   163
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   164
	case 17:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   165
		SatelliteClasses_ConstructionL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   166
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   167
	case 18:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   168
		SatelliteClasses_PropertiesL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   169
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   170
	case 19:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   171
		SatelliteClasses_Properties2L ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   172
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   173
	case 20:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   174
		SatelliteClasses_InfoL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   175
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   176
	case 21:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   177
		SatelliteClasses_SatelliteInfoL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   178
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   179
	case 22:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   180
		SatelliteClasses_OverflowL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   181
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   182
	case 23:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   183
       GpsMeasurementClasses_PropertiesL ();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   184
       break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   185
	default:
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   186
		break;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   187
		}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   188
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   189
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   190
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   191
extern void CheckPanic(const char* aFileName, TInt aLine);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   192
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   193
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   194
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   195
// TCoordinate
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   196
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   197
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   198
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   199
// 2.1.1. Default constructor sets values to NAN
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   200
void CDataClassesStep::TCoordinate_BlankConstructionL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   201
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   202
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   203
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   204
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   205
    TCoordinate coordinate;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   206
    CHECK(Math::IsNaN(coordinate.Latitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   207
    CHECK(Math::IsNaN(coordinate.Longitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   208
    CHECK(Math::IsNaN(coordinate.Altitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   209
    CHECK_EQUAL_(KPositionDatumWgs84.iUid, coordinate.Datum().iUid);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   210
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   211
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   212
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   213
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   214
// 2.1.2 Parameterized constructors and Setters work same
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   215
void CDataClassesStep::TCoordinate_ConstructorsL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   216
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   217
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   218
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   219
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   220
    const TReal64 dumLat = 11.111;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   221
    const TReal64 dumLon = 22.222;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   222
    const TReal32 dumAlt = TReal32(33.333);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   223
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   224
    TCoordinate coordSet;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   225
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   226
    // 2 parameters
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   227
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   228
    coordSet.SetCoordinate(dumLat, dumLon);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   229
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   230
    CHECK_REAL_EQUAL(coordSet.Latitude() , dumLat);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   231
    CHECK_REAL_EQUAL(coordSet.Longitude(), dumLon);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   232
    CHECK(Math::IsNaN(coordSet.Altitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   233
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   234
    TCoordinate coord2p(dumLat, dumLon);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   235
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   236
    CHECK_REAL_EQUAL(coord2p.Latitude()  , coordSet.Latitude());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   237
    CHECK_REAL_EQUAL(coord2p.Longitude() , coordSet.Longitude());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   238
    CHECK(Math::IsNaN(coord2p.Altitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   239
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   240
    // 3 params
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   241
    coordSet.SetCoordinate(dumLat, dumLon, dumAlt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   242
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   243
    CHECK_REAL_EQUAL(coordSet.Latitude() , dumLat);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   244
    CHECK_REAL_EQUAL(coordSet.Longitude(), dumLon);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   245
    CHECK_REAL_EQUAL(coordSet.Altitude() , dumAlt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   246
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   247
    TCoordinate coord3p(dumLat, dumLon, dumAlt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   248
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   249
    CHECK_REAL_EQUAL(coord3p.Latitude() , coordSet.Latitude());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   250
    CHECK_REAL_EQUAL(coord3p.Longitude(), coordSet.Longitude());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   251
    CHECK_REAL_EQUAL(coord3p.Altitude() , coordSet.Altitude());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   252
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   253
    // datum
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   254
    const TPositionDatumId otherDatum = {0x10101010};
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   255
    coordSet.SetDatum(otherDatum);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   256
    CHECK_EQUAL_(otherDatum.iUid, coordSet.Datum().iUid);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   257
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   258
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   259
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   260
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   261
// 2.1.3 Parameterized constructors and Setters work same with NANs
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   262
void CDataClassesStep::TCoordinate_Constructors2L()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   263
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   264
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   265
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   266
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   267
    TRealX nan;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   268
    nan.SetNaN();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   269
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   270
    TReal64 dumLat(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   271
    TReal64 dumLon(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   272
    TReal32 dumAlt(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   273
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   274
    TCoordinate coordSet;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   275
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   276
    // 2 parameters
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   277
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   278
    coordSet.SetCoordinate(dumLat, dumLon);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   279
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   280
    CHECK(Math::IsNaN(coordSet.Latitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   281
    CHECK(Math::IsNaN(coordSet.Longitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   282
    CHECK(Math::IsNaN(coordSet.Altitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   283
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   284
    TCoordinate coord2p(dumLat, dumLon);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   285
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   286
    CHECK(Math::IsNaN(coord2p.Latitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   287
    CHECK(Math::IsNaN(coord2p.Longitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   288
    CHECK(Math::IsNaN(coord2p.Altitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   289
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   290
    // 3 params
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   291
    coordSet.SetCoordinate(dumLat, dumLon, dumAlt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   292
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   293
    CHECK(Math::IsNaN(coordSet.Latitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   294
    CHECK(Math::IsNaN(coordSet.Longitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   295
    CHECK(Math::IsNaN(coordSet.Altitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   296
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   297
    TCoordinate coord3p(dumLat, dumLon, dumAlt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   298
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   299
    CHECK(Math::IsNaN(coord3p.Latitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   300
    CHECK(Math::IsNaN(coord3p.Longitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   301
    CHECK(Math::IsNaN(coord3p.Altitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   302
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   303
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   304
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   305
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   306
// 2.1.4 Bad Input in TCoordinate
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   307
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   308
// The function is to normalize Lat/Lon parameters
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   309
// to [-90,+90] and (-180,+180] ranges respectively.
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   310
// If Latitude wraps +90 or -90 boundary, than Longitude
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   311
// is corrected to be shifted to another hemisphere
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   312
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   313
// IF Latitude is in 1st quarter of circle THEN nothing to do
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   314
// IF Latitude is in 2nd or 3rd quarter,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   315
// THEN Longitude is shifted to opposite hemisphere, and Latitude
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   316
// is mirrored about 90 degrees (to accord with longitude)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   317
// IF Latitude is in 4th quarter, THEN Latitude is mirrored
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   318
// about 0 degrees (to be below equator)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   319
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   320
// NOTE that as +90 and -90 a valid Latitude values,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   321
// then 4th quarter begins from +270 inclusively (it is -90 inclusively in fact)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   322
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   323
// Latitude is processed first as it has its influence on Longitude
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   324
void NormalLatLon(TReal lat, TReal lon, TReal& nlat, TReal& nlon)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   325
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   326
    // 1. latitude
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   327
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   328
    // save sign, because negative and positive latitude
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   329
    // values are processed same way
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   330
    TBool isNegLat = (lat < 0);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   331
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   332
    // truncate by 360, work with positive values
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   333
    TReal absLat = isNegLat ? -lat : lat;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   334
    Math::Mod(lat, absLat, 360);  // 0 <= lat < 360
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   335
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   336
    // correct values, if latitude wraps 90 deg boundary
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   337
    if (lat >= 270)         // 4th quarter
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   338
    {
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   339
        lat = lat - 360;    // reverse
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   340
    }
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   341
    else
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   342
    if (lat > 90)           // 2nd or 3rd quarter
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   343
    {
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   344
        lat = 180 - lat;    // round about 90
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   345
        lon = lon + 180;    // another hemisphere
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   346
    }
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   347
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   348
    // recall latutide sign
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   349
    if (isNegLat) lat = - lat;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   350
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   351
    // 2. longitude
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   352
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   353
    // -360 < lon < 360
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   354
    Math::Mod(lon, lon, 360);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   355
    // let's put lon to -180 .. 180 range
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   356
    if (lon > 180)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   357
    {
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   358
        lon = lon - 360;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   359
    }
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   360
    else
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   361
    if (lon < - 180) // for negative longitudes
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   362
    {
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   363
        lon = lon + 360;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   364
    }
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   365
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   366
    nlat = lat;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   367
    nlon = lon;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   368
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   369
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   370
void XYZfromLatLon(TReal& x, TReal& y, TReal& z, TReal lat, TReal lon)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   371
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   372
    Math::Mod(lat, lat, 360);  // -360 < lat < 360
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   373
    Math::Mod(lon, lon, 360);  // -360 < lon < 360
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   374
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   375
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   376
    // if latitude is 90 deg or -90 deg, then reduce it by one degree : 89 deg.
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   377
    // it allows to check longitude direction more correctly (avoid cos(lat)==0)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   378
    if ((lat == 90) || (lat == -270))
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   379
    {
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   380
        lat -= 1;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   381
    }
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   382
    else
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   383
    if ((lat == -90) || (lat == 270))
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   384
    {
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   385
        lat += 1;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   386
    }
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   387
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   388
    TReal latCos, latSin, lonCos, lonSin;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   389
    Math::Cos(latCos, lat * KDegToRad);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   390
    Math::Sin(latSin, lat * KDegToRad);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   391
    Math::Cos(lonCos, lon * KDegToRad);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   392
    Math::Sin(lonSin, lon * KDegToRad);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   393
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   394
    x = latCos * lonCos;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   395
    y = latCos * lonSin;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   396
    z = latSin;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   397
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   398
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   399
TBool IsSamePoint(TReal lat1, TReal lon1, TReal lat2, TReal lon2)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   400
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   401
    TReal x1,y1,z1, x2,y2,z2;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   402
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   403
    XYZfromLatLon(x1,y1,z1, lat1, lon1);    // source values
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   404
    XYZfromLatLon(x2,y2,z2, lat2, lon2);    // TCoordinate
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   405
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   406
    const TReal tolerance = 0.0000001; // 1 of million
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   407
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   408
    TBool same = (Abs(x1 - x2) < tolerance) &&
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   409
                 (Abs(y1 - y2) < tolerance) &&
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   410
                 (Abs(z1 - z2) < tolerance);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   411
    return same;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   412
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   413
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   414
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   415
void CDataClassesStep::TCoordinate_InvalidL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   416
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   417
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   418
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   419
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   420
    const TReal32 alt = 10;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   421
    TBool noErrors = ETrue;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   422
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   423
    // 1. Valid WGS84 range + Out of WGS84 range
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   424
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   425
    // check values (step 30 degrees) in (-540..+540] of longitude
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   426
    for (TReal64 lon = 540; lon > -540; lon -= 30)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   427
    	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   428
        // check values (step 30 degrees) in [-450; 450] of latitude
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   429
        for (TReal64 lat = 720; lat >= -720; lat -= 30)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   430
        	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   431
            // set
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   432
            TCoordinate coordinate2, coordinate3;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   433
            coordinate2.SetCoordinate(lat,lon);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   434
            coordinate3.SetCoordinate(lat,lon, alt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   435
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   436
            // construct
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   437
            TCoordinate coord2(lat, lon);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   438
            TCoordinate coord3(lat, lon, alt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   439
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   440
            TBool isValidCoordinate2 = IsSamePoint(lat, lon, coordinate2.Latitude(), coordinate2.Longitude());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   441
            TBool isValidCoordinate3 = IsSamePoint(lat, lon, coordinate3.Latitude(), coordinate3.Longitude());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   442
            TBool isValidCoord2 = IsSamePoint(lat, lon, coord2.Latitude(), coord2.Longitude());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   443
            TBool isValidCoord3 = IsSamePoint(lat, lon, coord3.Latitude(), coord3.Longitude());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   444
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   445
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   446
            TReal nlat, nlon;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   447
            NormalLatLon(lat, lon, nlat, nlon);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   448
            TBool isValidNormalLatLon = IsSamePoint(lat, lon, nlat, nlon);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   449
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   450
            if (!isValidCoordinate2 || !isValidCoordinate3 || !isValidCoord2 || !isValidCoord3 || !isValidNormalLatLon)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   451
            	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   452
                noErrors = EFalse;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   453
            	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   454
        	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   455
    	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   456
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   457
    if (!noErrors) LOG("There were errors in Normalization.");
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   458
    CHECK(noErrors);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   459
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   460
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   461
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   462
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   463
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   464
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   465
TInt TCoordinate_NormalizationWithNans_Panic(TAny* /*aPtr*/)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   466
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   467
    TRealX nan; nan.SetNaN();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   468
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   469
    const TReal KBigLatitude = 120.0;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   470
    const TReal KBigLongitude = 200.0;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   471
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   472
    const TReal KGoodLatitude = 180 - KBigLatitude;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   473
    const TReal KGoodLongitude = KBigLongitude - 360;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   474
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   475
    TCoordinate coord;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   476
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   477
    // this will cause normalization process
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   478
    // this should not panic even though longitude is NaN
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   479
    coord.SetCoordinate(KBigLatitude, nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   480
    CHECK_PANIC(coord.Latitude() == KGoodLatitude);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   481
    CHECK_PANIC(Math::IsNaN(coord.Longitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   482
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   483
    // this will cause normalization process
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   484
    // this should not panic even though latitude is NaN
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   485
    coord.SetCoordinate(nan, KBigLongitude);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   486
    CHECK_PANIC(coord.Longitude() == KGoodLongitude);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   487
    CHECK_PANIC(Math::IsNaN(coord.Latitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   488
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   489
    return KErrNone;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   490
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   491
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   492
// 2.1.5 Normalization if one of members is NaN
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   493
void CDataClassesStep::TCoordinate_NormalizationWithNansL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   494
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   495
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   496
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   497
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   498
    DO_PANIC_TEST_L(
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   499
        TCoordinate_NormalizationWithNans_Panic,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   500
        KNoClientFault,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   501
        KErrNone,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   502
        KDefaultTestTimeout);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   503
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   504
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   505
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   506
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   507
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   508
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   509
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   510
// TLocality
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   511
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   512
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   513
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   514
// 2.3.1. Blank constructor
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   515
void CDataClassesStep::TLocality_BlankConstructionL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   516
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   517
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   518
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   519
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   520
    TLocality locality;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   521
    CHECK(Math::IsNaN(locality.Latitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   522
    CHECK(Math::IsNaN(locality.Longitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   523
    CHECK(Math::IsNaN(locality.Altitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   524
    CHECK(Math::IsNaN(locality.HorizontalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   525
    CHECK(Math::IsNaN(locality.VerticalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   526
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   527
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   528
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   529
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   530
// 2.3.2. Compare constructor parameters setting and using setters
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   531
void CDataClassesStep::TLocality_ConstructorsL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   532
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   533
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   534
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   535
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   536
    const TReal64 dumLat = 11.111;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   537
    const TReal64 dumLon = 22.222;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   538
    const TReal32 dumAlt = TReal32(33.333);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   539
    const TReal32 dumHorAcc = TReal32(0.444);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   540
    const TReal32 dumVerAcc = TReal32(0.555);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   541
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   542
    TCoordinate coord(dumLat, dumLon, dumAlt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   543
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   544
    // hor
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   545
    TLocality localSetHor;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   546
    localSetHor.SetHorizontalAccuracy(dumHorAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   547
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   548
    CHECK_REAL_EQUAL(localSetHor.HorizontalAccuracy() , dumHorAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   549
    CHECK(Math::IsNaN(localSetHor.VerticalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   550
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   551
    TLocality localHor(coord, dumHorAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   552
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   553
    CHECK_REAL_EQUAL(localHor.Latitude() , dumLat);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   554
    CHECK_REAL_EQUAL(localHor.Longitude(), dumLon);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   555
    CHECK_REAL_EQUAL(localHor.Altitude() , dumAlt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   556
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   557
    CHECK_REAL_EQUAL(localHor.HorizontalAccuracy(), dumHorAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   558
    CHECK(Math::IsNaN(localHor.VerticalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   559
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   560
    // ver
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   561
    TLocality localSetVer;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   562
    localSetVer.SetVerticalAccuracy(dumVerAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   563
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   564
    CHECK(Math::IsNaN(localSetVer.HorizontalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   565
    CHECK_REAL_EQUAL(localSetVer.VerticalAccuracy() , dumVerAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   566
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   567
    // both
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   568
    TLocality localSet;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   569
    localSet.SetAccuracy(dumHorAcc, dumVerAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   570
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   571
    CHECK_REAL_EQUAL(localSet.HorizontalAccuracy(), dumHorAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   572
    CHECK_REAL_EQUAL(localSet.VerticalAccuracy()  , dumVerAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   573
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   574
    TLocality localVer(coord, dumHorAcc, dumVerAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   575
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   576
    CHECK_REAL_EQUAL(localVer.Latitude() , dumLat);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   577
    CHECK_REAL_EQUAL(localVer.Longitude(), dumLon);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   578
    CHECK_REAL_EQUAL(localVer.Altitude() , dumAlt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   579
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   580
    CHECK_REAL_EQUAL(localVer.HorizontalAccuracy(), dumHorAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   581
    CHECK_REAL_EQUAL(localVer.VerticalAccuracy()  , dumVerAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   582
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   583
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   584
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   585
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   586
// 2.3.3. Compare constructor parameters setting and using setters, NANs
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   587
TInt TLocality_Constructors_and_Setters_with_NANs(TAny* /*aPtr*/)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   588
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   589
    TRealX nan; nan.SetNaN();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   590
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   591
    const TReal64 dumLat(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   592
    const TReal64 dumLon(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   593
    const TReal32 dumAlt(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   594
    const TReal32 dumHorAcc(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   595
    const TReal32 dumVerAcc(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   596
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   597
    TCoordinate coord(dumLat, dumLon, dumAlt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   598
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   599
    // hor
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   600
    TLocality localSetHor;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   601
    localSetHor.SetHorizontalAccuracy(dumHorAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   602
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   603
    CHECK_PANIC(Math::IsNaN(localSetHor.HorizontalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   604
    CHECK_PANIC(Math::IsNaN(localSetHor.VerticalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   605
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   606
    TLocality localHor(coord, dumHorAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   607
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   608
    CHECK_PANIC(Math::IsNaN(localHor.Latitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   609
    CHECK_PANIC(Math::IsNaN(localHor.Longitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   610
    CHECK_PANIC(Math::IsNaN(localHor.Altitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   611
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   612
    CHECK_PANIC(Math::IsNaN(localHor.HorizontalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   613
    CHECK_PANIC(Math::IsNaN(localHor.VerticalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   614
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   615
    // ver
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   616
    TLocality localSetVer;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   617
    localSetVer.SetVerticalAccuracy(dumVerAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   618
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   619
    CHECK_PANIC(Math::IsNaN(localSetVer.HorizontalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   620
    CHECK_PANIC(Math::IsNaN(localSetVer.VerticalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   621
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   622
    // both
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   623
    TLocality localSet;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   624
    localSet.SetAccuracy(dumHorAcc, dumVerAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   625
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   626
    CHECK_PANIC(Math::IsNaN(localSet.HorizontalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   627
    CHECK_PANIC(Math::IsNaN(localSet.VerticalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   628
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   629
    TLocality localVer(coord, dumHorAcc, dumVerAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   630
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   631
    CHECK_PANIC(Math::IsNaN(localVer.Latitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   632
    CHECK_PANIC(Math::IsNaN(localVer.Longitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   633
    CHECK_PANIC(Math::IsNaN(localVer.Altitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   634
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   635
    CHECK_PANIC(Math::IsNaN(localVer.HorizontalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   636
    CHECK_PANIC(Math::IsNaN(localVer.VerticalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   637
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   638
    return KErrNone;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   639
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   640
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   641
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   642
void CDataClassesStep::TLocality_Constructors2L()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   643
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   644
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   645
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   646
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   647
    DO_PANIC_TEST_L(
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   648
        TLocality_Constructors_and_Setters_with_NANs,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   649
        KNoClientFault,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   650
        KErrNone,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   651
        KDefaultTestTimeout);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   652
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   653
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   654
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   655
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   656
// 2.3.4 Negative Accuracy values
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   657
TInt TLocality_Negative_Accuracy_Construct_HorAcc(TAny* /*aPtr*/)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   658
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   659
    const TReal32 dumAcc = TReal32(0.1);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   660
    TLocality locality(TCoordinate(1,2,3), -dumAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   661
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   662
    locality.Altitude();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   663
    return KErrGeneral;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   664
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   665
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   666
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   667
TInt TLocality_Negative_Accuracy_Construct_VerAcc(TAny* /*aPtr*/)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   668
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   669
    const TReal32 dumAcc = TReal32(0.1);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   670
    TLocality locality(TCoordinate(1,2,3), dumAcc, -dumAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   671
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   672
    locality.Altitude();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   673
    return KErrGeneral;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   674
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   675
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   676
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   677
TInt TLocality_Negative_Accuracy_Set_Both_HorNegative(TAny* /*aPtr*/)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   678
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   679
    const TReal32 dumAcc = TReal32(0.1);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   680
    TLocality locality;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   681
    locality.SetAccuracy(-dumAcc, dumAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   682
    return KErrGeneral;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   683
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   684
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   685
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   686
TInt TLocality_Negative_Accuracy_Set_Both_VerNegative(TAny* /*aPtr*/)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   687
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   688
    const TReal32 dumAcc = TReal32(0.1);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   689
    TLocality locality;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   690
    locality.SetAccuracy(dumAcc, -dumAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   691
    return KErrGeneral;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   692
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   693
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   694
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   695
TInt TLocality_Negative_Accuracy_Set_HorNegative(TAny* /*aPtr*/)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   696
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   697
    const TReal32 dumAcc = TReal32(0.1);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   698
    TLocality locality;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   699
    locality.SetHorizontalAccuracy(-dumAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   700
    return KErrGeneral;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   701
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   702
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   703
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   704
TInt TLocality_Negative_Accuracy_Set_VerNegative(TAny* /*aPtr*/)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   705
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   706
    const TReal32 dumAcc = TReal32(0.1);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   707
    TLocality locality;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   708
    locality.SetVerticalAccuracy(-dumAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   709
    return KErrGeneral;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   710
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   711
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   712
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   713
void CDataClassesStep::TLocality_NegativeL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   714
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   715
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   716
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   717
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   718
    DO_PANIC_TEST_L(TLocality_Negative_Accuracy_Construct_HorAcc,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   719
        KPosClientFault, EPositionBadAccuracy, KDefaultTestTimeout);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   720
    DO_PANIC_TEST_L(TLocality_Negative_Accuracy_Construct_VerAcc,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   721
        KPosClientFault, EPositionBadAccuracy, KDefaultTestTimeout);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   722
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   723
    DO_PANIC_TEST_L(TLocality_Negative_Accuracy_Set_Both_HorNegative,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   724
        KPosClientFault, EPositionBadAccuracy, KDefaultTestTimeout);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   725
    DO_PANIC_TEST_L(TLocality_Negative_Accuracy_Set_Both_VerNegative,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   726
        KPosClientFault, EPositionBadAccuracy, KDefaultTestTimeout);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   727
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   728
    DO_PANIC_TEST_L(TLocality_Negative_Accuracy_Set_HorNegative,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   729
        KPosClientFault, EPositionBadAccuracy, KDefaultTestTimeout);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   730
    DO_PANIC_TEST_L(TLocality_Negative_Accuracy_Set_VerNegative,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   731
        KPosClientFault, EPositionBadAccuracy, KDefaultTestTimeout);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   732
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   733
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   734
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   735
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   736
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   737
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   738
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   739
// TPosition
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   740
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   741
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   742
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   743
// 2.5.1. Constructors
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   744
void CDataClassesStep::TPosition_ConstructionL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   745
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   746
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   747
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   748
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   749
    // blank
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   750
    TPosition position;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   751
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   752
    CHECK(position.Time() == TTime(0));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   753
    CHECK(Math::IsNaN(position.Latitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   754
    CHECK(Math::IsNaN(position.Longitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   755
    CHECK(Math::IsNaN(position.Altitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   756
    CHECK(Math::IsNaN(position.HorizontalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   757
    CHECK(Math::IsNaN(position.VerticalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   758
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   759
    // full
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   760
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   761
    const TReal64 dumLat = 11.111;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   762
    const TReal64 dumLon = 22.222;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   763
    const TReal32 dumAlt = TReal32(33.333);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   764
    const TReal32 dumHorAcc = TReal32(0.444);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   765
    const TReal32 dumVerAcc = TReal32(0.555);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   766
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   767
    TTime dumTime;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   768
    dumTime.HomeTime();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   769
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   770
    TCoordinate coordinate(dumLat, dumLon, dumAlt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   771
    TLocality locality(coordinate, dumHorAcc, dumVerAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   772
    position = TPosition(locality, dumTime);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   773
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   774
    CHECK(position.Time() == dumTime);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   775
    CHECK_REAL_EQUAL(position.Latitude(), dumLat);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   776
    CHECK_REAL_EQUAL(position.Longitude(), dumLon);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   777
    CHECK_REAL_EQUAL(position.Altitude(), dumAlt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   778
    CHECK_REAL_EQUAL(position.HorizontalAccuracy(), dumHorAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   779
    CHECK_REAL_EQUAL(position.VerticalAccuracy(), dumVerAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   780
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   781
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   782
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   783
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   784
// 2.5.2. Setters/Getters (time)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   785
void CDataClassesStep::TPosition_SettersL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   786
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   787
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   788
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   789
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   790
    // time
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   791
    TTime dumTime;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   792
    dumTime.HomeTime();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   793
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   794
    TPosition pos;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   795
    pos.SetTime(dumTime);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   796
    CHECK_EQUAL_(dumTime, pos.Time());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   797
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   798
    // current time
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   799
    TPosition position;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   800
    position.SetCurrentTime();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   801
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   802
    TTime uniTime;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   803
    uniTime.UniversalTime();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   804
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   805
    TTimeIntervalSeconds last;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   806
    uniTime.SecondsFrom(position.Time(), last);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   807
    CHECK(last <= TTimeIntervalSeconds(1));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   808
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   809
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   810
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   811
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   812
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   813
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   814
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   815
// TPositionInfo
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   816
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   817
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   818
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   819
// 3.1.1. TPositionInfo construction
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   820
void CDataClassesStep::TPositionInfo_ConstructionL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   821
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   822
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   823
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   824
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   825
    TPositionInfo posInfo;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   826
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   827
    // position
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   828
    TPosition pos;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   829
    posInfo.GetPosition(pos);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   830
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   831
    CHECK(Math::IsNaN(pos.Latitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   832
    CHECK(Math::IsNaN(pos.Longitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   833
    CHECK(Math::IsNaN(pos.Altitude()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   834
    CHECK(Math::IsNaN(pos.HorizontalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   835
    CHECK(Math::IsNaN(pos.VerticalAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   836
    CHECK_EQUAL_(TTime(0), pos.Time());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   837
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   838
    // From Base
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   839
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   840
    // class type
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   841
    CHECK(posInfo.PositionClassType() == EPositionInfoClass);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   842
    CHECK(posInfo.PositionClassSize() == sizeof(TPositionInfo));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   843
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   844
    // module id
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   845
    CHECK_EQUAL_((TInt)posInfo.ModuleId().iUid, (TInt)KPositionNullModuleId.iUid);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   846
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   847
    // update info
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   848
    CHECK(posInfo.UpdateType() == EPositionUpdateGeneral);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   849
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   850
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   851
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   852
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   853
// 3.1.2. TPositionInfo modification
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   854
void CDataClassesStep::TPositionInfo_ModificationL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   855
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   856
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   857
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   858
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   859
    const TReal64 dumLat = 11.111;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   860
    const TReal64 dumLon = 22.222;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   861
    const TReal32 dumAlt = TReal32(33.333);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   862
    const TReal32 dumHorAcc = TReal32(0.444);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   863
    const TReal32 dumVerAcc = TReal32(0.555);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   864
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   865
    TTime dumTime;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   866
    dumTime.HomeTime();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   867
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   868
    TPositionInfo posInfo;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   869
    TCoordinate dumCoordinate = TCoordinate(dumLat, dumLon, dumAlt);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   870
    TLocality dumLocality = TLocality(dumCoordinate, dumHorAcc, dumVerAcc);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   871
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   872
    // position
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   873
    TPosition pos(dumLocality, dumTime);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   874
    posInfo.SetPosition(pos);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   875
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   876
    TPosition pos2;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   877
    posInfo.GetPosition(pos2);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   878
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   879
    CHECK_REAL_EQUAL(pos2.Latitude(),  pos.Latitude());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   880
    CHECK_REAL_EQUAL(pos2.Longitude(), pos.Longitude());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   881
    CHECK_REAL_EQUAL(pos2.Altitude(),  pos.Altitude());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   882
    CHECK_REAL_EQUAL(pos2.HorizontalAccuracy(), pos.HorizontalAccuracy());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   883
    CHECK_REAL_EQUAL(pos2.VerticalAccuracy(),   pos.VerticalAccuracy());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   884
    CHECK_EQUAL_(pos2.Time(), pos.Time());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   885
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   886
    // From Base
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   887
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   888
    // module id
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   889
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   890
    const TPositionModuleId dumModId = {0x12345678};
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   891
    posInfo.SetModuleId(dumModId);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   892
    CHECK_EQUAL_((TInt)dumModId.iUid, (TInt)posInfo.ModuleId().iUid);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   893
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   894
    // update info
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   895
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   896
    posInfo.SetUpdateType(EPositionUpdateUnknown);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   897
    CHECK(posInfo.UpdateType() == EPositionUpdateUnknown);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   898
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   899
    posInfo.SetUpdateType(EPositionUpdateGeneral);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   900
    CHECK(posInfo.UpdateType() == EPositionUpdateGeneral);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   901
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   902
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   903
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   904
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   905
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   906
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   907
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   908
// Course classes
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   909
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   910
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   911
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   912
// 4.1.1. Construction
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   913
void CDataClassesStep::CourseClasses_ConstructionL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   914
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   915
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   916
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   917
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   918
    // course
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   919
    TCourse course;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   920
    CHECK(Math::IsNaN(course.Speed()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   921
    CHECK(Math::IsNaN(course.Heading()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   922
    CHECK(Math::IsNaN(course.SpeedAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   923
    CHECK(Math::IsNaN(course.HeadingAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   924
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   925
        // course info
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   926
    TPositionCourseInfo courseInfo;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   927
    CHECK(courseInfo.PositionClassType()==(EPositionInfoClass|EPositionCourseInfoClass));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   928
    CHECK_EQUAL_(courseInfo.PositionClassSize(), sizeof(TPositionCourseInfo));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   929
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   930
    CHECK_EQUAL_((TInt)courseInfo.ModuleId().iUid, (TInt)KPositionNullModuleId.iUid);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   931
    CHECK(courseInfo.UpdateType() == EPositionUpdateGeneral);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   932
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   933
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   934
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   935
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   936
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   937
// 4.1.2. Modification
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   938
void CDataClassesStep::CourseClasses_ModificationL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   939
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   940
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   941
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   942
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   943
    const TReal32 KDummyValue1 = (TReal32)43.342;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   944
    const TReal32 KDummyValue2 = (TReal32)34.5236;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   945
    const TReal32 KDummyValue3 = (TReal32)983.45;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   946
    const TReal32 KDummyValue4 = (TReal32)12.432;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   947
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   948
    TCourse course;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   949
    course.SetSpeed(KDummyValue1);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   950
    course.SetHeading(KDummyValue2);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   951
    course.SetSpeedAccuracy(KDummyValue3);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   952
    course.SetHeadingAccuracy(KDummyValue4);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   953
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   954
    CHECK_REAL_EQUAL(course.Speed(), KDummyValue1);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   955
    CHECK_REAL_EQUAL(course.Heading(), KDummyValue2);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   956
    CHECK_REAL_EQUAL(course.SpeedAccuracy(), KDummyValue3);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   957
    CHECK_REAL_EQUAL(course.HeadingAccuracy(), KDummyValue4);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   958
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   959
    TCourse course2;        //Use new course object so we can be sure data is transfered properly
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   960
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   961
    TPositionCourseInfo courseInfo;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   962
    courseInfo.SetCourse(course);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   963
        courseInfo.GetCourse(course2);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   964
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   965
    CHECK_REAL_EQUAL(course2.Speed(), KDummyValue1);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   966
    CHECK_REAL_EQUAL(course2.Heading(), KDummyValue2);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   967
    CHECK_REAL_EQUAL(course2.SpeedAccuracy(), KDummyValue3);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   968
    CHECK_REAL_EQUAL(course2.HeadingAccuracy(), KDummyValue4);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   969
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   970
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   971
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   972
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   973
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   974
// 4.1.3. NaNs
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   975
TInt CourseClasses_Setters_with_NANs(TAny* /*aPtr*/)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   976
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   977
    TRealX nan;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   978
    nan.SetNaN();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   979
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   980
    TCourse course;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   981
    course.SetSpeed(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   982
    course.SetHeading(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   983
    course.SetCourse(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   984
    course.SetSpeedAccuracy(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   985
    course.SetHeadingAccuracy(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   986
    course.SetCourseAccuracy(nan);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   987
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   988
    CHECK_PANIC(Math::IsNaN(course.Speed()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   989
    CHECK_PANIC(Math::IsNaN(course.Heading()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   990
    CHECK_PANIC(Math::IsNaN(course.Course()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   991
    CHECK_PANIC(Math::IsNaN(course.SpeedAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   992
    CHECK_PANIC(Math::IsNaN(course.HeadingAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   993
    CHECK_PANIC(Math::IsNaN(course.CourseAccuracy()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   994
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   995
    return KErrNone;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   996
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   997
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   998
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   999
void CDataClassesStep::CourseClasses_Modification2L()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1000
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1001
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1002
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1003
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1004
    DO_PANIC_TEST_L(CourseClasses_Setters_with_NANs,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1005
        KNoClientFault, KErrNone, KDefaultTestTimeout);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1006
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1007
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1008
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1009
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1010
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1011
// 4.1.4. Invalid values
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1012
TInt CourseClasses_Invalid_Input_HeadAcc(TAny* /*aPtr*/)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1013
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1014
    TCourse course;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1015
    course.SetHeadingAccuracy(TReal32(-0.1));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1016
    return KErrGeneral;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1017
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1018
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1019
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1020
TInt CourseClasses_Invalid_Input_SpeedAcc(TAny* /*aPtr*/)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1021
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1022
    TCourse course;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1023
    course.SetSpeedAccuracy(TReal32(-0.1));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1024
    return KErrGeneral;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1025
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1026
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1027
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1028
void CDataClassesStep::CourseClasses_InvalidL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1029
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1030
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1031
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1032
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1033
    DO_PANIC_TEST_L(CourseClasses_Invalid_Input_HeadAcc,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1034
        KPosClientFault, EPositionBadAccuracy, KDefaultTestTimeout);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1035
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1036
    DO_PANIC_TEST_L(CourseClasses_Invalid_Input_SpeedAcc,
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1037
        KPosClientFault, EPositionBadAccuracy, KDefaultTestTimeout);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1038
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1039
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1040
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1041
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1042
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1043
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1044
// Satellite classes
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1045
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1046
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1047
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1048
// 4.3.1. Construction
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1049
void CDataClassesStep::SatelliteClasses_ConstructionL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1050
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1051
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1052
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1053
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1054
    // satellite
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1055
    TSatelliteData satData;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1056
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1057
    CHECK_EQUAL_(-1, satData.SatelliteId());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1058
    CHECK(Math::IsNaN(satData.Azimuth()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1059
    CHECK(Math::IsNaN(satData.Elevation()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1060
    CHECK(!satData.IsUsed());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1061
    CHECK_EQUAL_(0, satData.SignalStrength());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1062
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1063
	//Sizeof(class) not always same in emulator and hardware as alignment restriction in hardware.
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1064
    #if defined(_DEBUG) 
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1065
	// Check the size of the TPositionSatelliteInfo class is unchanged
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1066
    CHECK_EQUAL_(KPositionSatelliteInfoSize, sizeof(TPositionSatelliteInfo));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1067
    #endif 
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1068
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1069
	// satellite info
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1070
    TPositionSatelliteInfo satInfo;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1071
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1072
    CHECK_EQUAL_(KErrNotFound, satInfo.GetSatelliteData(0, satData));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1073
    CHECK_EQUAL_(0, satInfo.NumSatellitesInView());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1074
    CHECK_EQUAL_(0, satInfo.NumSatellitesUsed());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1075
    CHECK(TTime(0) == satInfo.SatelliteTime());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1076
    CHECK(Math::IsNaN(satInfo.HorizontalDoP()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1077
    CHECK(Math::IsNaN(satInfo.VerticalDoP()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1078
    CHECK(Math::IsNaN(satInfo.TimeDoP()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1079
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1080
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1081
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1082
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1083
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1084
// 4.3.2. Properties
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1085
void CDataClassesStep::SatelliteClasses_PropertiesL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1086
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1087
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1088
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1089
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1090
    TSatelliteData satData;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1091
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1092
    const TInt dumSatelliteId = 11111;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1093
    const TInt dumSignalStrength = 22222;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1094
    const TReal32 dumAzimuth = TReal32(234.2345);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1095
    const TReal32 dumElevation = TReal32(4745.1231);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1096
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1097
    satData.SetSignalStrength(dumSignalStrength);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1098
    satData.SetSatelliteId(dumSatelliteId);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1099
    satData.SetAzimuth(dumAzimuth);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1100
    satData.SetElevation(dumElevation);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1101
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1102
    CHECK_EQUAL_(dumSatelliteId,     satData.SatelliteId());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1103
    CHECK_EQUAL_(dumSignalStrength,  satData.SignalStrength());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1104
    CHECK_REAL_EQUAL(dumAzimuth,    satData.Azimuth());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1105
    CHECK_REAL_EQUAL(dumElevation,  satData.Elevation());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1106
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1107
    satData.SetIsUsed(ETrue);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1108
    CHECK(satData.IsUsed());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1109
    satData.SetIsUsed(EFalse);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1110
    CHECK(!satData.IsUsed());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1111
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1112
    TPositionSatelliteInfo satInfo;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1113
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1114
    const TTime dumSatTime(TInt64(54));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1115
    const TReal32 dumHorzDoP = (TReal32) 345.2131;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1116
    const TReal32 dumVertDoP = (TReal32) 34.1;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1117
    const TReal32 dumTimeDoP = (TReal32) 876.68;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1118
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1119
    satInfo.SetSatelliteTime(dumSatTime);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1120
    satInfo.SetHorizontalDoP(dumHorzDoP);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1121
    satInfo.SetVerticalDoP(dumVertDoP);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1122
    satInfo.SetTimeDoP(dumTimeDoP);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1123
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1124
    CHECK_REAL_EQUAL(dumHorzDoP,    satInfo.HorizontalDoP());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1125
    CHECK_REAL_EQUAL(dumVertDoP,    satInfo.VerticalDoP());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1126
    CHECK_REAL_EQUAL(dumTimeDoP,    satInfo.TimeDoP());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1127
    CHECK_EQUAL_(     dumSatTime,    satInfo.SatelliteTime());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1128
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1129
    TPositionExtendedSatelliteInfo extSatInfo;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1130
    TGpsTimingMeasurementData gpsTimingData;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1131
           
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1132
    // all max values for UTran/Fdd 
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1133
    const TInt dumGpsTocMs  = (TInt) 16383;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1134
    const TUint dumGpsTocLs = (TUint) 4294967295UL;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1135
    const TInt dumRefId     = (TInt) 511;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1136
    const TInt dumSfn       = (TInt) 4095;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1137
   
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1138
    gpsTimingData.SetDataType(TGpsTimingMeasurementData::EGpsTimingDataTypeUtran);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1139
    gpsTimingData.SetNetworkMode(TGpsTimingMeasurementData::ENetworkModeFdd);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1140
    gpsTimingData.SetGPSTimingOfCellMsPart(dumGpsTocMs);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1141
    gpsTimingData.SetGPSTimingOfCellLsPart(dumGpsTocLs);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1142
    gpsTimingData.SetReferenceIdentity(dumRefId);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1143
    gpsTimingData.SetSfn(dumSfn);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1144
       
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1145
    extSatInfo.SetGpsTimingData(gpsTimingData);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1146
       
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1147
    TGpsTimingMeasurementData gpsTimingDataReturned;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1148
    CHECK_EQUAL_(KErrNone, extSatInfo.GetGpsTimingData(gpsTimingDataReturned));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1149
      
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1150
    CHECK_EQUAL_(TGpsTimingMeasurementData::EGpsTimingDataTypeUtran, gpsTimingData.DataType());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1151
    CHECK_EQUAL_(TGpsTimingMeasurementData::ENetworkModeFdd, gpsTimingData.NetworkMode());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1152
    CHECK_EQUAL_(dumGpsTocMs, gpsTimingDataReturned.GPSTimingOfCellMsPart());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1153
    CHECK_EQUAL_(dumGpsTocLs, gpsTimingDataReturned.GPSTimingOfCellLsPart());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1154
    CHECK_EQUAL_(dumRefId,    gpsTimingDataReturned.ReferenceIdentity());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1155
    CHECK_EQUAL_(dumSfn,      gpsTimingDataReturned.Sfn());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1156
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1157
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1158
    TGpsTimingMeasurementData gpsTimingData2;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1159
   
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1160
    // all max values for GSM 
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1161
    const TInt refFrameMsb      = (TInt) 63;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1162
    const TInt gpsTowSubms      = (TInt) 9999;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1163
    const TInt deltaTow         = (TInt) 127;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1164
    const TInt gpsRefTimeUncert = (TInt) 127;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1165
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1166
    gpsTimingData2.SetDataType(TGpsTimingMeasurementData::EGpsTimingDataTypeGsm);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1167
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1168
    // check default GSM values
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1169
    CHECK_EQUAL_(TGpsTimingMeasurementData::EGpsTimingDataTypeGsm, gpsTimingData2.DataType());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1170
    CHECK_EQUAL_(0,            gpsTimingData2.ReferenceFrameMsb());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1171
    CHECK_EQUAL_(KErrNotFound, gpsTimingData2.GpsTowSubms());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1172
    CHECK_EQUAL_(KErrNotFound, gpsTimingData2.DeltaTow());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1173
    CHECK_EQUAL_(KErrNotFound, gpsTimingData2.GpsReferenceTimeUncertainty());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1174
   
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1175
    // update values
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1176
    gpsTimingData2.SetReferenceFrameMsb(refFrameMsb);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1177
    gpsTimingData2.SetGpsTowSubms(gpsTowSubms);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1178
    gpsTimingData2.SetDeltaTow(deltaTow);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1179
    gpsTimingData2.SetGpsReferenceTimeUncertainty(gpsRefTimeUncert);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1180
   
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1181
    CHECK_EQUAL_(refFrameMsb,      gpsTimingData2.ReferenceFrameMsb());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1182
    CHECK_EQUAL_(gpsTowSubms,      gpsTimingData2.GpsTowSubms());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1183
    CHECK_EQUAL_(deltaTow,         gpsTimingData2.DeltaTow());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1184
    CHECK_EQUAL_(gpsRefTimeUncert, gpsTimingData2.GpsReferenceTimeUncertainty());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1185
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1186
       
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1187
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1188
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1189
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1190
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1191
// 4.3.3. Properties with NANs
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1192
void CDataClassesStep::SatelliteClasses_Properties2L()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1193
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1194
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1195
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1196
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1197
    TRealX nan;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1198
    nan.SetNaN();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1199
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1200
    TSatelliteData satData;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1201
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1202
    const TReal32 dumAzimuth = nan;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1203
    const TReal32 dumElevation = nan;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1204
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1205
    satData.SetAzimuth(dumAzimuth);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1206
    satData.SetElevation(dumElevation);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1207
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1208
    CHECK(Math::IsNaN(satData.Azimuth()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1209
    CHECK(Math::IsNaN(satData.Elevation()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1210
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1211
    TPositionSatelliteInfo satInfo;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1212
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1213
    const TReal32 dumHorzDoP = nan;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1214
    const TReal32 dumVertDoP = nan;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1215
    const TReal32 dumTimeDoP = nan;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1216
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1217
    satInfo.SetHorizontalDoP(dumHorzDoP);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1218
    satInfo.SetVerticalDoP(dumVertDoP);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1219
    satInfo.SetTimeDoP(dumTimeDoP);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1220
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1221
    CHECK(Math::IsNaN(satInfo.HorizontalDoP()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1222
    CHECK(Math::IsNaN(satInfo.VerticalDoP()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1223
    CHECK(Math::IsNaN(satInfo.TimeDoP()));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1224
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1225
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1226
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1227
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1228
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1229
// 4.3.4.   TPositionSatelliteInfo accepts TSatelliteData
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1230
void CDataClassesStep::SatelliteClasses_InfoL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1231
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1232
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1233
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1234
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1235
    TSatelliteData satData;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1236
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1237
    const TInt dumSatelliteId = 11111;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1238
    const TInt dumSignalStrength = 22222;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1239
    const TReal32 dumAzimuth = TReal32(111.111);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1240
    const TReal32 dumElevation = TReal32(222.222);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1241
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1242
    satData.SetSignalStrength(dumSignalStrength);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1243
    satData.SetSatelliteId(dumSatelliteId);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1244
    satData.SetAzimuth(dumAzimuth);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1245
    satData.SetElevation(dumElevation);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1246
    satData.SetIsUsed(ETrue);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1247
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1248
    TPositionSatelliteInfo satInfo;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1249
    TSatelliteData satData2;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1250
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1251
    // append data
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1252
    satInfo.AppendSatelliteData(satData);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1253
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1254
    CHECK_EQUAL_(1,        satInfo.NumSatellitesInView());                //Have added 1 satellite
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1255
    CHECK_EQUAL_(KErrNone, satInfo.GetSatelliteData(0, satData2));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1256
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1257
    // check data
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1258
    CHECK_EQUAL_(dumSatelliteId,     satData2.SatelliteId());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1259
    CHECK_EQUAL_(dumSignalStrength,  satData2.SignalStrength());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1260
    CHECK_REAL_EQUAL(dumAzimuth,    satData2.Azimuth());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1261
    CHECK_REAL_EQUAL(dumElevation,  satData2.Elevation());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1262
    CHECK(satData2.IsUsed());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1263
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1264
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1265
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1266
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1267
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1268
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1269
//  Satellites list
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1270
//
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1271
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1272
// 4.4.1. Satellite data list integrity
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1273
void CDataClassesStep::SatelliteClasses_SatelliteInfoL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1274
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1275
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1276
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1277
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1278
    TSatelliteData satData, satData2;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1279
    TPositionSatelliteInfo satInfo;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1280
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1281
    // append data
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1282
    for (TInt ii = 0; (TUint)ii < KPositionMaxSatellitesInView; ii++)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1283
    	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1284
        TBool isUsed = ( ii % 2 != 0 );
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1285
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1286
        satData.SetIsUsed( isUsed );
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1287
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1288
        CHECK(KErrNotFound == satInfo.GetSatelliteData(ii, satData2));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1289
        CHECK_EQUAL_(KErrNone, satInfo.AppendSatelliteData(satData));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1290
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1291
        CHECK_EQUAL_(ii + 1,   satInfo.NumSatellitesInView());                //Have added 1 satellite
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1292
        CHECK_EQUAL_((ii+1)/2, satInfo.NumSatellitesUsed());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1293
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1294
        CHECK_EQUAL_(KErrNone, satInfo.GetSatelliteData(ii, satData2));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1295
        CHECK_EQUAL_(isUsed,   satData2.IsUsed());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1296
    	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1297
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1298
    satInfo.ClearSatellitesInView();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1299
    CHECK_EQUAL_(KErrNotFound, satInfo.GetSatelliteData(0, satData2));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1300
    CHECK_EQUAL_(0, satInfo.NumSatellitesInView());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1301
    CHECK_EQUAL_(0, satInfo.NumSatellitesUsed());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1302
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1303
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1304
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1305
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1306
// 4.4.2. Too much SatelliteData is added
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1307
void CDataClassesStep::SatelliteClasses_OverflowL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1308
	{
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1309
    DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1310
    StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1311
    
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1312
    TPositionSatelliteInfo satInfo;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1313
    TSatelliteData satData;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1314
    for (TInt i=0; i < static_cast<TInt>(KPositionMaxSatellitesInView); i++)
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1315
        {
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1316
        satData.SetSatelliteId(i);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1317
        CHECK_EQUAL_(KErrNone, satInfo.AppendSatelliteData(satData));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1318
        }
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1319
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1320
    CHECK_EQUAL_(KErrOverflow, satInfo.AppendSatelliteData(satData));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1321
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1322
    StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1323
	}
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1324
void CDataClassesStep::GpsMeasurementClasses_PropertiesL()
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1325
     {
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1326
     DECLARE_ERROR_LOGGING;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1327
     StandardPrepareL();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1328
     
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1329
     // Check the size of the TPositionGpsMeasurementInfo class is unchanged
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1330
     CHECK_EQUAL_(KPositionGpsMeasurementInfoSize, sizeof(TPositionGpsMeasurementInfo));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1331
     
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1332
     TPositionGpsMeasurementInfo gpsMeasurementInfo;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1333
     TGpsTimingMeasurementData gpsTimingData;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1334
     
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1335
     // all max values for UTran/Fdd 
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1336
     const TInt dumGpsTocMs  = (TInt) 16383;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1337
     const TUint dumGpsTocLs = (TUint) 4294967295UL; 
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1338
     const TInt dumRefId     = (TInt) 511;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1339
     const TInt dumSfn       = (TInt) 4095;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1340
     
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1341
     gpsTimingData.SetDataType(TGpsTimingMeasurementData::EGpsTimingDataTypeUtran);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1342
     gpsTimingData.SetNetworkMode(TGpsTimingMeasurementData::ENetworkModeFdd);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1343
     gpsTimingData.SetGPSTimingOfCellMsPart(dumGpsTocMs);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1344
     gpsTimingData.SetGPSTimingOfCellLsPart(dumGpsTocLs);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1345
     gpsTimingData.SetReferenceIdentity(dumRefId);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1346
     gpsTimingData.SetSfn(dumSfn);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1347
     
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1348
     gpsMeasurementInfo.SetGpsTimingData(gpsTimingData);
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1349
     
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1350
     TGpsTimingMeasurementData gpsTimingDataReturned;
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1351
     CHECK_EQUAL_(KErrNone, gpsMeasurementInfo.GetGpsTimingData(gpsTimingDataReturned));
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1352
     
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1353
     CHECK_EQUAL_(TGpsTimingMeasurementData::EGpsTimingDataTypeUtran, gpsTimingData.DataType());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1354
     CHECK_EQUAL_(TGpsTimingMeasurementData::ENetworkModeFdd, gpsTimingData.NetworkMode());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1355
     CHECK_EQUAL_(dumGpsTocMs, gpsTimingDataReturned.GPSTimingOfCellMsPart());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1356
     CHECK_EQUAL_(dumGpsTocLs, gpsTimingDataReturned.GPSTimingOfCellLsPart());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1357
     CHECK_EQUAL_(dumRefId,    gpsTimingDataReturned.ReferenceIdentity());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1358
     CHECK_EQUAL_(dumSfn,      gpsTimingDataReturned.Sfn());
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1359
     StandardCleanup();
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1360
     }
a4835904093b Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1361