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