author | Simon Howkins <simonh@symbian.org> |
Wed, 27 Oct 2010 16:22:14 +0100 | |
changeset 1284 | 0b4a09013baf |
parent 872 | 17498133d9ad |
permissions | -rw-r--r-- |
117
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
2 |
// All rights reserved. |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
3 |
// This component and the accompanying materials are made available |
872 | 4 |
// under the terms of the License "Eclipse Public License v1.0" |
117
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
5 |
// which accompanies this distribution, and is available |
872 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
117
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
7 |
// |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
8 |
// Initial Contributors: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
9 |
// Nokia Corporation - initial contribution. |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
10 |
// |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
11 |
// Contributors: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
12 |
// |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
13 |
// Description: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
14 |
// This class creates the Gsm sms header and service settings. It fills up the |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
15 |
// fields using data read from the ini file |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
16 |
// |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
17 |
// |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
18 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
19 |
#include "Configuration.cfg" |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
20 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
21 |
#include "TestMessCreateGsmSmsUtil.h" |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
22 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
23 |
/** |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
24 |
Constructor |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
25 |
*/ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
26 |
CTestMessCreateGsmSmsUtil::CTestMessCreateGsmSmsUtil(CTestMessBase &aTestStep) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
27 |
: CTestMessCreateSmsUtilBase(aTestStep) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
28 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
29 |
aTestStep.INFO_PRINTF1(_L("The GSM SMS util is created")); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
30 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
31 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
32 |
/** |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
33 |
Prepares the SMS account details for CSendAs/RSendAs |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
34 |
@leave - KErrNoMemory |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
35 |
@leave - System wide error codes |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
36 |
*/ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
37 |
void CTestMessCreateGsmSmsUtil::PrepareAccountL(CMsvSession& /*aSession*/) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
38 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
39 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
40 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
41 |
/** |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
42 |
Creates the header object for the GSM sms message |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
43 |
@param aBodyText - body text of the message |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
44 |
@return CSmsHeader* - pointer to CSmsHeader |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
45 |
@leave - KErrNoMemory |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
46 |
@leave - system wide error codes |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
47 |
*/ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
48 |
CSmsHeader* CTestMessCreateGsmSmsUtil::NewHeaderL(CRichText &aBodyText) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
49 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
50 |
return CSmsHeader::NewL(CSmsPDU::ESmsSubmit, aBodyText); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
51 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
52 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
53 |
/** |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
54 |
Fills up the header object with the data read from the ini file. |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
55 |
@param aSmsHeader - sms header object ofthe sms message |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
56 |
@leave - system wide error codes |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
57 |
*/ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
58 |
void CTestMessCreateGsmSmsUtil::PrepareHeaderL(CSmsHeader &aSmsHeader) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
59 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
60 |
// Get bearer data |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
61 |
TPtrC ptrBearer; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
62 |
TBool returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KBearer, ptrBearer); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
63 |
if ( !returnValue ) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
64 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
65 |
//If bearer is not provided, read from the default section of the ini file |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
66 |
returnValue=iTestStep.GetStringFromConfig(KDef, KDefBearer, ptrBearer); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
67 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
68 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
69 |
if ( returnValue ) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
70 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
71 |
//default value for Bio message ID type |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
72 |
TBioMsgIdType bearer = EBioMsgIdNbs; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
73 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
74 |
iTestStep.INFO_PRINTF2(_L("Bearer = %S"), &ptrBearer); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
75 |
if (ptrBearer.CompareF(KBearerWap) == 0) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
76 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
77 |
//Set Wap message ID |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
78 |
bearer = EBioMsgIdWap; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
79 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
80 |
else if (ptrBearer.CompareF(KBearerWapSecure) == 0) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
81 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
82 |
//Set WapSecure message ID |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
83 |
bearer = EBioMsgIdWapSecure; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
84 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
85 |
else |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
86 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
87 |
iTestStep.INFO_PRINTF1(_L("No supported bearer is provided. Default is used")); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
88 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
89 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
90 |
//Set the Bio message ID type. |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
91 |
#if (defined CDMA_API_ENABLED) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
92 |
aSmsHeader.BioMessage().SetBioMsgIdType(bearer); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
93 |
#else |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
94 |
aSmsHeader.SetBioMsgIdType(bearer); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
95 |
#endif |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
96 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
97 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
98 |
// Get encoding data |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
99 |
TInt encoding; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
100 |
returnValue=iTestStep.GetIntFromConfig(iTestStep.ConfigSection(), KEncoding, encoding); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
101 |
if ( !returnValue ) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
102 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
103 |
//If encoding is not provied, read it from the default section of the ini file |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
104 |
returnValue=iTestStep.GetIntFromConfig(KDef, KDefEncoding, encoding); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
105 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
106 |
if ( returnValue ) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
107 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
108 |
iTestStep.INFO_PRINTF2(_L("Encoding = %d"), encoding); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
109 |
#if (defined CDMA_API_ENABLED) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
110 |
TSmsCharacterEncoding charEncoding; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
111 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
112 |
switch (encoding) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
113 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
114 |
case 7: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
115 |
//7 bit encoding format |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
116 |
charEncoding = KSmsEncoding7BitGsm; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
117 |
break; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
118 |
case 8: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
119 |
//8 bit encoding format |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
120 |
charEncoding = KSmsEncodingBinary; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
121 |
break; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
122 |
case 16: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
123 |
//Unicode encoding format |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
124 |
charEncoding = KSmsEncodingUnicode; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
125 |
break; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
126 |
default: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
127 |
//default encoding format |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
128 |
charEncoding = KSmsEncoding7BitGsm; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
129 |
break; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
130 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
131 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
132 |
//Set the character encoding |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
133 |
aSmsHeader.BioMessage().SetEncoding(charEncoding); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
134 |
#else |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
135 |
TSmsDataCodingScheme::TSmsAlphabet alpha = TSmsDataCodingScheme::ESmsAlphabet7Bit; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
136 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
137 |
switch (encoding) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
138 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
139 |
case 7: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
140 |
alpha = TSmsDataCodingScheme::ESmsAlphabet7Bit; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
141 |
break; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
142 |
case 8: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
143 |
alpha = TSmsDataCodingScheme::ESmsAlphabet8Bit; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
144 |
break; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
145 |
case 16: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
146 |
alpha = TSmsDataCodingScheme::ESmsAlphabetUCS2; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
147 |
break; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
148 |
default: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
149 |
alpha = TSmsDataCodingScheme::ESmsAlphabet7Bit; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
150 |
break; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
151 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
152 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
153 |
CSmsPDU& pdu=aSmsHeader.Message().SmsPDU(); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
154 |
if ( pdu.DataCodingSchemePresent() ) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
155 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
156 |
pdu.SetAlphabet(alpha); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
157 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
158 |
#endif |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
159 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
160 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
161 |
// Get delivery report data |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
162 |
TPtrC ptrDeliveryReport; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
163 |
returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KDeliveryReport, ptrDeliveryReport); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
164 |
if ( !returnValue ) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
165 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
166 |
returnValue=iTestStep.GetStringFromConfig(KDef, KDefDeliveryReport, ptrDeliveryReport); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
167 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
168 |
if ( returnValue ) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
169 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
170 |
TBool changeDR = EFalse; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
171 |
TBool deliveryReport = EFalse; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
172 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
173 |
iTestStep.INFO_PRINTF2(_L("Delivery Report = %S"), &ptrDeliveryReport); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
174 |
if (ptrDeliveryReport.CompareF(_L("NO")) == 0) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
175 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
176 |
changeDR = ETrue; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
177 |
deliveryReport = EFalse; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
178 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
179 |
else if (ptrDeliveryReport.CompareF(_L("YES")) == 0) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
180 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
181 |
changeDR = ETrue; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
182 |
deliveryReport = ETrue; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
183 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
184 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
185 |
if ( changeDR ) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
186 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
187 |
#if (defined CDMA_API_ENABLED) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
188 |
aSmsHeader.SetAcknowledgementRequest(ESmsAckTypeDelivery, deliveryReport); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
189 |
#else |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
190 |
switch ( aSmsHeader.Type() ) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
191 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
192 |
case CSmsPDU::ESmsSubmit: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
193 |
aSmsHeader.Submit().SetStatusReportRequest(deliveryReport); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
194 |
break; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
195 |
case CSmsPDU::ESmsCommand: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
196 |
aSmsHeader.Command().SetStatusReportRequest(deliveryReport); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
197 |
break; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
198 |
default: |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
199 |
User::Leave(KErrNotSupported); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
200 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
201 |
#endif |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
202 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
203 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
204 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
205 |
/** |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
206 |
Sets the fields for the sms account settings using data read from the ini file |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
207 |
If no data is given in ini file, the default settings in the account is used. |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
208 |
@param aSmsSettings - CSmsSettings reference |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
209 |
*/ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
210 |
void CTestMessCreateGsmSmsUtil::SetSmsAccountSettings(CSmsSettings &aSmsSettings) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
211 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
212 |
iTestStep.INFO_PRINTF1(_L("Set SMS account Settings....")); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
213 |
TBool boolTemp; |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
214 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
215 |
// Set the Reply quoted setting. |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
216 |
if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KReplyQuoted, boolTemp) ) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
217 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
218 |
aSmsSettings.SetReplyQuoted(boolTemp); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
219 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
220 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
221 |
// Set the Reject duplicate settings. |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
222 |
if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KRejectDuplicate, boolTemp) ) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
223 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
224 |
#if (defined CDMA_API_ENABLED) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
225 |
aSmsSettings.MessageSettings().Gsm().SetRejectDuplicate(boolTemp); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
226 |
#else |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
227 |
aSmsSettings.SetRejectDuplicate(boolTemp); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
228 |
#endif |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
229 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
230 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
231 |
// Set the option for delivery report. |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
232 |
if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KDeliveryReport, boolTemp) ) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
233 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
234 |
aSmsSettings.SetDeliveryReport(boolTemp); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
235 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
236 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
237 |
// Set the concatenate feature |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
238 |
if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KConCatenate, boolTemp) ) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
239 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
240 |
#if (defined CDMA_API_ENABLED) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
241 |
aSmsSettings.MessageSettings().Gsm().SetCanConcatenate(boolTemp); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
242 |
#else |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
243 |
aSmsSettings.SetCanConcatenate(boolTemp); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
244 |
#endif |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
245 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
246 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
247 |
// Set whether to use the same path while replying. |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
248 |
if(iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KReplyPath, boolTemp)) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
249 |
{ |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
250 |
#if (defined CDMA_API_ENABLED) |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
251 |
aSmsSettings.MessageSettings().Gsm().SetReplyPath(boolTemp); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
252 |
#else |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
253 |
aSmsSettings.SetReplyPath(boolTemp); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
254 |
#endif |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
255 |
} |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
256 |
|
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
257 |
//can implement these features later... |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
258 |
aSmsSettings.SetValidityPeriod(ESmsVPWeek); // week |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
259 |
aSmsSettings.SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFInteger); //relative |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
260 |
aSmsSettings.SetDelivery(ESmsDeliveryImmediately); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
261 |
aSmsSettings.SetMessageConversion(ESmsConvPIDNone); |
483f966c6335
Add first draft of smoketests
Louis Henry Nayegon <louisn@symbian.org>
parents:
diff
changeset
|
262 |
} |