|
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 __TE_DATA_TESTSTEP_BASE__ |
|
17 #define __TE_DATA_TESTSTEP_BASE__ |
|
18 |
|
19 #include <test/testexecutestepbase.h> |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <e32test.h> |
|
23 #include <e32keys.h> |
|
24 #include <c32comm.h> |
|
25 #include <f32file.h> |
|
26 #include <etel.h> |
|
27 #include <etelmm.h> |
|
28 |
|
29 //Test Checking Macros |
|
30 #define CHECKPOINT(code,expected,msg){\ |
|
31 TEST((code)==(expected));\ |
|
32 if (code != expected ) INFO_PRINTF1(msg);\ |
|
33 } |
|
34 |
|
35 #define CHECKPOINT_EXPR(boolexpr,msg) {\ |
|
36 TEST((boolexpr));\ |
|
37 if (EFalse == (boolexpr)) INFO_PRINTF1(msg);\ |
|
38 } |
|
39 |
|
40 const TInt KLocalTel=32; |
|
41 const TInt KRemoteTel=32; |
|
42 |
|
43 /** |
|
44 * Test class that enables Te_Data tests. |
|
45 * It's a base class for all test steps. |
|
46 */ |
|
47 |
|
48 class CTestDataStep : public CTestStep |
|
49 { |
|
50 public: |
|
51 virtual TVerdict doTestStepPreambleL(); |
|
52 virtual TVerdict doTestStepPostambleL(); |
|
53 |
|
54 CTestDataStep(); |
|
55 static void CleanUp(TAny *aPtr) ; |
|
56 |
|
57 enum EPhoneNumbers { EGood, ELocal, ERemote, ESca} ; |
|
58 |
|
59 protected: |
|
60 //Utils |
|
61 void GetPhoneNumberL(TDes& aNum, EPhoneNumbers aPhoneType) ; |
|
62 void WaitWithTimeoutL(TRequestStatus& aStatus, TInt aNumberOfMicroSeconds) ; |
|
63 |
|
64 void Print_RCall_TStatus(RCall::TStatus& aArg) ; |
|
65 void Print_TCapsEnum(RCall::TCaps& aArg) ; |
|
66 void TestLineCapabilitiesL() ; |
|
67 void Print_TMobilePhoneModeCaps(RMobilePhone::TMobilePhoneModeCaps& aArg) ; |
|
68 void TestGetCallCapabilitiesL(RCall& aCall) ; |
|
69 void TestLineCapabilitiesL(RMobileLine& aLine) ; |
|
70 //>returns remote modem number |
|
71 void GetRemoteNumber(TDes& aNum){ GetPhoneNumberL(aNum, ERemote); } |
|
72 //>returns local number |
|
73 void GetLocalNumber(TDes& aNum){ GetPhoneNumberL(aNum, ELocal); } |
|
74 // TCleanupItem operator for objects of this class |
|
75 operator TCleanupItem() ; |
|
76 |
|
77 protected: |
|
78 TBuf8<KLocalTel> iLocalNumber; //< Local telephone number |
|
79 TBuf8<KRemoteTel> iRemoteNumber; //< Remote telephone number (modem) |
|
80 |
|
81 TRequestStatus iStatus; //< Request status used by asynchronous functions |
|
82 TRequestStatus iStatus2; |
|
83 TRequestStatus iStatus3; |
|
84 TRequestStatus iStatus4; |
|
85 TRequestStatus iStatus5; |
|
86 TRequestStatus iStatus6; |
|
87 TRequestStatus iStatus7; |
|
88 |
|
89 RTelServer iTelServer; |
|
90 RMobilePhone iPhone; |
|
91 RMobileLine iLine; //< Telephone line |
|
92 RMobileCall iDataCall; //< Voice call object |
|
93 RCall::TCallInfo iCallInfo; |
|
94 RPhone::TLineInfo iLineInfo; |
|
95 RPhone::TCaps iPhoneCaps; //< Phone capabalities |
|
96 TInt iLineIndex; |
|
97 }; |
|
98 |
|
99 #endif // __TE_DATA_TESTSTEP_BASE__ |