cbsref/telephonyrefplugins/atltsy/integrationtest/src/testltsysmsread.cpp
changeset 49 f50f4094acd7
equal deleted inserted replaced
48:14460bf2a402 49:f50f4094acd7
       
     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 "testltsysmsread.h"
       
    19 #include "testltsysmsatutil.h"
       
    20 
       
    21 CTestLtsySmsRead::CTestLtsySmsRead(CTestLtsyModel& aTestModel)
       
    22 	: CTestLtsySmsBase(aTestModel)
       
    23 	{
       
    24 
       
    25 	}
       
    26 
       
    27 CTestLtsySmsRead::~CTestLtsySmsRead()
       
    28 	{
       
    29 	}
       
    30 
       
    31 CTestLtsySmsRead* CTestLtsySmsRead::NewLC(CTestLtsyModel& aTestModel)
       
    32 	{
       
    33 	CTestLtsySmsRead* self = new (ELeave)CTestLtsySmsRead(aTestModel);
       
    34 	CleanupStack::PushL(self);
       
    35 	self->ConstructL();
       
    36 	return self;
       
    37 	}
       
    38 
       
    39 CTestLtsySmsRead* CTestLtsySmsRead::NewL(CTestLtsyModel& aTestModel)
       
    40 	{
       
    41 	CTestLtsySmsRead* self=CTestLtsySmsRead::NewLC(aTestModel);
       
    42 	CleanupStack::Pop(self);
       
    43 	return self;
       
    44 	}
       
    45 
       
    46 void CTestLtsySmsRead::ConstructL()
       
    47 	{
       
    48 
       
    49 	}
       
    50 
       
    51 TVerdict CTestLtsySmsRead::doTestStepPreambleL()
       
    52 	{
       
    53 	INFO_PRINTF1(_L("CTestLtsySmsRead::doTestStepPreambleL called"));
       
    54 	SetTestStepResult(EPass);
       
    55 	return TestStepResult();
       
    56 	}
       
    57 
       
    58 TVerdict CTestLtsySmsRead::doTestStepL()
       
    59 	{
       
    60 	INFO_PRINTF1(_L("CTestLtsySmsRead::doTestStepL called"));
       
    61 	TInt index(6);
       
    62 	TRAPD(err,ReadSmsL(index));
       
    63 	if(err != KErrNone)
       
    64 		{
       
    65 		INFO_PRINTF2(_L("The error was returned %d!! when delete sms"),err);
       
    66 	    SetTestStepResult(EFail);
       
    67 		}
       
    68 	return TestStepResult();
       
    69 	}
       
    70 
       
    71 TVerdict CTestLtsySmsRead::doTestStepPostambleL()
       
    72 	{
       
    73 	INFO_PRINTF1(_L("CTestLtsySmsRead::doTestStepPostambleL called"));
       
    74 	return TestStepResult();
       
    75 	}
       
    76 void CTestLtsySmsRead::ReadSmsL(TInt aIndex)
       
    77 	{
       
    78 	TRequestStatus status;
       
    79 	TPckg<RMobileSmsStore::TMobileGsmSmsEntryV1> pckgEntryV1(iEntryV1);
       
    80 	iEntryV1.iIndex = aIndex;		
       
    81 	SmsStore().Read(status, pckgEntryV1);
       
    82 	User::WaitForRequest(status);
       
    83 	TInt r = status.Int();
       
    84 	INFO_PRINTF2(_L("Delete() request status = %d"),r);
       
    85 	TBuf<400>  msgAsciiData;
       
    86 	TBuf8<400> msgAscii; 
       
    87 	SmsAtUtil::AppendDataToAscii(msgAscii,iEntryV1.iMsgData);
       
    88 	msgAsciiData.Copy( msgAscii );
       
    89 	INFO_PRINTF4(_L("SmsStoreRead index=%d,status=%d,msgData=%S\n"),
       
    90 			        iEntryV1.iIndex,iEntryV1.iMsgStatus,&msgAsciiData);
       
    91 	}
       
    92 
       
    93 //End of file