|
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 // @file ctlbsstepverifymodinfo.cpp |
|
15 // This is the class implementation for the Verify Module Status test step |
|
16 // |
|
17 // |
|
18 |
|
19 #include "ctlbsstepverifymodstatus.h" |
|
20 #include <lbs/test/tlbsutils.h> |
|
21 |
|
22 |
|
23 /** |
|
24 * Constructor |
|
25 */ |
|
26 CT_LbsStep_VerifyModStatus::CT_LbsStep_VerifyModStatus(CT_LbsServer& aParent) : CT_LbsStep(aParent) |
|
27 { |
|
28 SetTestStepName(KLbsStep_VerifyModuleStatus); |
|
29 } |
|
30 |
|
31 |
|
32 /** |
|
33 Static Constructor |
|
34 */ |
|
35 CT_LbsStep_VerifyModStatus* CT_LbsStep_VerifyModStatus::New(CT_LbsServer& aParent) |
|
36 { |
|
37 return new CT_LbsStep_VerifyModStatus(aParent); |
|
38 // Note the lack of ELeave. |
|
39 // This means that having insufficient memory will return NULL; |
|
40 } |
|
41 |
|
42 |
|
43 /** |
|
44 * @return - TVerdict code |
|
45 * Override of base class pure virtual |
|
46 * Our implementation only gets called if the base class doTestStepPreambleL() did |
|
47 * not leave. That being the case, the current test result value will be EPass. |
|
48 */ |
|
49 TVerdict CT_LbsStep_VerifyModStatus::doTestStepL() |
|
50 { |
|
51 // Helper test step used to verify module information. |
|
52 INFO_PRINTF1(_L(">>CT_LbsStep_VerifyModStatus::doTestStepL()")); |
|
53 |
|
54 if (TestStepResult() == EPass) |
|
55 { |
|
56 // Access the module infos to be compared. |
|
57 TPositionModuleStatus& verifyModStatus = iParent.iSharedData->iVerifyModuleStatus; |
|
58 TPositionModuleStatus& currentModStatus = iParent.iSharedData->iCurrentModuleStatus; |
|
59 T_LbsUtils utils; |
|
60 |
|
61 // Verify module informations are equal. |
|
62 TBool res; |
|
63 |
|
64 INFO_PRINTF3(_L("comparing expected and received status %d %d"), verifyModStatus.DeviceStatus(), currentModStatus.DeviceStatus()); |
|
65 res = utils.Compare_ModuleStatus(verifyModStatus, currentModStatus); |
|
66 |
|
67 // Fail test if they do not match. |
|
68 if (!res) |
|
69 { |
|
70 SetTestStepResult(EFail); |
|
71 } |
|
72 } |
|
73 |
|
74 INFO_PRINTF1(_L("<<CT_LbsStep_VerifyModStatus::doTestStepL()")); |
|
75 |
|
76 return TestStepResult(); |
|
77 } |
|
78 |