|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // TE_MMLOCATIONSERVICES.CPP |
|
15 // |
|
16 // |
|
17 |
|
18 #include <e32test.h> |
|
19 |
|
20 #include "TE_EtelMMTestStepBase.h" |
|
21 #include "TE_mmNotifyMeasurementControl.h" |
|
22 #include "testdef.h" |
|
23 #include "mmtsy.h" |
|
24 |
|
25 enum TVerdict CTestNotifyMeasurementControl::doTestStepL() |
|
26 { |
|
27 INFO_PRINTF1(_L("Measurement Control request")); |
|
28 |
|
29 TRequestStatus mcontrolStatus; |
|
30 |
|
31 RMobileLocationServices::TMeasurementControlV7Pckg measurementControlPckg(iMeasurementControl); |
|
32 |
|
33 TInt incompleteMCRequestFlag; |
|
34 TBool existsIncompleteMCFlag = GetIntFromConfig(ConfigSection(), _L("IncompleteMCRequestFlag"), incompleteMCRequestFlag ); |
|
35 |
|
36 TInt measurementId; |
|
37 GetIntFromConfig(ConfigSection(), _L("MeasurementId"), measurementId); |
|
38 |
|
39 TInt invalidMeasurementIdFlag ; |
|
40 TBool existsInvalidMeasurementIdFlag = GetIntFromConfig(ConfigSection(), _L("InvalidMeasurementIdFlag"), invalidMeasurementIdFlag ); |
|
41 |
|
42 iMeasurementControl.iMeasurementIdentity = measurementId; |
|
43 |
|
44 iLocationSvc.NotifyMeasurementControl(mcontrolStatus,measurementControlPckg); |
|
45 User::WaitForRequest(mcontrolStatus); |
|
46 TEST(mcontrolStatus==KErrNone); |
|
47 |
|
48 if(existsInvalidMeasurementIdFlag) |
|
49 { |
|
50 //invalid data in measurementControl |
|
51 TEST(iMeasurementControl.iMeasurementIdentity == measurementId); |
|
52 } |
|
53 else if(existsIncompleteMCFlag) |
|
54 { |
|
55 // Incomplete MeasurementControl Request |
|
56 TBool expectedAddlAsstDataRequest; |
|
57 GetBoolFromConfig(ConfigSection(), _L("expectedAddlAsstDataRequest"), expectedAddlAsstDataRequest); |
|
58 |
|
59 TEST(iMeasurementControl.iMeasurementCommand.iSetup.iUePosReportingQuantity.iAddlAssistanceDataReq == expectedAddlAsstDataRequest); |
|
60 } |
|
61 else |
|
62 { |
|
63 //complete measurement control request |
|
64 TEST(iMeasurementControl.iMeasurementIdentity == measurementId); |
|
65 INFO_PRINTF2(_L("Measurement Identity=%d"),iMeasurementControl.iMeasurementIdentity); |
|
66 ValidateMCParams(); |
|
67 ValidateMCRefTimeParams(); |
|
68 ValidateMCRefLocParams(); |
|
69 ValidateMCModelParams(); |
|
70 } |
|
71 |
|
72 INFO_PRINTF2(_L("Test %d - RMobileLocationServices::NotifyMeasurementControl passed"), iTestCount++); |
|
73 return TestStepResult(); |
|
74 } |