|
1 // Copyright (c) 2000-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_SMCM_H_ |
|
17 #define T_SMCM_H_ |
|
18 #include <e32base.h> |
|
19 |
|
20 #include <s32std.h> |
|
21 #include <txtrich.h> //CRichText |
|
22 #include <e32test.h> |
|
23 #include <msvuids.h> // ServiceEntry, FolderEntry, etc. |
|
24 #include <mtmuids.h> // query capabilities |
|
25 #include "smutset.h" // sms settings |
|
26 #include "smuthdr.h" // sms header |
|
27 #include "smsclnt.h" // sms (a)sync commands |
|
28 #include "smstestbase.h" |
|
29 |
|
30 const TUid KFileStreamId = {0x01010101}; |
|
31 const TUid KUidSmcmTestNonSense = {0x00011111}; |
|
32 |
|
33 const TMsvPartList KMsvMessagePartBody = 0x00000001; |
|
34 const TMsvPartList KMsvMessagePartRecipient = 0x00000002; |
|
35 const TMsvPartList KMsvMessagePartOriginator = 0x00000004; |
|
36 const TMsvPartList KMsvMessagePartDescription = 0x00000008; |
|
37 const TMsvPartList KMsvMessagePartDate = 0x00000010; |
|
38 const TMsvPartList KMsvMessagePartAttachments = 0x00000020; |
|
39 |
|
40 |
|
41 _LIT(KSmsClientMtmTestName, "SMS Client MTM"); |
|
42 _LIT(KSmsUtilitiesTestName, "SMS Utilities"); |
|
43 |
|
44 class CSmcmTest : public CSmsTestBase |
|
45 { |
|
46 public: |
|
47 static CSmcmTest* NewLC(CSmsTestUtils& aTestUtils, const TDesC& aScriptFile, TInt& aNextTest); |
|
48 ~CSmcmTest(); |
|
49 |
|
50 private: |
|
51 CSmcmTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest); |
|
52 void ConstructL(); |
|
53 |
|
54 void RunL() {}; |
|
55 void DoCancel() {}; |
|
56 |
|
57 void ShowMenuL(); |
|
58 void RunAutoL(); |
|
59 |
|
60 //Test Functions |
|
61 void TestSettingsL(); |
|
62 |
|
63 //Client Mtm Test Functions |
|
64 void TestCapabilitiesL(); |
|
65 void TestFindL(); |
|
66 void TestReplyL(); |
|
67 void TestForwardL(); |
|
68 void TestSyncFunctionsL(); |
|
69 |
|
70 CSmsHeader* iSmsHeader; |
|
71 CRichText* iRichText; |
|
72 CParaFormatLayer* iParaLayer; |
|
73 CCharFormatLayer* iCharLayer; |
|
74 }; |
|
75 |
|
76 class TCompare |
|
77 { |
|
78 public: |
|
79 TCompare(TBool aVal = ETrue) {iValue = aVal;} |
|
80 TCompare(const TCompare& aVal) {iValue = aVal.iValue;} |
|
81 void operator()(TBool aResult) {iValue = iValue && aResult;} |
|
82 operator TBool() const {return iValue;} |
|
83 TBool iValue; |
|
84 }; |
|
85 |
|
86 class CSmutTest : public CSmsTestBase |
|
87 { |
|
88 public: |
|
89 static CSmutTest* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest); |
|
90 ~CSmutTest(); |
|
91 |
|
92 private: |
|
93 CSmutTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest); |
|
94 void ConstructL(); |
|
95 |
|
96 void RunL() {}; |
|
97 void DoCancel() {}; |
|
98 |
|
99 void ShowMenuL(); |
|
100 void RunAutoL(); |
|
101 |
|
102 //Test Functions |
|
103 void TestSettingsL(); |
|
104 void TestHeaderL(); |
|
105 void TestSmsUtilitiesL(); |
|
106 void TestSmsUtilities1L(CSmsHeader& aHeader); |
|
107 void TestSmsUtilities2L(CSmsHeader& aHeader); |
|
108 void TestSmsUtilities3L(CSmsHeader& aHeader); |
|
109 void TestInvalidTelOrContact(const TDesC& aTel, TDes& rDetails); |
|
110 void TestValidTel(const TDesC& aTel, const TDesC& aExpect1, const TDesC& aExpect2, const TDesC& aNotExpect, TDes& rDetails); |
|
111 |
|
112 //CSmsSettings utilities/tests |
|
113 void TestSettingsStoreToCommDbL(); |
|
114 TBool CompareSettingsAndCommDbL(const CSmsSettings& aSettings) const; |
|
115 TBool CompareSettingsAndSmsBearerL(const CSmsSettings& aSettings) const; |
|
116 // void OpenCommDbModemTableLCC(CCommsDatabase*& rCommDb, CCommsDbTableView*& rTable) const; |
|
117 void TestSettingsRestoreDefectL(); |
|
118 TBool CompareSettings(const CSmsSettings& aLeft, const CSmsSettings& aRight, TBool aTestSC = ETrue); |
|
119 TBool CompareMessageSettings(const CSmsMessageSettings& aLeft, const CSmsMessageSettings& aRight); |
|
120 void TestSettingsMembersL(CSmsSettings& aSettings); |
|
121 void TestMessageSettingsMembersL(CSmsMessageSettings& aSettings); |
|
122 void StoreSettingsL(const CSmsSettings& aSettings); |
|
123 void RestoreSettingsL(CSmsSettings& aSettings); |
|
124 void StoreHeaderL(const CSmsHeader& aHeader); |
|
125 void RestoreHeaderL(CSmsHeader& aHeader); |
|
126 |
|
127 //CSmsNumber utilities |
|
128 void TestNumberL(); |
|
129 void StoreNumberL(const CSmsNumber& aNumber, TUid aStreamId = KFileStreamId); |
|
130 void RestoreNumberL(CSmsNumber& rNumber, TUid aStreamId = KFileStreamId); |
|
131 TBool CompareNumbers(const CSmsNumber& aLeft, const CSmsNumber& aRight); |
|
132 TBool CompareServiceCenters(const CSmsServiceCenter& aLeft, const CSmsServiceCenter& aRight); |
|
133 |
|
134 CSmsHeader* iSmsHeader; |
|
135 CRichText* iRichText; |
|
136 CParaFormatLayer* iParaLayer; |
|
137 CCharFormatLayer* iCharLayer; |
|
138 }; |
|
139 |
|
140 #endif |