|
1 // Copyright (c) 2001-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 ESock TestCase OpenServer |
|
15 // |
|
16 // |
|
17 |
|
18 // EPOC includes |
|
19 #include <e32base.h> |
|
20 |
|
21 // Test system includes |
|
22 #include "esockopenserver.h" |
|
23 #include <c32root.h> |
|
24 |
|
25 |
|
26 #ifdef _DEBUG |
|
27 // Panic category for "absolutely impossible!" vanilla ASSERT()-type panics from this module |
|
28 // (if it could happen through user error then you should give it an explicit, documented, category + code) |
|
29 _LIT(KSpecAssert_ESockTestEsckOpn, "ESockTestEsckOpn"); |
|
30 #endif |
|
31 |
|
32 const TDesC& CEsockOpenServer::GetTestName() |
|
33 { |
|
34 // store the name of this test case |
|
35 _LIT(ret,"OpenServer"); |
|
36 |
|
37 return ret; |
|
38 } |
|
39 |
|
40 // destructor |
|
41 CEsockOpenServer::~CEsockOpenServer() |
|
42 { |
|
43 } |
|
44 |
|
45 // |
|
46 enum TVerdict CEsockOpenServer::easyTestStepL() |
|
47 { |
|
48 __ASSERT_DEBUG(iEsockSuite, User::Panic(KSpecAssert_ESockTestEsckOpn, 1)); |
|
49 const TInt ret = iEsockSuite->iSocketServer.Connect(); |
|
50 if (ret==KErrNone) |
|
51 { |
|
52 iEsockSuite->iSocketServer.ShareAuto(); |
|
53 Logger().WriteFormat(_L("Connecting to socket server success")); |
|
54 return EPass; |
|
55 } |
|
56 else |
|
57 { |
|
58 Logger().WriteFormat(_L("Connecting to socket server failed with %d"), ret); |
|
59 return EFail; |
|
60 } |
|
61 } |
|
62 |
|
63 |