|
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 /** |
|
17 @file multipleremoversubconnectionStep.cpp |
|
18 */ |
|
19 |
|
20 #include "SubConnections.TestSteps.h" |
|
21 #include "Sockets.TestSteps.h" |
|
22 |
|
23 #include <cdbcols.h> |
|
24 |
|
25 CMultipleRemoveRSubConnectionStep::CMultipleRemoveRSubConnectionStep(CCEsockTestBase*& aEsockTest) |
|
26 : CTe_EsockStepBase(aEsockTest) |
|
27 { |
|
28 SetTestStepName(KMultipleRemoveRSubConnectionStep); |
|
29 } |
|
30 |
|
31 TInt CMultipleRemoveRSubConnectionStep::ConfigureFromIni() |
|
32 { |
|
33 //clean parameters from previous runs |
|
34 iParams.Reset(); |
|
35 |
|
36 if (GetStringFromConfig(iSection,KTe_SocketName, iParams.iSocketName)!=1 |
|
37 || iParams.iSocketName.Length()==0) |
|
38 return KErrNotFound; |
|
39 |
|
40 if (GetStringFromConfig(iSection,KTe_SubConnectionName,iParams.iSubConnectionName)!=1 |
|
41 || iParams.iSubConnectionName.Length()==0) |
|
42 { |
|
43 INFO_PRINTF2(_L("%S: SubConnection name missing."),&iParams.iSubConnectionName); |
|
44 return KErrNotFound; |
|
45 } |
|
46 |
|
47 return KErrNone; |
|
48 } |
|
49 |
|
50 TVerdict CMultipleRemoveRSubConnectionStep::doSingleTestStep() |
|
51 { |
|
52 /* |
|
53 TRequestStatus reqStat,reqStat2; |
|
54 TInt error, error2; |
|
55 error = iEsockTest->RemoveSocketFromSubConnection(sockParams,reqStat); |
|
56 if (error!=KErrNone) |
|
57 { |
|
58 INFO_PRINTF2(_L("Could not remove socket (%d)!"),error); |
|
59 SetTestStepResult(EFail); |
|
60 } |
|
61 error2 = iEsockTest->RemoveSocketFromSubConnection(sockParams,reqStat2); |
|
62 if (error==KErrNone && error2==KErrNone && iCancelFlag) |
|
63 { |
|
64 error = iEsockTest->CancelRemoveSocketFromSubConnection(sockParams.iSubConnectionName); |
|
65 if (error!=KErrNone) |
|
66 { |
|
67 INFO_PRINTF2(_L("Could not cancel removeing subconnection (%d)!"),error); |
|
68 SetTestStepResult(EFail); |
|
69 } |
|
70 } |
|
71 if (error==KErrNone) |
|
72 { |
|
73 User::WaitForRequest(reqStat); |
|
74 if (reqStat.Int()!=KErrNone) |
|
75 { |
|
76 INFO_PRINTF2(_L("Could not remove socket (%d)!"),error); |
|
77 SetTestStepResult(EFail); |
|
78 } |
|
79 } |
|
80 if (error2==KErrNone) |
|
81 { |
|
82 User::WaitForRequest(reqStat2); |
|
83 if (reqStat2.Int()==KErrNone) |
|
84 { |
|
85 INFO_PRINTF1(_L("KErrNone returned on multiple RSubConnection::Remove()!")); |
|
86 SetTestStepResult(EFail); |
|
87 } |
|
88 } |
|
89 */ |
|
90 return TestStepResult(); |
|
91 } |
|
92 |