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