author | Maciej Seroka <maciejs@symbian.org> |
Fri, 15 Oct 2010 11:54:08 +0100 (2010-10-15) | |
branch | Symbian3 |
changeset 74 | 08fe4219b8dd |
parent 54 | a4835904093b |
permissions | -rw-r--r-- |
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 ModuleClassesStep.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 "moduleclassesstep.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 <lbssatellite.h> |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
29 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
30 |
CModuleClassesStep::~CModuleClassesStep() |
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 |
* Destructor |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
33 |
*/ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
34 |
{ |
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 |
CModuleClassesStep::CModuleClassesStep() |
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 |
* Constructor |
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 |
// **MUST** call SetTestStepName in the constructor as the controlling |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
43 |
// 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
|
44 |
// up the step's unique logging ID. |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
45 |
SetTestStepName(KModuleClassesStep); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
46 |
} |
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 |
TVerdict CModuleClassesStep::doTestStepPreambleL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
49 |
/** |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
50 |
* @return - TVerdict code |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
51 |
* Override of base class virtual |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
52 |
*/ |
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 |
CTe_LbsApiSuiteStepBase::doTestStepPreambleL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
55 |
if (TestStepResult()!=EPass) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
56 |
return TestStepResult(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
57 |
// 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
|
58 |
SetTestStepResult(EPass); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
59 |
return TestStepResult(); |
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 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
62 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
63 |
TVerdict CModuleClassesStep::doTestStepL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
64 |
/** |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
65 |
* @return - TVerdict code |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
66 |
* Override of base class pure virtual |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
67 |
* 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
|
68 |
* 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
|
69 |
*/ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
70 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
71 |
if (TestStepResult()==EPass) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
72 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
73 |
TInt test; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
74 |
if(!GetIntFromConfig(ConfigSection(),KTe_LbsApiSuiteInt,test) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
75 |
) |
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 |
// Leave if there's any error. |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
78 |
User::Leave(KErrNotFound); |
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 |
SetTestStepResult(EPass); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
81 |
StartL(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 |
return TestStepResult(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
84 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
85 |
|
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 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
88 |
TVerdict CModuleClassesStep::doTestStepPostambleL() |
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 - TVerdict code |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
91 |
* Override of base class virtual |
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 |
return TestStepResult(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
95 |
} |
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 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
98 |
void CModuleClassesStep::StartL(TInt aIndex) |
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 |
switch (aIndex) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
101 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
102 |
case 0: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
103 |
TPositionModuleInfo_ConstructionL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
104 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
105 |
case 1: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
106 |
TPositionModuleInfo_GettersL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
107 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
108 |
case 2: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
109 |
TPositionModuleInfo_InvalidL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
110 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
111 |
case 3: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
112 |
TPositionQuality_ConstructionL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
113 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
114 |
case 4: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
115 |
TPositionQuality_SettersL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
116 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
117 |
case 5: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
118 |
TPositionQuality_InvalidL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
119 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
120 |
case 6: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
121 |
TPositionQuality_ComparisonL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
122 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
123 |
case 7: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
124 |
ModuleClasses_ConstructionL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
125 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
126 |
case 8: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
127 |
ModuleClasses_SettersL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
128 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
129 |
case 9: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
130 |
TPositionUpdateOptions_InvalidL (); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
131 |
break; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
132 |
default: |
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 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
135 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
136 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
137 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
138 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
139 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
140 |
// TPositionModuleInfo |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
141 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
142 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
143 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
144 |
// 6.1.1. Construction |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
145 |
void CModuleClassesStep::TPositionModuleInfo_ConstructionL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
146 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
147 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
148 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
149 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
150 |
TPositionModuleInfo posModInfo; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
151 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
152 |
CHECK_EQUAL_(sizeof(TPositionModuleInfo), posModInfo.PositionClassSize()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
153 |
CHECK(EPositionModuleInfoClass == posModInfo.PositionClassType()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
154 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
155 |
CHECK(KPositionNullModuleId.iUid == posModInfo.ModuleId().iUid); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
156 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
157 |
TPositionQuality posQuality; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
158 |
posModInfo.GetPositionQuality(posQuality); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
159 |
CHECK(Math::IsNaN(posQuality.HorizontalAccuracy())); // new pos quality |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
160 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
161 |
CHECK(!posModInfo.IsAvailable()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
162 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
163 |
TBuf<KPositionMaxModuleName> moduleName; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
164 |
posModInfo.GetModuleName(moduleName); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
165 |
CHECK_EQUAL_(0, moduleName.Length()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
166 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
167 |
CHECK_EQUAL_(TPositionModuleInfo::TTechnologyType(TPositionModuleInfo::ETechnologyUnknown), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
168 |
posModInfo.TechnologyType()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
169 |
CHECK_EQUAL_(TPositionModuleInfo::TDeviceLocation(TPositionModuleInfo::EDeviceUnknown), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
170 |
posModInfo.DeviceLocation()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
171 |
CHECK_EQUAL_(TPositionModuleInfo::TCapabilities(TPositionModuleInfo::ECapabilityNone), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
172 |
posModInfo.Capabilities()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
173 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
174 |
for(TInt i=0; i<EPositionLastFamily; i++) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
175 |
CHECK(0 == posModInfo.ClassesSupported(TPositionClassFamily(i))); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
176 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
177 |
TVersion version = posModInfo.Version(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
178 |
TVersion defaultVersion; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
179 |
CHECK_EQUAL_(version.iMajor, defaultVersion.iMajor); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
180 |
CHECK_EQUAL_(version.iMinor, defaultVersion.iMinor); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
181 |
CHECK_EQUAL_(version.iBuild, defaultVersion.iBuild); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
182 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
183 |
StandardCleanup(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
184 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
185 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
186 |
// 6.1.2. Set and Get |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
187 |
void CModuleClassesStep::TPositionModuleInfo_GettersL() |
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 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
190 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
191 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
192 |
TPositionModuleInfo posModInfo; |
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 |
const TPositionModuleId KDummyModuleId = {0x32}; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
195 |
posModInfo.SetModuleId(KDummyModuleId); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
196 |
CHECK_EQUAL_(KDummyModuleId.iUid, posModInfo.ModuleId().iUid); |
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 |
posModInfo.SetIsAvailable(ETrue); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
199 |
CHECK(posModInfo.IsAvailable()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
200 |
posModInfo.SetIsAvailable(EFalse); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
201 |
CHECK(!posModInfo.IsAvailable()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
202 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
203 |
_LIT(KDummyModuleName, "Testing 1,2,3"); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
204 |
posModInfo.SetModuleName(KDummyModuleName); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
205 |
TBuf<KPositionMaxModuleName> tempBuf; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
206 |
posModInfo.GetModuleName(tempBuf); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
207 |
CHECK(0 == tempBuf.Compare(KDummyModuleName)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
208 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
209 |
TPositionQuality quality, quality2; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
210 |
const TPositionQuality::TCostIndicator KDummyCostIndicator = TPositionQuality::ECostCharge; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
211 |
quality.SetCostIndicator(KDummyCostIndicator); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
212 |
posModInfo.SetPositionQuality(quality); |
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 |
posModInfo.GetPositionQuality(quality2); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
215 |
CHECK_EQUAL_(KDummyCostIndicator, quality2.CostIndicator()); |
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 |
posModInfo.SetTechnologyType(TPositionModuleInfo::ETechnologyNetwork); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
218 |
posModInfo.SetDeviceLocation(TPositionModuleInfo::EDeviceExternal); |
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 |
CHECK_EQUAL_(TPositionModuleInfo::TTechnologyType(TPositionModuleInfo::ETechnologyNetwork), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
221 |
posModInfo.TechnologyType()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
222 |
CHECK_EQUAL_(TPositionModuleInfo::TDeviceLocation(TPositionModuleInfo::EDeviceExternal), |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
223 |
posModInfo.DeviceLocation()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
224 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
225 |
const TPositionModuleInfo::TCapabilities KDummyCaps = |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
226 |
TPositionModuleInfo::ECapabilitySpeed | |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
227 |
TPositionModuleInfo::ECapabilityNmea; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
228 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
229 |
posModInfo.SetCapabilities(KDummyCaps); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
230 |
CHECK_EQUAL_(KDummyCaps, posModInfo.Capabilities()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
231 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
232 |
for(TUint i=0; i<EPositionLastFamily; i++) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
233 |
posModInfo.SetClassesSupported(TPositionClassFamily(i), 2*i); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
234 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
235 |
for(TUint j=0; j<EPositionLastFamily; j++) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
236 |
CHECK(2*j == posModInfo.ClassesSupported(TPositionClassFamily(j))); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
237 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
238 |
TVersion KDummyVersion(12,31,45); //Should be const, but Name isn't a const method for some reason! |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
239 |
posModInfo.SetVersion(KDummyVersion); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
240 |
CHECK(posModInfo.Version().Name()==KDummyVersion.Name()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
241 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
242 |
StandardCleanup(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
243 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
244 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
245 |
// 6.1.3. Invalid calls to Setters |
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 |
TInt Set_Bad_Class_Type_TPositionModuleInfo(TAny* /*aPtr*/) |
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 |
TPositionModuleInfo modInfo; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
250 |
modInfo.SetClassesSupported(EPositionLastFamily, 0); //This should panic |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
251 |
return KErrGeneral; |
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 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
254 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
255 |
TInt Get_Bad_Class_Type_TPositionModuleInfo(TAny* /*aPtr*/) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
256 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
257 |
TPositionModuleInfo modInfo; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
258 |
(void)modInfo.ClassesSupported(EPositionLastFamily); //This should panic |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
259 |
return KErrGeneral; |
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 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
262 |
void CModuleClassesStep::TPositionModuleInfo_InvalidL() |
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 |
DO_PANIC_TEST_L(Set_Bad_Class_Type_TPositionModuleInfo, KPosClientFault, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
268 |
EPositionInvalidClassType, KDefaultTestTimeout); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
269 |
DO_PANIC_TEST_L(Get_Bad_Class_Type_TPositionModuleInfo, KPosClientFault, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
270 |
EPositionInvalidClassType, KDefaultTestTimeout); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
271 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
272 |
StandardCleanup(); |
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 |
|
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 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
277 |
// TPositionQuality |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
278 |
// |
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 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
281 |
// 6.2.1. Construction |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
282 |
void CModuleClassesStep::TPositionQuality_ConstructionL() |
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 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
285 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
286 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
287 |
TPositionQuality quality; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
288 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
289 |
CHECK(Math::IsNaN(quality.HorizontalAccuracy())); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
290 |
CHECK(Math::IsNaN(quality.VerticalAccuracy())); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
291 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
292 |
CHECK(quality.PositionClassSize() == sizeof(TPositionQuality)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
293 |
CHECK(quality.PositionClassType() == EPositionQualityClass); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
294 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
295 |
CHECK(quality.TimeToFirstFix() == TTimeIntervalMicroSeconds(TInt64(0))); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
296 |
CHECK(quality.TimeToNextFix() == TTimeIntervalMicroSeconds(TInt64(0))); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
297 |
CHECK(quality.CostIndicator() == TPositionQuality::ECostUnknown); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
298 |
CHECK(quality.PowerConsumption() == TPositionQuality::EPowerUnknown); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
299 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
300 |
StandardCleanup(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
301 |
} |
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 |
// 6.2.2. Getter and Setters |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
304 |
void CModuleClassesStep::TPositionQuality_SettersL() |
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 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
307 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
308 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
309 |
TPositionQuality posQuality; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
310 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
311 |
// "time to" fixes |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
312 |
const TTimeIntervalMicroSeconds KTTFF(3425234); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
313 |
const TTimeIntervalMicroSeconds KTTNF(45256265); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
314 |
const TReal32 KHorizontalAccuracy(TReal32(34252.23452)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
315 |
const TReal32 KVerticalAccuracy(TReal32(423.456563)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
316 |
const TPositionQuality::TCostIndicator KDummyCost(TPositionQuality::ECostPossible); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
317 |
const TPositionQuality::TPowerConsumption KDummyPowerConsumption(TPositionQuality::EPowerMedium); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
318 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
319 |
posQuality.SetTimeToFirstFix(KTTFF); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
320 |
posQuality.SetTimeToNextFix(KTTNF); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
321 |
posQuality.SetHorizontalAccuracy(KHorizontalAccuracy); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
322 |
posQuality.SetVerticalAccuracy(KVerticalAccuracy); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
323 |
posQuality.SetCostIndicator(KDummyCost); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
324 |
posQuality.SetPowerConsumption(KDummyPowerConsumption); |
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 |
CHECK_EQUAL_(posQuality.TimeToFirstFix().Int64(), KTTFF.Int64()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
327 |
CHECK_EQUAL_(posQuality.TimeToNextFix().Int64(), KTTNF.Int64()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
328 |
CHECK_EQUAL_(posQuality.HorizontalAccuracy(), KHorizontalAccuracy); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
329 |
CHECK_EQUAL_(posQuality.VerticalAccuracy(), KVerticalAccuracy); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
330 |
CHECK_EQUAL_(posQuality.CostIndicator(), KDummyCost); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
331 |
CHECK_EQUAL_(posQuality.PowerConsumption(), KDummyPowerConsumption); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
332 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
333 |
// NaNs |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
334 |
TRealX nan; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
335 |
nan.SetNaN(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
336 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
337 |
posQuality.SetHorizontalAccuracy(nan); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
338 |
posQuality.SetVerticalAccuracy(nan); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
339 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
340 |
CHECK(Math::IsNaN(posQuality.HorizontalAccuracy())); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
341 |
CHECK(Math::IsNaN(posQuality.VerticalAccuracy())); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
342 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
343 |
// "Zeroes" |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
344 |
posQuality.SetTimeToFirstFix(TTimeIntervalMicroSeconds(0)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
345 |
posQuality.SetTimeToNextFix(TTimeIntervalMicroSeconds(0)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
346 |
posQuality.SetCostIndicator(TPositionQuality::ECostUnknown); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
347 |
posQuality.SetPowerConsumption(TPositionQuality::EPowerUnknown); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
348 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
349 |
CHECK_EQUAL_(posQuality.TimeToFirstFix().Int64(), TInt64(0)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
350 |
CHECK_EQUAL_(posQuality.TimeToNextFix().Int64(), TInt64(0)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
351 |
CHECK_EQUAL_(posQuality.CostIndicator(), TPositionQuality::ECostUnknown); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
352 |
CHECK_EQUAL_(posQuality.PowerConsumption(), TPositionQuality::EPowerUnknown); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
353 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
354 |
StandardCleanup(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
355 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
356 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
357 |
// 6.2.3. Invalid Input |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
358 |
TInt TPositionQuality_Set_Negative_HAccuracy(TAny* /*aPtr*/) |
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 |
TPositionQuality quality; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
361 |
quality.SetHorizontalAccuracy(TReal32(-0.1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
362 |
return KErrGeneral; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
363 |
} |
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 |
TInt TPositionQuality_Set_Negative_VAccuracy(TAny* /*aPtr*/) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
367 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
368 |
TPositionQuality quality; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
369 |
quality.SetVerticalAccuracy(TReal32(-0.1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
370 |
return KErrGeneral; |
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 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
373 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
374 |
TInt TPositionQuality_Set_Negative_TTFirstFix(TAny* /*aPtr*/) |
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 |
TPositionQuality quality; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
377 |
quality.SetTimeToFirstFix(TTimeIntervalMicroSeconds(-1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
378 |
return KErrGeneral; |
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 |
|
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 |
TInt TPositionQuality_Set_Negative_TTNextFix(TAny* /*aPtr*/) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
383 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
384 |
TPositionQuality quality; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
385 |
quality.SetTimeToNextFix(TTimeIntervalMicroSeconds(-1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
386 |
return KErrGeneral; |
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 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
389 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
390 |
void CModuleClassesStep::TPositionQuality_InvalidL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
391 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
392 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
393 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
394 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
395 |
DO_PANIC_TEST_L(TPositionQuality_Set_Negative_HAccuracy, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
396 |
KPosClientFault, EPositionBadAccuracy, KDefaultTestTimeout); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
397 |
DO_PANIC_TEST_L(TPositionQuality_Set_Negative_VAccuracy, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
398 |
KPosClientFault, EPositionBadAccuracy, KDefaultTestTimeout); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
399 |
DO_PANIC_TEST_L(TPositionQuality_Set_Negative_TTFirstFix, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
400 |
KPosClientFault, EPositionBadTime, KDefaultTestTimeout); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
401 |
DO_PANIC_TEST_L(TPositionQuality_Set_Negative_TTNextFix, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
402 |
KPosClientFault, EPositionBadTime, KDefaultTestTimeout); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
403 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
404 |
StandardCleanup(); |
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 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
407 |
// 6.2.4 Element Comparison |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
408 |
#define SET_ELEMENT(aId, aType, aPref, aData) \ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
409 |
if (aId < KPositionMaxSectionFields) SetElement(aId, aType, aPref, aData); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
410 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
411 |
#pragma warning (push) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
412 |
#pragma warning (disable: 4127) |
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 |
void CModuleClassesStep::TPositionQuality_ComparisonL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
415 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
416 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
417 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
418 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
419 |
TPositionQuality q1, q2; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
420 |
TPositionQualityItem::TResult result; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
421 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
422 |
// set high values |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
423 |
q1.SetTimeToFirstFix( TTimeIntervalMicroSeconds(20000)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
424 |
q1.SetTimeToNextFix( TTimeIntervalMicroSeconds(10000)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
425 |
q1.SetHorizontalAccuracy( TReal32(1000)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
426 |
q1.SetVerticalAccuracy( TReal32(2000)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
427 |
q1.SetCostIndicator( TPositionQuality::ECostCharge); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
428 |
q1.SetPowerConsumption( TPositionQuality::EPowerHigh); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
429 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
430 |
// set low values |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
431 |
q2.SetTimeToFirstFix( TTimeIntervalMicroSeconds(2)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
432 |
q2.SetTimeToNextFix( TTimeIntervalMicroSeconds(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
433 |
q2.SetHorizontalAccuracy( TReal32(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
434 |
q2.SetVerticalAccuracy( TReal32(2)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
435 |
q2.SetCostIndicator( TPositionQuality::ECostZero); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
436 |
q2.SetPowerConsumption( TPositionQuality::EPowerZero); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
437 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
438 |
for (TInt i = 0; i < q1.HighWaterMark() + 1; i++) |
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 |
q1.Compare(q2, i, result); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
441 |
CHECK_EQUAL_(TPositionQualityItem::EIsBetter, result); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
442 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
443 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
444 |
// more common test :-) |
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 |
class TBigQuality1 : public TPositionQualityBase { |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
447 |
public: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
448 |
TBigQuality1() |
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 |
SET_ELEMENT(0, TPositionQualityItem::EUndefined, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
451 |
TPositionQualityItem::EPreferGreaterValues, TInt8(100)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
452 |
SET_ELEMENT(1, TPositionQualityItem::ETInt8, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
453 |
TPositionQualityItem::EPreferSmallerValues, TInt8(100)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
454 |
SET_ELEMENT(2, TPositionQualityItem::ETInt16, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
455 |
TPositionQualityItem::EPreferGreaterValues, TInt16(100)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
456 |
SET_ELEMENT(3, TPositionQualityItem::ETInt32, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
457 |
TPositionQualityItem::EPreferSmallerValues, TInt32(100)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
458 |
SET_ELEMENT(4, TPositionQualityItem::ETInt64, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
459 |
TPositionQualityItem::EPreferGreaterValues, TInt64(100)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
460 |
SET_ELEMENT(5, TPositionQualityItem::ETUint8, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
461 |
TPositionQualityItem::EPreferSmallerValues, TUint8(100)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
462 |
SET_ELEMENT(6, TPositionQualityItem::ETUint16, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
463 |
TPositionQualityItem::EPreferGreaterValues, TUint16(100)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
464 |
SET_ELEMENT(7, TPositionQualityItem::ETUint32, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
465 |
TPositionQualityItem::EPreferSmallerValues, TUint32(100)); |
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 |
} bigQ1; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
468 |
class TBigQuality2 : public TPositionQualityBase { |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
469 |
public: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
470 |
TBigQuality2() |
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 |
SET_ELEMENT(0, TPositionQualityItem::ETReal32, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
473 |
TPositionQualityItem::EPreferGreaterValues, TReal32(100)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
474 |
SET_ELEMENT(1, TPositionQualityItem::ETReal64, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
475 |
TPositionQualityItem::EPreferSmallerValues, TReal64(100)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
476 |
SET_ELEMENT(2,TPositionQualityItem::ETTime, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
477 |
TPositionQualityItem::EPreferGreaterValues, TTime(100)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
478 |
SET_ELEMENT(3,TPositionQualityItem::ETTimeIntervalMicroSeconds, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
479 |
TPositionQualityItem::EPreferSmallerValues, TTimeIntervalMicroSeconds(100)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
480 |
}; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
481 |
} bigQ2; |
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 |
class TLowQuality1 : public TPositionQualityBase { |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
484 |
public: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
485 |
TLowQuality1() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
486 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
487 |
SET_ELEMENT(0, TPositionQualityItem::EUndefined, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
488 |
TPositionQualityItem::EPreferGreaterValues, TInt8(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
489 |
SET_ELEMENT(1, TPositionQualityItem::ETInt8, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
490 |
TPositionQualityItem::EPreferSmallerValues, TInt8(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
491 |
SET_ELEMENT(2, TPositionQualityItem::ETInt16, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
492 |
TPositionQualityItem::EPreferGreaterValues, TInt16(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
493 |
SET_ELEMENT(3, TPositionQualityItem::ETInt32, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
494 |
TPositionQualityItem::EPreferSmallerValues, TInt32(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
495 |
SET_ELEMENT(4, TPositionQualityItem::ETInt64, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
496 |
TPositionQualityItem::EPreferGreaterValues, TInt64(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
497 |
SET_ELEMENT(5, TPositionQualityItem::ETUint8, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
498 |
TPositionQualityItem::EPreferSmallerValues, TUint8(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
499 |
SET_ELEMENT(6, TPositionQualityItem::ETUint16, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
500 |
TPositionQualityItem::EPreferGreaterValues, TUint16(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
501 |
SET_ELEMENT(7, TPositionQualityItem::ETUint32, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
502 |
TPositionQualityItem::EPreferSmallerValues, TUint32(1)); |
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 |
} lowQ1; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
505 |
class TLowQuality2 : public TPositionQualityBase { |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
506 |
public: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
507 |
TLowQuality2() |
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 |
SET_ELEMENT(0, TPositionQualityItem::ETReal32, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
510 |
TPositionQualityItem::EPreferGreaterValues, TReal32(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
511 |
SET_ELEMENT(1, TPositionQualityItem::ETReal64, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
512 |
TPositionQualityItem::EPreferSmallerValues, TReal64(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
513 |
SET_ELEMENT(2, TPositionQualityItem::ETTime, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
514 |
TPositionQualityItem::EPreferGreaterValues, TTime(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
515 |
SET_ELEMENT(3, TPositionQualityItem::ETTimeIntervalMicroSeconds, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
516 |
TPositionQualityItem::EPreferSmallerValues, TTimeIntervalMicroSeconds(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
517 |
}; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
518 |
} lowQ2; |
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 |
// 1st part |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
521 |
TInt j = 0; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
522 |
for (j = 0; j < lowQ1.HighWaterMark() + 1; j++) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
523 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
524 |
lowQ1.Compare(bigQ1, j, result); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
525 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
526 |
if (j % 2 == 0) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
527 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
528 |
// we prefer greater values here |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
529 |
CHECK_EQUAL_(TPositionQualityItem::EIsBetter, result); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
530 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
531 |
else // odd ids |
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 |
// we prefer smaller values here |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
534 |
CHECK_EQUAL_(TPositionQualityItem::EIsWorse, result); |
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 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
537 |
// same for the 2nd part |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
538 |
for (j = 0; j < lowQ2.HighWaterMark() + 1; j++) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
539 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
540 |
lowQ2.Compare(bigQ2, j, result); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
541 |
TPositionQualityItem::TResult pref; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
542 |
pref = (j % 2 == 0) ? TPositionQualityItem::EIsBetter : TPositionQualityItem::EIsWorse; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
543 |
CHECK_EQUAL_(pref, result); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
544 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
545 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
546 |
// specific test for different preferences and data types |
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 |
class TQualityGreaterSigned : public TPositionQualityBase { |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
549 |
public: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
550 |
TQualityGreaterSigned() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
551 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
552 |
SET_ELEMENT(0, TPositionQualityItem::ETInt8, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
553 |
TPositionQualityItem::EPreferGreaterValues, TInt8(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
554 |
SET_ELEMENT(1, TPositionQualityItem::ETInt8, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
555 |
TPositionQualityItem::EPreferGreaterValues, TInt8(2)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
556 |
SET_ELEMENT(2, TPositionQualityItem::ETInt8, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
557 |
TPositionQualityItem::EPreferGreaterValues, TInt8(3)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
558 |
}; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
559 |
} qGS; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
560 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
561 |
class TQualityReverse : public TPositionQualityBase { |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
562 |
public: |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
563 |
TQualityReverse() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
564 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
565 |
SET_ELEMENT(0, TPositionQualityItem::ETInt8, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
566 |
TPositionQualityItem::EPreferSmallerValues, TInt8(1)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
567 |
SET_ELEMENT(1, TPositionQualityItem::ETUint8, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
568 |
TPositionQualityItem::EPreferGreaterValues, TUint8(2)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
569 |
SET_ELEMENT(2, TPositionQualityItem::ETUint8, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
570 |
TPositionQualityItem::EPreferSmallerValues, TUint8(3)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
571 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
572 |
SET_ELEMENT(3, TPositionQualityItem::ETUint8, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
573 |
TPositionQualityItem::EPreferSmallerValues, TUint8(3)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
574 |
ResetElement(3); |
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 |
} qR; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
577 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
578 |
// in all cases KErrArgument should be returned |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
579 |
CHECK_EQUAL_(KErrArgument, qGS.Compare(qR, 0, result)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
580 |
CHECK_EQUAL_(KErrArgument, qGS.Compare(qR, 1, result)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
581 |
CHECK_EQUAL_(KErrArgument, qGS.Compare(qR, 2, result)); |
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 |
#pragma warning (pop) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
586 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
587 |
// |
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 |
// Module Updates, Status, Events classes |
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 |
// |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
592 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
593 |
// 7.1.1. Construction |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
594 |
void CModuleClassesStep::ModuleClasses_ConstructionL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
595 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
596 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
597 |
StandardPrepareL(); |
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 |
// Update Options |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
600 |
TPositionUpdateOptions updateOptions; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
601 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
602 |
CHECK(updateOptions.PositionClassSize() == sizeof(TPositionUpdateOptions)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
603 |
CHECK(updateOptions.PositionClassType() == EPositionUpdateOptionsClass); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
604 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
605 |
CHECK_EQUAL_(TInt64(0), updateOptions.UpdateInterval().Int64()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
606 |
CHECK_EQUAL_(TInt64(0), updateOptions.UpdateTimeOut().Int64()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
607 |
CHECK_EQUAL_(TInt64(0), updateOptions.MaxUpdateAge().Int64()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
608 |
CHECK(!updateOptions.AcceptPartialUpdates()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
609 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
610 |
const TBool KDummyAcceptUpdates = ETrue; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
611 |
const TTimeIntervalMicroSeconds KUpdateInterval(23412); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
612 |
const TTimeIntervalMicroSeconds KTimeOut(4123523); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
613 |
const TTimeIntervalMicroSeconds KMaxUpdateAge(3245); |
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 |
TPositionUpdateOptions updateOptions2( |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
616 |
KUpdateInterval, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
617 |
KTimeOut, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
618 |
KMaxUpdateAge, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
619 |
KDummyAcceptUpdates); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
620 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
621 |
CHECK_EQUAL_(KUpdateInterval, updateOptions2.UpdateInterval()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
622 |
CHECK_EQUAL_(KTimeOut, updateOptions2.UpdateTimeOut().Int64()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
623 |
CHECK_EQUAL_(KMaxUpdateAge, updateOptions2.MaxUpdateAge().Int64()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
624 |
CHECK(updateOptions2.AcceptPartialUpdates()); |
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 |
// Module Status |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
627 |
TPositionModuleStatus moduleStatus; |
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 |
CHECK(moduleStatus.PositionClassSize() == sizeof(TPositionModuleStatus)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
630 |
CHECK(moduleStatus.PositionClassType() == EPositionModuleStatusClass); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
631 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
632 |
CHECK(moduleStatus.DeviceStatus() == TPositionModuleStatus::EDeviceUnknown); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
633 |
CHECK(moduleStatus.DataQualityStatus() == TPositionModuleStatus::EDataQualityUnknown); |
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 |
// Module status event |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
636 |
TPositionModuleStatusEvent posModEvent; |
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 |
CHECK(posModEvent.PositionClassSize() == sizeof(TPositionModuleStatusEvent)); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
639 |
CHECK(posModEvent.PositionClassType() == EPositionModuleStatusEventClass); |
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 |
CHECK(posModEvent.RequestedEvents() == TPositionModuleStatusEvent::EEventNone); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
642 |
CHECK(posModEvent.OccurredEvents() == TPositionModuleStatusEvent::EEventNone); |
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 |
posModEvent.GetModuleStatus(moduleStatus); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
645 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
646 |
CHECK(moduleStatus.DeviceStatus() == TPositionModuleStatus::EDeviceUnknown); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
647 |
CHECK(moduleStatus.DataQualityStatus() == TPositionModuleStatus::EDataQualityUnknown); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
648 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
649 |
//Just do a check here for construction with requested events parameter. |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
650 |
TPositionModuleStatusEvent posModEvent2(TPositionModuleStatusEvent::EEventDataQualityStatus); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
651 |
CHECK(posModEvent2.RequestedEvents() == TPositionModuleStatusEvent::EEventDataQualityStatus); |
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 |
// 7.1.2. Setters/Getters |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
657 |
void CModuleClassesStep::ModuleClasses_SettersL() |
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 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
660 |
StandardPrepareL(); |
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 |
// Update Options |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
663 |
TPositionUpdateOptions updateOptions; |
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 |
const TBool KDummyAcceptUpdates = ETrue; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
666 |
const TTimeIntervalMicroSeconds KUpdateInterval(23412); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
667 |
const TTimeIntervalMicroSeconds KTimeOut(4123523); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
668 |
const TTimeIntervalMicroSeconds KMaxUpdateAge(3245); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
669 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
670 |
updateOptions.SetAcceptPartialUpdates(KDummyAcceptUpdates); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
671 |
updateOptions.SetUpdateInterval(KUpdateInterval); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
672 |
updateOptions.SetUpdateTimeOut(KTimeOut); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
673 |
updateOptions.SetMaxUpdateAge(KMaxUpdateAge); |
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 |
CHECK(updateOptions.AcceptPartialUpdates()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
676 |
CHECK_EQUAL_(updateOptions.UpdateInterval().Int64(), KUpdateInterval.Int64()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
677 |
CHECK_EQUAL_(updateOptions.UpdateTimeOut().Int64(), KTimeOut.Int64()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
678 |
CHECK_EQUAL_(updateOptions.MaxUpdateAge().Int64(), KMaxUpdateAge.Int64()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
679 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
680 |
// Module status |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
681 |
TPositionModuleStatus moduleStatus; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
682 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
683 |
const TPositionModuleStatus::TDeviceStatus |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
684 |
KDummyDeviceStatus(TPositionModuleStatus::EDeviceInactive); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
685 |
const TPositionModuleStatus::TDataQualityStatus |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
686 |
KDummyQualityStatus(TPositionModuleStatus::EDataQualityPartial); |
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 |
moduleStatus.SetDeviceStatus(KDummyDeviceStatus); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
689 |
moduleStatus.SetDataQualityStatus(KDummyQualityStatus); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
690 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
691 |
CHECK_EQUAL_(KDummyDeviceStatus, moduleStatus.DeviceStatus()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
692 |
CHECK_EQUAL_(KDummyQualityStatus, moduleStatus.DataQualityStatus()); |
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 |
// Module status event |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
695 |
TPositionModuleStatusEvent posModEvent; |
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 TPositionModuleId KDummyModuleId = {0x00355463}; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
698 |
const TPositionModuleStatusEvent::TModuleEvent |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
699 |
KDummyRequestedEvent(TPositionModuleStatusEvent::EEventDeviceStatus); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
700 |
const TPositionModuleStatusEvent::TModuleEvent |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
701 |
KDummyOccurredEvent(TPositionModuleStatusEvent::EEventDataQualityStatus); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
702 |
const TPositionModuleStatusEvent::TSystemModuleEvent |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
703 |
KDummySystemEvent(TPositionModuleStatusEvent::ESystemModuleRemoved); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
704 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
705 |
posModEvent.SetModuleId(KDummyModuleId); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
706 |
posModEvent.SetRequestedEvents(KDummyRequestedEvent); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
707 |
posModEvent.SetOccurredEvents(KDummyOccurredEvent); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
708 |
posModEvent.SetSystemModuleEvent(KDummySystemEvent); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
709 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
710 |
CHECK_EQUAL_(KDummyModuleId.iUid, posModEvent.ModuleId().iUid); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
711 |
CHECK_EQUAL_(KDummyRequestedEvent, posModEvent.RequestedEvents()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
712 |
CHECK_EQUAL_(KDummyOccurredEvent, posModEvent.OccurredEvents()); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
713 |
CHECK_EQUAL_(KDummySystemEvent, posModEvent.SystemModuleEvent()); |
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 |
TPositionModuleStatus modStatus2; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
716 |
posModEvent.SetModuleStatus(moduleStatus); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
717 |
posModEvent.GetModuleStatus(modStatus2); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
718 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
719 |
CHECK_EQUAL_(modStatus2.DeviceStatus(), KDummyDeviceStatus); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
720 |
CHECK_EQUAL_(modStatus2.DataQualityStatus(), KDummyQualityStatus); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
721 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
722 |
StandardCleanup(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
723 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
724 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
725 |
// 7.2.1. Invalid Input in TPositionUpdateOptions |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
726 |
const TInt timeNEG(-1); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
727 |
const TInt timeZero(-1); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
728 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
729 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
730 |
TInt NegativeTimeConstructionInterval(TAny* /*aPtr*/) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
731 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
732 |
TPositionUpdateOptions updateOptions(timeNEG, timeZero, timeZero); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
733 |
return KErrGeneral; |
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 |
TInt NegativeTimeConstructionTimeOut(TAny* /*aPtr*/) |
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 |
TPositionUpdateOptions updateOptions(timeZero, timeNEG, timeZero); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
740 |
return KErrGeneral; |
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 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
744 |
TInt NegativeTimeConstructionMaxAge(TAny* /*aPtr*/) |
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 |
TPositionUpdateOptions updateOptions(timeZero, timeZero, timeNEG); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
747 |
return KErrGeneral; |
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 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
750 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
751 |
TInt NegativeTimeSettingInterval(TAny* /*aPtr*/) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
752 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
753 |
TPositionUpdateOptions updateOptions; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
754 |
updateOptions.SetUpdateInterval(timeNEG); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
755 |
return KErrGeneral; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
756 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
757 |
|
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 |
TInt NegativeTimeSettingTimeOut(TAny* /*aPtr*/) |
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 |
TPositionUpdateOptions updateOptions; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
762 |
updateOptions.SetUpdateTimeOut(timeNEG); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
763 |
return KErrGeneral; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
764 |
} |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
765 |
|
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 |
TInt NegativeTimeSettingMaxAge(TAny* /*aPtr*/) |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
768 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
769 |
TPositionUpdateOptions updateOptions; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
770 |
updateOptions.SetMaxUpdateAge(timeNEG); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
771 |
return KErrGeneral; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
772 |
} |
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 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
775 |
void CModuleClassesStep::TPositionUpdateOptions_InvalidL() |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
776 |
{ |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
777 |
DECLARE_ERROR_LOGGING; |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
778 |
StandardPrepareL(); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
779 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
780 |
// construction |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
781 |
DO_PANIC_TEST_L(NegativeTimeConstructionInterval, KPosClientFault, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
782 |
EPositionBadTime, KDefaultTestTimeout); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
783 |
DO_PANIC_TEST_L(NegativeTimeConstructionTimeOut, KPosClientFault, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
784 |
EPositionBadTime, KDefaultTestTimeout); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
785 |
DO_PANIC_TEST_L(NegativeTimeConstructionMaxAge, KPosClientFault, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
786 |
EPositionBadTime, KDefaultTestTimeout); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
787 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
788 |
// setting |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
789 |
DO_PANIC_TEST_L(NegativeTimeSettingInterval, KPosClientFault, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
790 |
EPositionBadTime, KDefaultTestTimeout); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
791 |
DO_PANIC_TEST_L(NegativeTimeSettingTimeOut, KPosClientFault, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
792 |
EPositionBadTime, KDefaultTestTimeout); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
793 |
DO_PANIC_TEST_L(NegativeTimeSettingMaxAge, KPosClientFault, |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
794 |
EPositionBadTime, KDefaultTestTimeout); |
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
795 |
|
a4835904093b
Added new LbsApi smoke test
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
796 |
StandardCleanup(); |
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 |