cbsref/telephonyrefplugins/atltsy/integrationtest/src/testltsygetmessagestoreinfo.cpp
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
child 21 4814c5a49428
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
     1 //
       
     2 // testltsygetmessagestoreinfo.cpp
       
     3 //
       
     4 // Copyright (c) Symbian Software Ltd. Your copyright notice.  All rights reserved.
       
     5 //
       
     6 
       
     7 #include "testltsygetmessagestoreinfo.h"
       
     8 
       
     9 CTestLtsyGetMessageStoreInfo::CTestLtsyGetMessageStoreInfo(CTestLtsyModel& aTestModel)
       
    10 	: CTestLtsySmsBase(aTestModel)
       
    11 	{
       
    12 
       
    13 	}
       
    14 
       
    15 CTestLtsyGetMessageStoreInfo::~CTestLtsyGetMessageStoreInfo()
       
    16 	{
       
    17 	}
       
    18 
       
    19 CTestLtsyGetMessageStoreInfo* CTestLtsyGetMessageStoreInfo::NewLC(CTestLtsyModel& aTestModel)
       
    20 	{
       
    21 	CTestLtsyGetMessageStoreInfo* self = new (ELeave)CTestLtsyGetMessageStoreInfo(aTestModel);
       
    22 	CleanupStack::PushL(self);
       
    23 	self->ConstructL();
       
    24 	return self;
       
    25 	}
       
    26 
       
    27 CTestLtsyGetMessageStoreInfo* CTestLtsyGetMessageStoreInfo::NewL(CTestLtsyModel& aTestModel)
       
    28 	{
       
    29 	CTestLtsyGetMessageStoreInfo* self=CTestLtsyGetMessageStoreInfo::NewLC(aTestModel);
       
    30 	CleanupStack::Pop(self);
       
    31 	return self;
       
    32 	}
       
    33 
       
    34 void CTestLtsyGetMessageStoreInfo::ConstructL()
       
    35 	{
       
    36 
       
    37 	}
       
    38 
       
    39 TVerdict CTestLtsyGetMessageStoreInfo::doTestStepPreambleL()
       
    40 	{
       
    41 	INFO_PRINTF1(_L("CTestLtsyGetMessageStoreInfo::doTestStepPreambleL called"));
       
    42 	SetTestStepResult(EPass);
       
    43 	return TestStepResult();
       
    44 	}
       
    45 
       
    46 TVerdict CTestLtsyGetMessageStoreInfo::doTestStepL()
       
    47 	{
       
    48 	INFO_PRINTF1(_L("CTestLtsyGetMessageStoreInfo::doTestStepL called"));
       
    49 	TRAPD(err,GetMessageStoreInfoL());
       
    50 	if(err != KErrNone)
       
    51 		{
       
    52 		INFO_PRINTF2(_L("The error was returned %d!! when get message store info"),err);
       
    53 	    SetTestStepResult(EFail);
       
    54 		}
       
    55 	return TestStepResult();
       
    56 	}
       
    57 
       
    58 TVerdict CTestLtsyGetMessageStoreInfo::doTestStepPostambleL()
       
    59 	{
       
    60 	INFO_PRINTF1(_L("CTestLtsyGetMessageStoreInfo::doTestStepPostambleL called"));
       
    61 	return TestStepResult();
       
    62 	}
       
    63 
       
    64 void CTestLtsyGetMessageStoreInfo::GetMessageStoreInfoL()
       
    65 	{
       
    66 	TInt  smsIndex(0);             //smsIndex always is zero
       
    67 	TRequestStatus status;
       
    68 	RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg smsInfoPckg(iInfo);
       
    69 	Sms().GetMessageStoreInfo(status,smsIndex,smsInfoPckg);
       
    70 	User::WaitForRequest(status);
       
    71 	TInt r = status.Int();
       
    72 	INFO_PRINTF2(_L("GetMessageStoreInfo() request status = %d"),r);
       
    73 	CheckMessageStoreInfoL();
       
    74 	INFO_PRINTF4(_L("GetMessageStoreInfo MobileTypeName = %S, TotalEntries=%d,UsedEntries=%d\n"),&iInfo.iName,iInfo.iTotalEntries,iInfo.iUsedEntries );
       
    75 	}
       
    76 
       
    77 void CTestLtsyGetMessageStoreInfo::CheckMessageStoreInfoL()
       
    78 	{
       
    79 	TBool matched = ETrue;
       
    80 	if (!iInfo.iName.Compare(KETelIccSmsStore) == 0)
       
    81 		{
       
    82 		INFO_PRINTF2(_L("The tel sms store name %s could not match with expect one"),&(iInfo.iName));
       
    83 		matched = EFalse;
       
    84 		}
       
    85 	if(!matched)
       
    86 		{
       
    87 		SetTestStepResult(EFail);
       
    88 		}
       
    89 	}