|
1 // Copyright (c) 2002-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 // Contain the implementation of the class for this null agent test |
|
15 // |
|
16 // |
|
17 |
|
18 #include "NullAgentTestSteps.h" |
|
19 #include "es_sock.h" |
|
20 #include "in_sock.h" |
|
21 |
|
22 CTestStepNullAgtSimpleConnection::CTestStepNullAgtSimpleConnection(TPtrC aName) |
|
23 { |
|
24 iTestStepName=aName; |
|
25 } |
|
26 |
|
27 enum TVerdict CTestStepNullAgtSimpleConnection::doTestStepL(void) |
|
28 { |
|
29 __UHEAP_MARK; |
|
30 |
|
31 TInt r; // the result of various operations |
|
32 RSocketServ server; |
|
33 RConnection connection; |
|
34 TRequestStatus status; |
|
35 |
|
36 // connect to the socket server |
|
37 r = server.Connect(); |
|
38 TESTEL(r == KErrNone, r); |
|
39 CleanupClosePushL(server); |
|
40 |
|
41 // we created a socket server so we had it when opening the connection... |
|
42 r = connection.Open(server, KAfInet); |
|
43 TESTEL(r == KErrNone, r); |
|
44 CleanupClosePushL(connection); |
|
45 |
|
46 // start the connection (outgoing) |
|
47 connection.Start(status); |
|
48 User::WaitForRequest(status); |
|
49 TESTEL(status.Int() == KErrNone, status.Int()); |
|
50 |
|
51 // force it to be torn down |
|
52 r = connection.Stop(); |
|
53 TESTEL(r == KErrNone, r); |
|
54 CleanupStack::Pop(); |
|
55 |
|
56 // close the socket server |
|
57 server.Close(); |
|
58 CleanupStack::Pop(); |
|
59 |
|
60 __UHEAP_MARKEND; |
|
61 |
|
62 return iTestStepResult; |
|
63 } |