748
|
1 |
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
872
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
748
|
5 |
// which accompanies this distribution, and is available
|
872
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
748
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
// INCLUDES
|
|
19 |
#include "ctlbsclientpostp217.h"
|
|
20 |
#include <EPos_CPosModules.h>
|
|
21 |
#include <EPos_CPosModuleUpdate.h>
|
|
22 |
#include <EPos_CPosModuleIdList.h>
|
|
23 |
|
|
24 |
// CONSTANTS
|
|
25 |
const TInt MAX_AGE_TIME = 10000000; // 10 sec
|
|
26 |
|
|
27 |
_LIT(KKallesService, "Kalles Service");
|
|
28 |
|
|
29 |
// ================= MEMBER FUNCTIONS =======================
|
|
30 |
|
|
31 |
// Constructor.
|
|
32 |
CT_LbsClientPosTp217::CT_LbsClientPosTp217(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
|
|
33 |
{
|
|
34 |
_LIT(KTestName, "TP217 - Max Age, specific Psy");
|
|
35 |
SetTestStepName(KTestName);
|
|
36 |
}
|
|
37 |
|
|
38 |
// ---------------------------------------------------------
|
|
39 |
// Destructor.
|
|
40 |
// ---------------------------------------------------------
|
|
41 |
CT_LbsClientPosTp217::~CT_LbsClientPosTp217()
|
|
42 |
{
|
|
43 |
}
|
|
44 |
|
|
45 |
// ---------------------------------------------------------
|
|
46 |
// CT_LbsClientPosTp217::CloseTest
|
|
47 |
//
|
|
48 |
// (other items were commented in a header).
|
|
49 |
// ---------------------------------------------------------
|
|
50 |
//
|
|
51 |
void CT_LbsClientPosTp217::CloseTest()
|
|
52 |
{
|
|
53 |
ClosePositioner();
|
|
54 |
Disconnect();
|
|
55 |
}
|
|
56 |
|
|
57 |
// This flag must be defined if MaxAge is NOT supported
|
|
58 |
#ifdef MAX_AGE_NOT_SUPPORTED
|
|
59 |
|
|
60 |
// ---------------------------------------------------------
|
|
61 |
// CT_LbsClientPosTp217::StartL
|
|
62 |
//
|
|
63 |
// (other items were commented in a header).
|
|
64 |
// ---------------------------------------------------------
|
|
65 |
//
|
|
66 |
// MaxAge NOT supported
|
|
67 |
void CT_LbsClientPosTp217::StartL()
|
|
68 |
{
|
|
69 |
TTimeIntervalMicroSeconds maxAge = TTimeIntervalMicroSeconds(MAX_AGE_TIME);
|
|
70 |
|
|
71 |
SetupPsyL(iUidTestPsyMaxAge);
|
|
72 |
|
|
73 |
//connect to EPos
|
|
74 |
User::LeaveIfError(iPosServer.Connect());
|
|
75 |
TInt err = KErrNone;
|
|
76 |
TRequestStatus myStatus;
|
|
77 |
|
|
78 |
// Open default psy
|
|
79 |
User::LeaveIfError(iPositioner.Open(iPosServer));
|
|
80 |
TBuf<150> buf;
|
|
81 |
|
|
82 |
TPositionUpdateOptions posOption;
|
|
83 |
posOption.SetMaxUpdateAge(maxAge);
|
|
84 |
|
|
85 |
_LIT(KTestMaxAge, "Testing that MaxAge is not supported");
|
|
86 |
INFO_PRINTF1(KTestMaxAge);
|
|
87 |
err = iPositioner.SetUpdateOptions(posOption);
|
|
88 |
_LIT(KErr, "MaxAge should NOT be supported instead code %d was returned");
|
|
89 |
AssertTrueL(err == KErrNotSupported, KErr, err);
|
|
90 |
|
|
91 |
TPositionInfo posInfo1 = TPositionInfo();
|
|
92 |
TPositionInfo posInfo2 = TPositionInfo();
|
|
93 |
|
|
94 |
iPositioner.SetRequestor(CRequestor::ERequestorService,
|
|
95 |
CRequestor::EFormatApplication, KKallesService);
|
|
96 |
|
|
97 |
// Get position, first position
|
|
98 |
iPositioner.NotifyPositionUpdate(posInfo1, myStatus);
|
|
99 |
|
|
100 |
User::WaitForRequest(myStatus);
|
|
101 |
|
|
102 |
err = myStatus.Int();
|
|
103 |
_LIT(KNotifyPositionUpdate, "Error from NotifyPositionUpdate, err %d");
|
|
104 |
AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
|
|
105 |
|
|
106 |
_LIT(KWaitMaxAge, "Wait for half Max Age...");
|
|
107 |
INFO_PRINTF1(KWaitMaxAge);
|
|
108 |
// Wait half MAX_AGE_TIME
|
|
109 |
User::After(HALF_MAX_AGE_TIME);
|
|
110 |
|
|
111 |
// Get position again, should be the same as first position
|
|
112 |
iPositioner.NotifyPositionUpdate(posInfo2, myStatus);
|
|
113 |
User::WaitForRequest(myStatus);
|
|
114 |
err = myStatus.Int();
|
|
115 |
AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
|
|
116 |
|
|
117 |
if (ComparePositionL(posInfo1, posInfo2))
|
|
118 |
{
|
|
119 |
_LIT(KErrorAndLeave,
|
|
120 |
"The old position was returned from positioner, MaxAge seems to be supported!!!");
|
|
121 |
LogErrorAndLeaveL(KErrorAndLeave);
|
|
122 |
}
|
|
123 |
}
|
|
124 |
|
|
125 |
#else
|
|
126 |
// ---------------------------------------------------------
|
|
127 |
// CT_LbsClientPosTp217::StartL
|
|
128 |
//
|
|
129 |
// (other items were commented in a header).
|
|
130 |
// ---------------------------------------------------------
|
|
131 |
//
|
|
132 |
// MaxAge supported
|
|
133 |
void CT_LbsClientPosTp217::StartL()
|
|
134 |
{
|
|
135 |
TTimeIntervalMicroSeconds maxAge = TTimeIntervalMicroSeconds(MAX_AGE_TIME);
|
|
136 |
|
|
137 |
//connect to EPos
|
|
138 |
User::LeaveIfError(iPosServer.Connect());
|
|
139 |
TInt err = KErrNone;
|
|
140 |
|
|
141 |
SetupPsyL(iUidTestPsyMaxAge);
|
|
142 |
|
|
143 |
//Open subsession
|
|
144 |
User::LeaveIfError(iPositioner.Open(iPosServer, iUidTestPsyMaxAge));
|
|
145 |
TBuf<150> buf;
|
|
146 |
|
|
147 |
TPositionInfo posInfo = TPositionInfo();
|
|
148 |
TPositionInfo posInfo2 = TPositionInfo();
|
|
149 |
TRequestStatus myStatus;
|
|
150 |
|
|
151 |
iPositioner.SetRequestor(CRequestor::ERequestorService,
|
|
152 |
CRequestor::EFormatApplication, KKallesService);
|
|
153 |
|
|
154 |
// Make sure that it is possible to get position from psy
|
|
155 |
iPositioner.NotifyPositionUpdate(posInfo, myStatus);
|
|
156 |
User::WaitForRequest(myStatus);
|
|
157 |
err = myStatus.Int();
|
|
158 |
_LIT(KNotifyPositionUpdate, "Error from NotifyPositionUpdate");
|
|
159 |
AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
|
|
160 |
|
|
161 |
const TTimeIntervalMicroSeconds32 KSomeTime(1000000); //1 sec
|
|
162 |
User::After(KSomeTime);
|
|
163 |
|
|
164 |
// Make sure that the psy returns differens positions
|
|
165 |
iPositioner.NotifyPositionUpdate(posInfo2, myStatus);
|
|
166 |
User::WaitForRequest(myStatus);
|
|
167 |
err = myStatus.Int();
|
|
168 |
AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
|
|
169 |
|
|
170 |
if (ComparePositionL(posInfo, posInfo2))
|
|
171 |
{
|
|
172 |
_LIT(KErrorAndLeave, "The same position was returned from positioner!!!");
|
|
173 |
LogErrorAndLeaveL(KErrorAndLeave);
|
|
174 |
}
|
|
175 |
|
|
176 |
TPositionUpdateOptions returnPosOption;
|
|
177 |
iPositioner.GetUpdateOptions(returnPosOption);
|
|
178 |
TTimeIntervalMicroSeconds returnInterval = returnPosOption.MaxUpdateAge();
|
|
179 |
|
|
180 |
_LIT(KMageAge, "Max age should not hold a value");
|
|
181 |
AssertTrueL(returnInterval == TTimeIntervalMicroSeconds(0),
|
|
182 |
KMageAge, KErrGeneral);
|
|
183 |
|
|
184 |
TPositionUpdateOptions posOption;
|
|
185 |
posOption.SetMaxUpdateAge(maxAge);
|
|
186 |
err = iPositioner.SetUpdateOptions(posOption);
|
|
187 |
|
|
188 |
_LIT(KChange, "ERROR: When setting max age in SetMaxAge, error %d");
|
|
189 |
AssertTrueL(err == KErrNone, KChange, err);
|
|
190 |
|
|
191 |
TPositionUpdateOptions returnPosOption2;
|
|
192 |
iPositioner.GetUpdateOptions(returnPosOption2);
|
|
193 |
|
|
194 |
returnInterval = returnPosOption2.MaxUpdateAge();
|
|
195 |
_LIT(KNotMatch, "Max age does not match, %d %d ");
|
|
196 |
buf.Format(KNotMatch, returnInterval.Int64(), MAX_AGE_TIME);
|
|
197 |
|
|
198 |
AssertTrueL(returnInterval == maxAge, buf, KErrGeneral);
|
|
199 |
|
|
200 |
TPositionInfo posInfo3 = TPositionInfo();
|
|
201 |
TPositionInfo posInfo4 = TPositionInfo();
|
|
202 |
TPositionInfo posInfo5 = TPositionInfo();
|
|
203 |
// Get position, first position
|
|
204 |
iPositioner.NotifyPositionUpdate(posInfo3, myStatus);
|
|
205 |
|
|
206 |
User::WaitForRequest(myStatus);
|
|
207 |
err = myStatus.Int();
|
|
208 |
AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
|
|
209 |
|
|
210 |
TPosition position = TPosition();
|
|
211 |
posInfo.GetPosition(position);
|
|
212 |
|
|
213 |
// Wait half MAX_AGE_TIME
|
|
214 |
const TTimeIntervalMicroSeconds32 KHalfTime(MAX_AGE_TIME/2); //5 sec
|
|
215 |
User::After(KHalfTime);
|
|
216 |
|
|
217 |
// Get position again, should be the same as first position
|
|
218 |
iPositioner.NotifyPositionUpdate(posInfo4, myStatus);
|
|
219 |
|
|
220 |
User::WaitForRequest(myStatus);
|
|
221 |
err = myStatus.Int();
|
|
222 |
AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
|
|
223 |
|
|
224 |
if (!ComparePositionL(posInfo3, posInfo4))
|
|
225 |
{
|
|
226 |
_LIT(KErrorAndLeave, "The same position was returned from positioner!!!");
|
|
227 |
LogErrorAndLeaveL(KErrorAndLeave);
|
|
228 |
}
|
|
229 |
|
|
230 |
// Wait MAX_AGE_TIME
|
|
231 |
const TTimeIntervalMicroSeconds32 KTime(MAX_AGE_TIME); //10 sec
|
|
232 |
User::After(KTime);
|
|
233 |
|
|
234 |
// Get position again, should NOT be the same as earlier
|
|
235 |
iPositioner.NotifyPositionUpdate(posInfo5, myStatus);
|
|
236 |
|
|
237 |
User::WaitForRequest(myStatus);
|
|
238 |
err = myStatus.Int();
|
|
239 |
AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
|
|
240 |
|
|
241 |
if (ComparePositionL(posInfo4, posInfo5))
|
|
242 |
{
|
|
243 |
_LIT(KErrorAndLeave, "The same position was returned from positioner!!!");
|
|
244 |
LogErrorAndLeaveL(KErrorAndLeave);
|
|
245 |
}
|
|
246 |
|
|
247 |
//Try to set an interval that is less than MaxAge
|
|
248 |
TTimeIntervalMicroSeconds mySmallInterval = TTimeIntervalMicroSeconds(400000);
|
|
249 |
posOption.SetUpdateInterval(mySmallInterval);
|
|
250 |
posOption.SetMaxUpdateAge(maxAge);
|
|
251 |
|
|
252 |
err = iPositioner.SetUpdateOptions(posOption);
|
|
253 |
_LIT(KErr2, "Setting updateinterval less than MaxAge should result in KErrArgument, instead error %d");
|
|
254 |
AssertTrueL(err == KErrArgument, KErr2, err);
|
|
255 |
|
|
256 |
// Check that the MaxAge did not change
|
|
257 |
iPositioner.GetUpdateOptions(returnPosOption);
|
|
258 |
TTimeIntervalMicroSeconds interval = returnPosOption.MaxUpdateAge();
|
|
259 |
|
|
260 |
if (interval != maxAge)
|
|
261 |
{
|
|
262 |
_LIT(KErrorAndLeave, "MaxAge does not match %d with %d");
|
|
263 |
buf.Format(KErrorAndLeave, interval.Int64(), maxAge.Int64());
|
|
264 |
LogErrorAndLeaveL(buf);
|
|
265 |
}
|
|
266 |
|
|
267 |
|
|
268 |
ClosePositioner();
|
|
269 |
Disconnect();
|
|
270 |
|
|
271 |
ExtendedTesting1();
|
|
272 |
|
|
273 |
ExtendedTesting2();
|
|
274 |
}
|
|
275 |
|
|
276 |
#endif
|
|
277 |
|
|
278 |
// ---------------------------------------------------------
|
|
279 |
// CT_LbsClientPosTp217::ExtendedTesting1
|
|
280 |
//
|
|
281 |
// (other items were commented in a header).
|
|
282 |
// ---------------------------------------------------------
|
|
283 |
//
|
|
284 |
void CT_LbsClientPosTp217::ExtendedTesting1()
|
|
285 |
{
|
|
286 |
_LIT(KFunctionName, "We are inside ExtendedTesting1()");
|
|
287 |
INFO_PRINTF1(KFunctionName);
|
|
288 |
TTimeIntervalMicroSeconds maxAge = TTimeIntervalMicroSeconds(5000000);
|
|
289 |
TTimeIntervalMicroSeconds myInterval = TTimeIntervalMicroSeconds(400000);
|
|
290 |
|
|
291 |
// Set iUidTestPsyMaxAge to defaultpsy
|
|
292 |
SetupPsyL(iUidTestPsyMaxAge);
|
|
293 |
|
|
294 |
//connect to EPos
|
|
295 |
User::LeaveIfError(iPosServer.Connect());
|
|
296 |
TInt err = KErrNone;
|
|
297 |
|
|
298 |
// Open default psy
|
|
299 |
User::LeaveIfError(iPositioner.Open(iPosServer));
|
|
300 |
|
|
301 |
TPositionUpdateOptions posOption;
|
|
302 |
|
|
303 |
//Try to set an interval that is less than MaxAge
|
|
304 |
posOption.SetUpdateInterval(myInterval);
|
|
305 |
posOption.SetMaxUpdateAge(maxAge);
|
|
306 |
|
|
307 |
err = iPositioner.SetUpdateOptions(posOption);
|
|
308 |
_LIT(KErr2, "Setting updateinterval less than MaxAge should result in KErrArgument, instead error %d");
|
|
309 |
AssertTrueL(err == KErrArgument, KErr2, err);
|
|
310 |
|
|
311 |
// Check that the MaxAge did not change
|
|
312 |
TPositionUpdateOptions returnPosOption;
|
|
313 |
iPositioner.GetUpdateOptions(returnPosOption);
|
|
314 |
|
|
315 |
//Try to set an interval that is equal to MaxAge
|
|
316 |
posOption.SetUpdateInterval(maxAge);
|
|
317 |
posOption.SetMaxUpdateAge(maxAge);
|
|
318 |
|
|
319 |
err = iPositioner.SetUpdateOptions(posOption);
|
|
320 |
_LIT(KErr3, "Setting updateinterval equal to MaxAge should result in KErrArgument, instead error %d");
|
|
321 |
AssertTrueL(err == KErrArgument, KErr3, err);
|
|
322 |
|
|
323 |
ClosePositioner();
|
|
324 |
Disconnect();
|
|
325 |
_LIT(KFunctionDone, "ExtendedTesting1 Done");
|
|
326 |
INFO_PRINTF1(KFunctionDone);
|
|
327 |
}
|
|
328 |
|
|
329 |
// ---------------------------------------------------------
|
|
330 |
// CT_LbsClientPosTp217::ExtendedTesting2
|
|
331 |
//
|
|
332 |
// (other items were commented in a header).
|
|
333 |
// ---------------------------------------------------------
|
|
334 |
//
|
|
335 |
void CT_LbsClientPosTp217::ExtendedTesting2()
|
|
336 |
{
|
|
337 |
_LIT(KFunctionName, "We are inside ExtendedTesting2()");
|
|
338 |
INFO_PRINTF1(KFunctionName);
|
|
339 |
TTimeIntervalMicroSeconds maxAge = TTimeIntervalMicroSeconds(30000000); // 30 sec
|
|
340 |
TTimeIntervalMicroSeconds maxAge2 = TTimeIntervalMicroSeconds(4000000); // 4 sec
|
|
341 |
|
|
342 |
// The MaxAge psy adds one second to the timeout time, therefore 6 seconds here (just to be sure)
|
|
343 |
const TTimeIntervalMicroSeconds32 KSomeTime(6000000); //6 sec
|
|
344 |
|
|
345 |
//connect to EPos
|
|
346 |
User::LeaveIfError(iPosServer.Connect());
|
|
347 |
TInt err = KErrNone;
|
|
348 |
//Open subsession
|
|
349 |
User::LeaveIfError(iPositioner.Open(iPosServer, iUidTestPsyMaxAge));
|
|
350 |
|
|
351 |
SetupPsyL(iUidTestPsyMaxAge);
|
|
352 |
|
|
353 |
TPositionInfo posInfo1 = TPositionInfo();
|
|
354 |
TPositionInfo posInfo2 = TPositionInfo();
|
|
355 |
TPositionInfo posInfo3 = TPositionInfo();
|
|
356 |
TPositionInfo posInfo4 = TPositionInfo();
|
|
357 |
|
|
358 |
TRequestStatus myStatus;
|
|
359 |
|
|
360 |
iPositioner.SetRequestor(CRequestor::ERequestorService,
|
|
361 |
CRequestor::EFormatApplication, KKallesService);
|
|
362 |
|
|
363 |
// Make sure that it is possible to get position from psy
|
|
364 |
iPositioner.NotifyPositionUpdate(posInfo1, myStatus);
|
|
365 |
User::WaitForRequest(myStatus);
|
|
366 |
err = myStatus.Int();
|
|
367 |
_LIT(KNotifyPositionUpdate, "Error from NotifyPositionUpdate");
|
|
368 |
AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
|
|
369 |
|
|
370 |
// Add a short delay here so that the MaxAge Psy has the possibilty
|
|
371 |
// to create a new random position (the randomization seed is created with a time)
|
|
372 |
User::After(2000000);
|
|
373 |
|
|
374 |
// Make sure that the psy returns differens positions
|
|
375 |
iPositioner.NotifyPositionUpdate(posInfo2, myStatus);
|
|
376 |
User::WaitForRequest(myStatus);
|
|
377 |
err = myStatus.Int();
|
|
378 |
AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
|
|
379 |
|
|
380 |
if (ComparePositionL(posInfo1, posInfo2))
|
|
381 |
{
|
|
382 |
_LIT(KErrorAndLeave, "The same position was returned from positioner!!!");
|
|
383 |
LogErrorAndLeaveL(KErrorAndLeave);
|
|
384 |
}
|
|
385 |
|
|
386 |
// Set MaxAge
|
|
387 |
TPositionUpdateOptions posOption;
|
|
388 |
posOption.SetMaxUpdateAge(maxAge);
|
|
389 |
err = iPositioner.SetUpdateOptions(posOption);
|
|
390 |
|
|
391 |
_LIT(KChange, "ERROR: When setting max age in SetMaxAge, error %d");
|
|
392 |
AssertTrueL(err == KErrNone, KChange, err);
|
|
393 |
User::After(KSomeTime);
|
|
394 |
|
|
395 |
iPositioner.NotifyPositionUpdate(posInfo3, myStatus);
|
|
396 |
User::WaitForRequest(myStatus);
|
|
397 |
err = myStatus.Int();
|
|
398 |
AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
|
|
399 |
|
|
400 |
// This position should be the old one
|
|
401 |
if (!ComparePositionL(posInfo2, posInfo3))
|
|
402 |
{
|
|
403 |
_LIT(KErrorAndLeave, "The same position was returned from positioner!!!");
|
|
404 |
LogErrorAndLeaveL(KErrorAndLeave);
|
|
405 |
}
|
|
406 |
|
|
407 |
// Now change MaxAge again and check that it has been changed
|
|
408 |
posOption.SetMaxUpdateAge(maxAge2);
|
|
409 |
err = iPositioner.SetUpdateOptions(posOption);
|
|
410 |
|
|
411 |
_LIT(KChange2, "ERROR: When setting max age in SetMaxAge (2), error %d");
|
|
412 |
AssertTrueL(err == KErrNone, KChange2, err);
|
|
413 |
_LIT(KTimeout, "Waiting for the new maxage-timeout");
|
|
414 |
INFO_PRINTF1(KTimeout);
|
|
415 |
User::After(KSomeTime);
|
|
416 |
|
|
417 |
iPositioner.NotifyPositionUpdate(posInfo4, myStatus);
|
|
418 |
User::WaitForRequest(myStatus);
|
|
419 |
err = myStatus.Int();
|
|
420 |
AssertTrueL(err == KErrNone, KNotifyPositionUpdate, err);
|
|
421 |
|
|
422 |
// This position should be new since maxage has expired
|
|
423 |
if (ComparePositionL(posInfo3, posInfo4))
|
|
424 |
{
|
|
425 |
_LIT(KErrorAndLeave, "The same position was returned from positioner!!!");
|
|
426 |
LogErrorAndLeaveL(KErrorAndLeave);
|
|
427 |
}
|
|
428 |
|
|
429 |
ClosePositioner();
|
|
430 |
Disconnect();
|
|
431 |
_LIT(KFunctionDone, "ExtendedTesting2() Done");
|
|
432 |
INFO_PRINTF1(KFunctionDone);
|
|
433 |
}
|
|
434 |
|
|
435 |
// ---------------------------------------------------------
|
|
436 |
// CT_LbsClientPosTp217::ComparePositionL
|
|
437 |
//
|
|
438 |
// (other items were commented in a header).
|
|
439 |
// ---------------------------------------------------------
|
|
440 |
//
|
|
441 |
TBool CT_LbsClientPosTp217::ComparePositionL(TPositionInfo aPosInfo1, TPositionInfo aPosInfo2)
|
|
442 |
{
|
|
443 |
_LIT(KFunctionName, "We are inside ComparePositionL");
|
|
444 |
INFO_PRINTF1(KFunctionName);
|
|
445 |
TBool result = ETrue;
|
|
446 |
TBuf<150> buf;
|
|
447 |
|
|
448 |
TPosition pos1 = TPosition();
|
|
449 |
TPosition pos2 = TPosition();
|
|
450 |
aPosInfo1.GetPosition(pos1);
|
|
451 |
aPosInfo2.GetPosition(pos2);
|
|
452 |
|
|
453 |
TTime time1 = pos1.Time();
|
|
454 |
TTime time2 = pos2.Time();
|
|
455 |
|
|
456 |
if (time1 == time2)
|
|
457 |
{
|
|
458 |
_LIT(KEqualTime, "Equal Time");
|
|
459 |
INFO_PRINTF1(KEqualTime);
|
|
460 |
}
|
|
461 |
else
|
|
462 |
{
|
|
463 |
_LIT(KNotEqualTime, "NOT Equal Time");
|
|
464 |
INFO_PRINTF1(KNotEqualTime);
|
|
465 |
}
|
|
466 |
|
|
467 |
if ((time1 != time2) || (pos1.Latitude() != pos2.Latitude()) ||
|
|
468 |
(pos1.Longitude() != pos2.Longitude()) ||
|
|
469 |
(pos1.Altitude() != pos2.Altitude()) )
|
|
470 |
{
|
|
471 |
// Not equal
|
|
472 |
result = EFalse;
|
|
473 |
_LIT(KNotEqual, "Not equal");
|
|
474 |
INFO_PRINTF1(KNotEqual);
|
|
475 |
_LIT(KPosition1, "Position1: Lat %f Long %f Alt %f");
|
|
476 |
buf.Format(KPosition1, pos1.Latitude(), pos1.Longitude() ,pos1.Altitude());
|
|
477 |
INFO_PRINTF1(buf);
|
|
478 |
_LIT(KPosition2, "Position1: Lat %f Long %f Alt %f");
|
|
479 |
buf.Format( KPosition2, pos2.Latitude(), pos2.Longitude() ,pos2.Altitude());
|
|
480 |
INFO_PRINTF1(buf);
|
|
481 |
}
|
|
482 |
else
|
|
483 |
{
|
|
484 |
_LIT(KEqual, "Equal");
|
|
485 |
INFO_PRINTF1(KEqual);
|
|
486 |
result = ETrue;
|
|
487 |
_LIT(KPosition1, "Position1: Lat %f Long %f Alt %f");
|
|
488 |
buf.Format( KPosition1, pos1.Latitude(), pos1.Longitude() ,pos1.Altitude());
|
|
489 |
INFO_PRINTF1(buf);
|
|
490 |
}
|
|
491 |
|
|
492 |
return result;
|
|
493 |
}
|
|
494 |
|
|
495 |
// ---------------------------------------------------------
|
|
496 |
// CT_LbsClientPosTp217::AssertTrueSecL
|
|
497 |
//
|
|
498 |
// (other items were commented in a header).
|
|
499 |
// ---------------------------------------------------------
|
|
500 |
//
|
|
501 |
void CT_LbsClientPosTp217::AssertTrueL(TBool aCondition, const TDesC& aErrorMsg, TInt aErrorCode)
|
|
502 |
{
|
|
503 |
if (!aCondition)
|
|
504 |
{
|
|
505 |
// LogErrorAndLeave does not leave if KErrNone is error
|
|
506 |
if (aErrorCode == KErrNone) aErrorCode = KErrGeneral;
|
|
507 |
TBuf<100> buf;
|
|
508 |
buf.Format(aErrorMsg, aErrorCode);
|
|
509 |
LogErrorAndLeaveL(buf, aErrorCode);
|
|
510 |
}
|
|
511 |
}
|
|
512 |
|
|
513 |
|