|
1 // Copyright (c) 2004-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 // __ACTION_INFO_BEGIN__ |
|
15 // [Action Name] |
|
16 // CompareSmsSettings |
|
17 // [Action Parameters] |
|
18 // smsSettingsOrg input CSmsSettings |
|
19 // smsSettingsRef input CSmsSettings |
|
20 // [Action Description] |
|
21 // CompareSmsSettings Test Action is intended to compare one SMS service settings values |
|
22 // with other SMS service settings values. |
|
23 // [APIs Used] |
|
24 // CSmsSettings::CharacterSet |
|
25 // CSmsSettings::CommDbAction |
|
26 // CSmsSettings::Delivery |
|
27 // CSmsSettings::DeliveryReport |
|
28 // CSmsSettings::MessageConversion |
|
29 // CSmsSettings::NumSCAddresses |
|
30 // CSmsSettings::DefaultSC |
|
31 // CSmsSettings::SCAddress |
|
32 // CSmsSettings::RejectDuplicate |
|
33 // CSmsSettings::ReplyPath |
|
34 // CSmsSettings::ReplyQuoted |
|
35 // CSmsSettings::SmsBearer |
|
36 // CSmsSettings::SmsBearerAction |
|
37 // CSmsSettings::SpecialMessageHandling |
|
38 // CSmsSettings::StatusReportHandling |
|
39 // CSmsSettings::ValidityPeriod |
|
40 // CSmsSettings::ValidityPeriodFormat |
|
41 // __ACTION_INFO_END__ |
|
42 // |
|
43 // |
|
44 |
|
45 /** |
|
46 @file |
|
47 */ |
|
48 |
|
49 |
|
50 #include "CMtfTestCase.h" |
|
51 #include "CMtfTestActionParameters.h" |
|
52 #include "CMtfTestActionCompareSmsSettingsCR.h" |
|
53 |
|
54 |
|
55 /** |
|
56 Function : NewL |
|
57 Description : |
|
58 @internalTechnology |
|
59 @param : aTestCase - CMtfTestCase for the CMtfTestAction base class |
|
60 @param : aActionParams - CMtfTestActionParameters |
|
61 @return : CMtfTestAction* - a base class pointer to the newly created CMtfTestActionCompareSmsSettingsCR object |
|
62 @pre none |
|
63 @post none |
|
64 */ |
|
65 CMtfTestAction* CMtfTestActionCompareSmsSettingsCR::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters) |
|
66 { |
|
67 CMtfTestActionCompareSmsSettingsCR* self = new (ELeave) CMtfTestActionCompareSmsSettingsCR(aTestCase); |
|
68 CleanupStack::PushL(self); |
|
69 self->ConstructL(aActionParameters); |
|
70 CleanupStack::Pop(); |
|
71 return self; |
|
72 } |
|
73 |
|
74 /** |
|
75 Function : CMtfTestActionCompareSmsSettings |
|
76 Description : Constructor |
|
77 @internalTechnology |
|
78 @param : aTestCase - CMtfTestCase for the CMtfTestAction base class |
|
79 @return : N/A |
|
80 @pre none |
|
81 @post none |
|
82 */ |
|
83 CMtfTestActionCompareSmsSettingsCR::CMtfTestActionCompareSmsSettingsCR(CMtfTestCase& aTestCase) |
|
84 : CMtfSynchronousTestAction(aTestCase) |
|
85 { |
|
86 } |
|
87 |
|
88 /** |
|
89 Function : ~CMtfTestActionCompareSmsSettings |
|
90 Description : Destructor |
|
91 @internalTechnology |
|
92 @param : |
|
93 @return : |
|
94 @pre |
|
95 @post |
|
96 */ |
|
97 CMtfTestActionCompareSmsSettingsCR::~CMtfTestActionCompareSmsSettingsCR() |
|
98 { |
|
99 } |
|
100 |
|
101 /** |
|
102 Function : ExecuteActionL |
|
103 Description : Entry point for the this test action in the test framework |
|
104 @internalTechnology |
|
105 @param : none |
|
106 @return : void |
|
107 @pre none |
|
108 @post none |
|
109 */ |
|
110 void CMtfTestActionCompareSmsSettingsCR::ExecuteActionL() |
|
111 { |
|
112 TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionCompareSmsSettingsCR); |
|
113 CSmsSettings* smsSettingsOrg = ObtainParameterReferenceL<CSmsSettings>(TestCase(),ActionParameters().Parameter(0) ); |
|
114 CSmsSettings* smsSettingsRef = ObtainParameterReferenceL<CSmsSettings>(TestCase(),ActionParameters().Parameter(1) ); |
|
115 |
|
116 if( smsSettingsOrg->CanConcatenate() != smsSettingsRef->CanConcatenate() || |
|
117 smsSettingsOrg->Class2Folder() != smsSettingsRef->Class2Folder() || |
|
118 smsSettingsOrg->CharacterSet() != smsSettingsRef->CharacterSet() || |
|
119 smsSettingsOrg->CommDbAction() != smsSettingsRef->CommDbAction() || |
|
120 |
|
121 smsSettingsOrg->DefaultServiceCenter() != smsSettingsRef->DefaultServiceCenter() || |
|
122 |
|
123 smsSettingsOrg->Delivery() != smsSettingsRef->Delivery() || |
|
124 smsSettingsOrg->DeliveryReport() != smsSettingsRef->DeliveryReport() || |
|
125 smsSettingsOrg->DescriptionLength() != smsSettingsRef->DescriptionLength() || |
|
126 smsSettingsOrg->MessageConversion() != smsSettingsRef->MessageConversion() || |
|
127 |
|
128 smsSettingsOrg->ServiceCenterCount() != smsSettingsRef->ServiceCenterCount() || |
|
129 |
|
130 smsSettingsOrg->RejectDuplicate() != smsSettingsRef->RejectDuplicate() || |
|
131 smsSettingsOrg->ReplyPath() != smsSettingsRef->ReplyPath() || |
|
132 smsSettingsOrg->ReplyQuoted() != smsSettingsRef->ReplyQuoted() || |
|
133 smsSettingsOrg->SmsBearer() != smsSettingsRef->SmsBearer() || |
|
134 smsSettingsOrg->SmsBearerAction() != smsSettingsRef->SmsBearerAction() || |
|
135 smsSettingsOrg->SpecialMessageHandling() != smsSettingsRef->SpecialMessageHandling() || |
|
136 smsSettingsOrg->StatusReportHandling() != smsSettingsRef->StatusReportHandling() || |
|
137 smsSettingsOrg->ValidityPeriod() != smsSettingsRef->ValidityPeriod() || |
|
138 smsSettingsOrg->ValidityPeriodFormat() != smsSettingsRef->ValidityPeriodFormat() |
|
139 ) |
|
140 { |
|
141 // failed |
|
142 TestCase().ERR_PRINTF1(_L("SMS Settings objects do not match !")); |
|
143 TestCase().SetTestStepResult(EFail); |
|
144 |
|
145 } |
|
146 else |
|
147 { |
|
148 // compare service centre addresses |
|
149 |
|
150 |
|
151 for (TInt i = 0; i<smsSettingsOrg->ServiceCenterCount(); i++) |
|
152 { |
|
153 if(smsSettingsOrg->GetServiceCenter(i).Name() != smsSettingsRef->GetServiceCenter(i).Name() || |
|
154 smsSettingsOrg->GetServiceCenter(i).Address() != smsSettingsRef->GetServiceCenter(i).Address() ) |
|
155 { |
|
156 TestCase().ERR_PRINTF1(_L("SMS Settings Service centres do not match !")); |
|
157 TestCase().SetTestStepResult(EFail); |
|
158 } |
|
159 } |
|
160 |
|
161 |
|
162 } |
|
163 TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionCompareSmsSettingsCR); |
|
164 TestCase().ActionCompletedL(*this); |
|
165 } |
|
166 |
|
167 |