1 // Copyright (c) 2005-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 // |
|
15 |
|
16 #ifndef T_SMUTTE_H_ |
|
17 #define T_SMUTTE_H_ |
|
18 |
|
19 #include <txtrich.h> |
|
20 #include <smstestbase.h> |
|
21 #include <test/testexecutestepbase.h> |
|
22 #include <commsdattypesv1_1.h> |
|
23 #include "smuthdr.h" |
|
24 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
25 #include <tmsvsmsentry.h> |
|
26 #endif |
|
27 using namespace CommsDat; |
|
28 |
|
29 const TUid KUidSmcmTestNonSense = {0x00011111}; |
|
30 const TUid KFileStreamId = {0x01010101}; |
|
31 |
|
32 class TCompare |
|
33 { |
|
34 public: |
|
35 TCompare(TBool aVal = ETrue) {iValue = aVal;} |
|
36 TCompare(const TCompare& aVal) {iValue = aVal.iValue;} |
|
37 void operator()(TBool aResult) {iValue = iValue && aResult;} |
|
38 operator TBool() const {return iValue;} |
|
39 TBool iValue; |
|
40 }; |
|
41 |
|
42 class CSmutTest : public CSmsTestBase |
|
43 { |
|
44 public: |
|
45 static CSmutTest* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest,CTestStep& aTestStep); |
|
46 ~CSmutTest(); |
|
47 TVerdict TestSmsEntryL(); |
|
48 TVerdict TestSettingsL(); |
|
49 TVerdict TestNumberL(); |
|
50 TVerdict TestEmailFieldsL(); |
|
51 TVerdict TestHeaderL(); |
|
52 TVerdict TestSmsUtilitiesL(); |
|
53 TVerdict TestSmsEmsExtensionsL(); |
|
54 private: |
|
55 CSmutTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest,CTestStep& aTestStep); |
|
56 void ConstructL(); |
|
57 |
|
58 void RunL() {}; |
|
59 void DoCancel() {}; |
|
60 |
|
61 void ShowMenuL(); |
|
62 void RunAutoL(); |
|
63 |
|
64 //Test Functions |
|
65 TBool TestSmsUtilities1L(CSmsHeader& aHeader); |
|
66 TBool TestSmsUtilities2L(CSmsHeader& aHeader); |
|
67 TBool TestSmsUtilities3L(CSmsHeader& aHeader); |
|
68 TBool TestInvalidTelephone(const TDesC& aTel, TDes& aDetails); |
|
69 TBool TestInvalidContact(const TDesC& aTel, TDes& aDetails); |
|
70 TBool TestDuplicateContact(const TDesC& aTel, TDes& aDetails); |
|
71 TBool TestValidTel(const TDesC& aTel, const TDesC& aExpect1, const TDesC& aExpect2, const TDesC& aNotExpect, TDes& rDetails); |
|
72 //CSmsSettings utilities/tests |
|
73 TBool TestSettingsStoreToCommDbL(); |
|
74 TBool CompareSettingsAndCommDbL(const CSmsSettings& aSettings) const; |
|
75 TBool CompareSettingsAndSmsBearerL(const CSmsSettings& aSettings) const; |
|
76 // void OpenCommDbModemTableLCC(CCommsDatabase*& rCommDb, CCommsDbTableView*& rTable) const; |
|
77 void TestSettingsRestoreDefectL(); |
|
78 void TestRevertSettingsL(); |
|
79 TBool CompareSettings(const CSmsSettings& aLeft, const CSmsSettings& aRight, TBool aTestSC = ETrue); |
|
80 TBool CompareMessageSettings(const CSmsMessageSettings& aLeft, const CSmsMessageSettings& aRight); |
|
81 TBool TestSettingsMembersL(CSmsSettings& aSettings); |
|
82 TBool TestMessageSettingsMembersL(CSmsMessageSettings& aSettings); |
|
83 void StoreSettingsL(const CSmsSettings& aSettings); |
|
84 void RestoreSettingsL(CSmsSettings& aSettings); |
|
85 void StoreHeaderL(const CSmsHeader& aHeader); |
|
86 void RestoreHeaderL(CSmsHeader& aHeader); |
|
87 TBool TestStoreRestoreSettingsL(const CSmsSettings& aSettings); |
|
88 TBool TestSmsSettingsCopyL(const CSmsSettings& aSettings); |
|
89 TBool CompareSettingsFiles( |
|
90 RFs& aFs, const TDesC& aCompare1, const TDesC& aCompare2 |
|
91 ); |
|
92 |
|
93 TBool CheckSmsEntry( |
|
94 const TMsvSmsEntry& aEntry, |
|
95 TBool aClassExpected, |
|
96 TSmsDataCodingScheme::TSmsClass aClass, |
|
97 TUint8 aPID, |
|
98 TBool aUPI, |
|
99 TMsvSmsEntry::TMsvSmsEntryAckSummary aDeliverySummary, |
|
100 TBool aValidMessageId, |
|
101 TInt32 aMessageId) const; |
|
102 |
|
103 TSmsProtocolIdentifier ConstructPID(TUint8 aVal) const; |
|
104 |
|
105 //CSmsNumber utilities |
|
106 void StoreNumberL(const CSmsNumber& aNumber, TUid aStreamId = KFileStreamId); |
|
107 void RestoreNumberL(CSmsNumber& rNumber, TUid aStreamId = KFileStreamId); |
|
108 TBool CompareNumbers(const CSmsNumber& aLeft, const CSmsNumber& aRight); |
|
109 TBool CompareServiceCenters(const CSmsServiceCenter& aLeft, const CSmsServiceCenter& aRight); |
|
110 |
|
111 HBufC8* ConvertToBinaryLC(const TDesC8& aHex) const; |
|
112 CSmsMessage* CreateSmsMessageLC(const TDesC8& aHexPdu) const; |
|
113 TBool CheckDescriptionL(RResourceFile& aResFile, TInt aId, TRefByValue<const TDesC> aDesc, ...); |
|
114 TBool TestSpecialSmsMessageIndicationPduL(RResourceFile& aResFile, TUint8 aMessageType, TUint8 aMessageCount, TInt aId); |
|
115 TBool TestSpecialSmsMessageIndicationPduL(RResourceFile& aResFile, TSmsUtilities::TSmsUtilitiesSpecialMessageType aMessageType, TInt aId); |
|
116 TBool TestVideoMessageIndicationPduL(RResourceFile& aResFile, CSmsHeader& aHeader, TInt aId); |
|
117 TBool TestVideoMessageIndicationPduL(RResourceFile& aResFile, TUint8 aMessageCount, CSmsHeader& aHeader, TInt aId); |
|
118 TBool TestEnhancedVoiceMailIndicationPduL(RResourceFile& aResFile, CSmsHeader& aHeader, TInt aId); |
|
119 TBool TestEnhancedVoiceMailIndicationPduL(RResourceFile& aResFile, TUint8 aMessageCount, CSmsHeader& aHeader, TInt aId); |
|
120 |
|
121 // Test CSmsEmailFields |
|
122 void StoreEmailFieldsL(const CSmsEmailFields& aEmailFields); |
|
123 void RestoreEmailFieldsL(CSmsEmailFields& aEmailFields); |
|
124 TBool TestEmailFieldsParsePassL(const TDesC& aMessage, const TDesC& aAddress, const TDesC& aSubject, const TDesC& aBody); |
|
125 TBool TestEmailFieldsParseFailL(const TDesC& aMessage); |
|
126 TBool TestEmailFieldsComposeL(const TDesC& aFields, const TDesC& aAddress1, const TDesC& aAddress2, const TDesC& aSubject); |
|
127 TBool CompareEmailFields(const CSmsEmailFields& aFields1, const CSmsEmailFields& aFields2); |
|
128 TBool CompareEmailFieldsAddresses(const MDesCArray& aAddresses1, const MDesCArray& aAddresses2); |
|
129 |
|
130 CSmsHeader* iSmsHeader; |
|
131 CRichText* iRichText; |
|
132 CParaFormatLayer* iParaLayer; |
|
133 CCharFormatLayer* iCharLayer; |
|
134 CMDBSession* iDBSession; |
|
135 CTestStep& iTestStep; |
|
136 }; |
|
137 |
|
138 |
|
139 #endif //T_SMUTTE_H_ |
|