datacommsserver/esockserver/test/TE_EsockTestSteps/src/cancelconnectrsocketStep.cpp
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2007-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 cancelconnectrsocketStep.cpp
       
    18 */
       
    19 #include "Sockets.TestSteps.h"
       
    20 #include "cancelconnectrsocketStep.h"
       
    21 
       
    22 CCancelConnectrsocketStep::CCancelConnectrsocketStep(CCEsockTestBase*& aEsockTest)
       
    23 :   CTe_EsockStepBase(aEsockTest)
       
    24 	{
       
    25 	SetTestStepName(KCancelConnectrsocketStep);
       
    26 	}
       
    27 
       
    28 TInt CCancelConnectrsocketStep::ConfigureFromIni()
       
    29     {
       
    30 	//clean parameters from previous runs
       
    31 	iParams.Reset();
       
    32 
       
    33 	// Read in appropriate fields
       
    34 	if((GetStringFromConfig(iSection, KTe_SocketName, iParams.iSocketName) != 1)
       
    35 		|| (iParams.iSocketName.Length() == 0))
       
    36 		{
       
    37 		INFO_PRINTF3(KErrString_MissingConfigFileField, &iSection, &KTe_SocketName);
       
    38 		return KErrNotFound;
       
    39 		}
       
    40 		
       
    41     return KErrNone;
       
    42     }
       
    43 
       
    44 
       
    45 TVerdict CCancelConnectrsocketStep::doSingleTestStep()
       
    46 	{
       
    47     TInt error = iEsockTest->CancelConnectSocket(iParams);
       
    48 
       
    49     if (error!=KErrNone)
       
    50         {
       
    51         INFO_PRINTF2(_L("Could not cancel connecting socket (%S)."),&iParams.iSocketName);
       
    52         INFO_PRINTF2(_L("Error: %d."),error);
       
    53 		SetTestStepResult(EFail);
       
    54 		}
       
    55 	return TestStepResult();
       
    56 	}
       
    57 
       
    58 
       
    59