telephonyserverplugins/simtsy/test/Te_SimMisc/Te_SimMiscTestStepBase.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     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 #include "Te_SimMiscTestStepBase.h"
       
    17 
       
    18 TVerdict CSimMiscTestStepBase::doTestStepPreambleL()
       
    19 	{
       
    20 	__UHEAP_MARK;
       
    21 
       
    22 	TInt ret = RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, 0);
       
    23 	if (ret != KErrNone)
       
    24 		{
       
    25 		INFO_PRINTF1(_L("Failed resetting"));
       
    26 		User::Leave(ret);
       
    27 		}
       
    28 
       
    29 	ret = iTelServer.Connect();
       
    30 	if (ret!=KErrNone)
       
    31 		{
       
    32 		INFO_PRINTF1(_L("Failed to connect to telephony server"));
       
    33 		User::Leave(ret);
       
    34 		}
       
    35    	ret=iTelServer.LoadPhoneModule(KSimtsyName);
       
    36 	if (ret!=KErrNone)
       
    37 		{
       
    38 		INFO_PRINTF1(_L("Failed to load phone module"));
       
    39 		iTelServer.Close();
       
    40 		User::Leave(ret);
       
    41 		}
       
    42 
       
    43 	ret=iPhone.Open(iTelServer,KPhoneName) ;
       
    44 	if (ret!=KErrNone)
       
    45 		{
       
    46 		INFO_PRINTF1(_L("Failed to open phone module"));
       
    47 		iTelServer.UnloadPhoneModule(KSimtsyName);
       
    48 		iTelServer.Close();
       
    49 		User::Leave(ret);
       
    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 	return TestStepResult();
       
    62 	}
       
    63 
       
    64 TVerdict CSimMiscTestStepBase::doTestStepPostambleL()
       
    65 	{
       
    66 	iPhone.Close();
       
    67 	iTelServer.UnloadPhoneModule(KSimtsyName);
       
    68 	iTelServer.Close();
       
    69 
       
    70 	__UHEAP_MARKEND;
       
    71 	return TestStepResult();
       
    72 	}