telephonyserverplugins/simtsy/test/te_simeap/te_simeapteststepbase.cpp
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2006-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 #include "te_simeapteststepbase.h"
       
    17 
       
    18 TVerdict CSimEapTestStepBase::doTestStepPreambleL()
       
    19 	{
       
    20 	TInt ret = RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, 0);
       
    21 	if (ret != KErrNone)
       
    22 		{
       
    23 		INFO_PRINTF1(_L("Failed resetting"));
       
    24 		User::Leave(ret);
       
    25 		}
       
    26 
       
    27 	ret = iTelServer.Connect();
       
    28 	if (ret!=KErrNone)
       
    29 		{
       
    30 		INFO_PRINTF1(_L("Failed to connect to telephony server"));
       
    31 		User::Leave(ret);
       
    32 		}
       
    33 
       
    34    	ret = iTelServer.LoadPhoneModule(KSimtsyName);
       
    35 	if (ret != KErrNone)
       
    36 		{
       
    37 		INFO_PRINTF1(_L("Failed to load phone module"));
       
    38 		iTelServer.Close();
       
    39 		User::Leave(ret);
       
    40 		}
       
    41 
       
    42 	ret = iPhone.Open(iTelServer, KPhoneName);
       
    43 	if (ret != KErrNone)
       
    44 		{
       
    45 		INFO_PRINTF1(_L("Failed to open phone module"));
       
    46 		iTelServer.UnloadPhoneModule(KSimtsyName);
       
    47 		iTelServer.Close();
       
    48 		User::Leave(ret);
       
    49 		}
       
    50 
       
    51 	ret = iPhone.Initialise();
       
    52 	if (ret != KErrNone)
       
    53 		{
       
    54 		INFO_PRINTF1(_L("Failed to initialise the phone"));
       
    55 		iPhone.Close();
       
    56 		iTelServer.UnloadPhoneModule(KSimtsyName);
       
    57 		iTelServer.Close();
       
    58 		User::Leave(ret);
       
    59 		}
       
    60 
       
    61 	TUint32 phoneCaps;
       
    62 	ret = iPhone.GetMultimodeCaps(phoneCaps);
       
    63 	if ((KErrNone != ret) || ((phoneCaps & RMobilePhone::KCapsEapSupported) == 0))
       
    64 		{
       
    65 		INFO_PRINTF2(_L("This phone does not support EAP (caps=0x%x)"), phoneCaps);
       
    66 		iPhone.Close();
       
    67 		iTelServer.UnloadPhoneModule(KSimtsyName);
       
    68 		iTelServer.Close();
       
    69 		User::Leave(ret);
       
    70 		}
       
    71 
       
    72 	return TestStepResult();
       
    73 	}
       
    74 
       
    75 TVerdict CSimEapTestStepBase::doTestStepPostambleL()
       
    76 	{
       
    77 	iPhone.Close();
       
    78 	iTelServer.UnloadPhoneModule(KSimtsyName);
       
    79 	iTelServer.Close();
       
    80 
       
    81 	return TestStepResult();
       
    82 	}