|
1 // Copyright (c) 2004-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 // This contains CTestSuiteEsock |
|
15 // This is the container class for all the Esock test steps |
|
16 // |
|
17 // |
|
18 |
|
19 #if (!defined __TESTSUITESOCK_H__) |
|
20 #define __TESTSUITESOCK_H__ |
|
21 |
|
22 #include <test/testexecuteserverbase.h> |
|
23 #include <es_sock.h> |
|
24 |
|
25 #include <c32comm.h> |
|
26 |
|
27 #if defined (__WINS__) |
|
28 #define PDD_NAME _L("ECDRV") |
|
29 #define LDD_NAME _L("ECOMM") |
|
30 #else |
|
31 #define PDD_NAME _L("EUART1") |
|
32 #define LDD_NAME _L("ECOMM") |
|
33 #endif |
|
34 |
|
35 //Some Macros for adding test steps |
|
36 |
|
37 #define START_TEST_STEP_LIST |
|
38 |
|
39 #define ADD_TEST_STEP(c) \ |
|
40 if (aStepName == c::GetTestName()) \ |
|
41 { \ |
|
42 c* ret = new(ELeave) c; \ |
|
43 ret->iEsockSuite = this; \ |
|
44 ret->SetTestStepName(c::GetTestName()); \ |
|
45 return ret; \ |
|
46 } |
|
47 |
|
48 #define END_TEST_STEP_LIST \ |
|
49 return NULL; |
|
50 |
|
51 //--------------------------------------------------------- |
|
52 |
|
53 |
|
54 class CTestSuiteEsock : public CTestServer |
|
55 { |
|
56 public: |
|
57 void InitialiseL( void ); |
|
58 ~CTestSuiteEsock(); |
|
59 |
|
60 // void AddTestStepL( CTestStepEsock * ptrTestStep ); |
|
61 TPtrC GetVersion( void ); |
|
62 |
|
63 TInt AddSocketToList(RSocket& aSocket); |
|
64 TInt AddSocketToListL(RSocket& aSocket); |
|
65 void CloseSocket(TInt aIndex); |
|
66 TInt GetSocketListCount(); |
|
67 RSocket& GetSocketHandle(TInt anIndex); |
|
68 |
|
69 static CTestSuiteEsock* NewL(); |
|
70 virtual CTestStep* CreateTestStep(const TDesC& aStepName); |
|
71 |
|
72 RSocketServ iSocketServer; |
|
73 //CArrayFixFlat<RSocket *> * iSocketList; |
|
74 RArray<RSocket> iSocketArray; |
|
75 |
|
76 private: |
|
77 RHeap* iTestSuiteHeap; |
|
78 }; |
|
79 |
|
80 // these values have been copied from Testenv.h |
|
81 const TInt KSmallBufSize = 256; |
|
82 const TInt KLargeBufSize = 2048; |
|
83 const TInt KHugeBufSize = 16384; |
|
84 |
|
85 // ESOCK test macros copied from Testenv.h |
|
86 typedef TBuf8<KLargeBufSize> TLargeBuf; |
|
87 #define IPADDR(a,b,c,d) (TUint32)(((a)<<24)|((b)<<16)|((c)<<8)|(d)) |
|
88 |
|
89 |
|
90 #endif /* __TESTSUITESOCK_H__ */ |
|
91 |
|
92 |