|
1 // Copyright (c) 1999-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_SMCM2_H_ |
|
17 //#define T_SMCM2_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 //#include <commdb.h> |
|
30 #include <smsuaddr.h> |
|
31 |
|
32 GLDEF_D RTest test(_L("SMS Regression Test Harness")); |
|
33 GLDEF_D CTrapCleanup* theCleanup; |
|
34 |
|
35 GLDEF_C TInt E32Main(void); |
|
36 LOCAL_C void doMainL(void); |
|
37 |
|
38 class TCompare |
|
39 { |
|
40 public: |
|
41 TCompare(TBool aVal = ETrue) {iValue = aVal;} |
|
42 TCompare(const TCompare& aVal) {iValue = aVal.iValue;} |
|
43 void operator()(TBool aResult) {iValue = iValue && aResult;} |
|
44 operator TBool() const {return iValue;} |
|
45 TBool iValue; |
|
46 }; |
|
47 |
|
48 class COpActiveArray; |
|
49 |
|
50 class COpActive : public CActive |
|
51 { |
|
52 public: |
|
53 COpActive(COpActiveArray& aParent, TMsvId aId, TInt aPriority = CActive::EPriorityStandard); |
|
54 ~COpActive(); |
|
55 CMsvOperation* iOperation; |
|
56 TRequestStatus& Status() {SetActive(); return iStatus;} |
|
57 TMsvId Id() const {return iId;} |
|
58 |
|
59 private: |
|
60 void RunL(); |
|
61 void DoCancel(); |
|
62 TInt RunError(TInt aError); |
|
63 void Complete(TInt aError); |
|
64 |
|
65 COpActiveArray& iParent; |
|
66 CSmsTestUtils& iSmsTest; |
|
67 TMsvId iId; |
|
68 }; |
|
69 |
|
70 class COpActiveArray : public CArrayPtrFlat<COpActive> |
|
71 { |
|
72 friend class COpActive; |
|
73 |
|
74 public: |
|
75 COpActiveArray(CSmsTestUtils& aSmsTest); |
|
76 ~COpActiveArray(); |
|
77 void Start(TRequestStatus& aStatus); |
|
78 CSmsTestUtils& iSmsTest; |
|
79 void Cancel(); |
|
80 |
|
81 private: |
|
82 void ActiveComplete(const CActive& aActive, TInt aError); |
|
83 |
|
84 private: |
|
85 TRequestStatus* iReport; |
|
86 }; |
|
87 |
|
88 class CSmsRegressTest : public CSmsTestBase |
|
89 { |
|
90 public: |
|
91 static CSmsRegressTest* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest); |
|
92 ~CSmsRegressTest(); |
|
93 |
|
94 private: |
|
95 CSmsRegressTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest); |
|
96 void ConstructL(); |
|
97 |
|
98 void RunL(); |
|
99 void DoCancel(); |
|
100 TInt RunError(TInt aError); |
|
101 |
|
102 void ShowMenuL(); |
|
103 void RunAutoL(); |
|
104 |
|
105 void Test2SMSSInstancesL(); |
|
106 void DoRunTest2SMSSInstancesL(); |
|
107 |
|
108 //TBool CompareSettings(const CSmsSettings& aLeft, const CSmsSettings& aRight, TBool aTestSC = ETrue); |
|
109 //TBool CompareMessageSettings(const CSmsMessageSettings& aLeft, const CSmsMessageSettings& aRight); |
|
110 //TBool CompareNumbers(const CSmsNumber& aLeft, const CSmsNumber& aRight); |
|
111 |
|
112 enum TSmsRegressTestState |
|
113 { |
|
114 EIdle, |
|
115 ETest2SMSSInstances |
|
116 } iState; |
|
117 |
|
118 COpActiveArray iOperations; |
|
119 CTestUtilsWatcherStarter* iWatchers; |
|
120 |
|
121 RSocketServ iSocketServ; //< A Socket Server |
|
122 RSocket iSocket; //< A Socket |
|
123 }; |
|
124 |
|
125 |
|
126 //#endif |