cbsref/telephonyrefplugins/atltsy/integrationtest/src/testltsyphbkdeleteinvalidindex.cpp
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
child 21 4814c5a49428
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
     1 // Copyright (c) 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 //user include
       
    18 #include "testltsyphbkdeleteinvalidindex.h"
       
    19 
       
    20 CTestLtsyPhbkDeleteInvalidIndex::CTestLtsyPhbkDeleteInvalidIndex(CTestLtsyModel& aTestModel)
       
    21 	: CTestLtsyPhoneStoreBase(aTestModel)
       
    22 	{
       
    23 
       
    24 	}
       
    25 
       
    26 CTestLtsyPhbkDeleteInvalidIndex::~CTestLtsyPhbkDeleteInvalidIndex()
       
    27 	{
       
    28 	}
       
    29 
       
    30 CTestLtsyPhbkDeleteInvalidIndex* CTestLtsyPhbkDeleteInvalidIndex::NewLC(CTestLtsyModel& aTestModel)
       
    31 	{
       
    32 	CTestLtsyPhbkDeleteInvalidIndex* self = new (ELeave)CTestLtsyPhbkDeleteInvalidIndex(aTestModel);
       
    33 	CleanupStack::PushL(self);
       
    34 	self->ConstructL();
       
    35 	return self;
       
    36 	}
       
    37 
       
    38 CTestLtsyPhbkDeleteInvalidIndex* CTestLtsyPhbkDeleteInvalidIndex::NewL(CTestLtsyModel& aTestModel)
       
    39 	{
       
    40 	CTestLtsyPhbkDeleteInvalidIndex* self=CTestLtsyPhbkDeleteInvalidIndex::NewLC(aTestModel);
       
    41 	CleanupStack::Pop(self);
       
    42 	return self;
       
    43 	}
       
    44 
       
    45 void CTestLtsyPhbkDeleteInvalidIndex::ConstructL()
       
    46 	{
       
    47 
       
    48 	}
       
    49 
       
    50 TVerdict CTestLtsyPhbkDeleteInvalidIndex::doTestStepPreambleL()
       
    51 	{
       
    52 	INFO_PRINTF1(_L("CTestLtsyPhbkDeleteInvalidIndex::doTestStepPreambleL called"));
       
    53 	SetTestStepResult(EPass);
       
    54 	return TestStepResult();
       
    55 	}
       
    56 
       
    57 TVerdict CTestLtsyPhbkDeleteInvalidIndex::doTestStepL()
       
    58 	{
       
    59 	INFO_PRINTF1(_L("CTestLtsyPhbkDeleteInvalidIndex::doTestStepL called"));
       
    60 	TInt index = 251;
       
    61 	TRAPD(err,DeletePhonebookL(index));
       
    62 	if(err != KErrNone)
       
    63 		{
       
    64 		INFO_PRINTF2(_L("The error was returned %d!! when delete phonebook"),err);
       
    65 	    SetTestStepResult(EFail);
       
    66 		}
       
    67 	
       
    68 	index = 0;
       
    69 	TRAPD(err1,DeletePhonebookL(index));
       
    70 	if(err1 != KErrNone)
       
    71 		{
       
    72 		INFO_PRINTF2(_L("The error was returned %d!! when delete phonebook"),err1);
       
    73 	    SetTestStepResult(EFail);
       
    74 		}
       
    75 	
       
    76 	index = -5;
       
    77 	TRAPD(err2,DeletePhonebookL(index));
       
    78 	if(err2 != KErrNone)
       
    79 		{
       
    80 		INFO_PRINTF2(_L("The error was returned %d!! when delete phonebook"),err2);
       
    81 	    SetTestStepResult(EFail);
       
    82 		}
       
    83 		
       
    84 	return TestStepResult();
       
    85 	}
       
    86 
       
    87 TVerdict CTestLtsyPhbkDeleteInvalidIndex::doTestStepPostambleL()
       
    88 	{
       
    89 	INFO_PRINTF1(_L("CTestLtsyPhbkDeleteInvalidIndex::doTestStepPostambleL called"));
       
    90 	return TestStepResult();
       
    91 	}
       
    92 
       
    93 void CTestLtsyPhbkDeleteInvalidIndex::DeletePhonebookL(TInt aIndex)
       
    94 	{
       
    95 	TRequestStatus status;
       
    96 	PhoneBookStore().Delete(status,aIndex);
       
    97 	User::WaitForRequest(status);
       
    98 	TInt r=status.Int();
       
    99 	INFO_PRINTF2(_L("Delete() request status = %d"),r);
       
   100 	}
       
   101 
       
   102 // end of file