本文整理汇总了C++中CEmailAccounts::GetPopAccountsL方法的典型用法代码示例。如果您正苦于以下问题:C++ CEmailAccounts::GetPopAccountsL方法的具体用法?C++ CEmailAccounts::GetPopAccountsL怎么用?C++ CEmailAccounts::GetPopAccountsL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEmailAccounts
的用法示例。
在下文中一共展示了CEmailAccounts::GetPopAccountsL方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExecuteActionL
/**
Function : ExecuteActionL
Description : Entry point for the this test action in the test framework
@internalTechnology
@param : none
@return : void
@pre none
@post none
*/
void CMtfTestActionGetPopAccountInArray::ExecuteActionL()
{
TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionGetPopAccountInArray);
TInt indexNumber = ObtainValueParameterL<TInt>(TestCase(), ActionParameters().Parameter(0));
CEmailAccounts* accounts = CEmailAccounts::NewLC();
RArray<TPopAccount> accountArray;
CleanupClosePushL(accountArray);
accounts->GetPopAccountsL(accountArray);
// make sure we're not out of range
if (indexNumber >= 0 && indexNumber < accountArray.Count())
{
TPopAccount id = accountArray[indexNumber];
StoreParameterL<TPopAccount>( TestCase(), id, ActionParameters().Parameter(1));
}
else
{
TestCase().ERR_PRINTF1(_L("Index is out of range!"));
TestCase().SetTestStepResult(EFail);
}
CleanupStack::PopAndDestroy( 2, accounts );
TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionGetPopAccountInArray);
TestCase().ActionCompletedL(*this);
}
示例2: doTestStepL
/**
doTestStepL()
Reads the POP account name from the ini file. If ALL string is mentioned in the .ini file
it deletes all the IMAP accounts, Else deletes the IMAP account whose name is
mentioned in the ini file
@return
Returns the test step result
*/
TVerdict CT_MsgDeletePopAccount::doTestStepL()
{
INFO_PRINTF1(_L("Test Step: Delete Pop Account"));
TPtrC popAccountName;
// Read Pop Account Name from ini file
if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
{
ERR_PRINTF1(_L("Account name not specified"));
SetTestStepResult(EFail);
}
else
{
CEmailAccounts* account = CEmailAccounts::NewLC();
RArray<TPopAccount> arrayPop3Accounts;
CleanupClosePushL(arrayPop3Accounts);
account->GetPopAccountsL(arrayPop3Accounts);
TInt count=arrayPop3Accounts.Count();
TBuf<12> temp(popAccountName);
temp.UpperCase(); // Making case insensitive
if(temp.CompareC(_L("ALL")) == 0)
{
INFO_PRINTF2(_L("Deleting all accounts. Total = %d"), count);
for(TInt i=0; i<count; i++)
{
TPopAccount id = arrayPop3Accounts[i];
account->DeletePopAccountL(id);
}
}
else
{
TBool deleteFlag = EFalse;
for(TInt i = 0; i < count; i++)
{
if(popAccountName.CompareC(arrayPop3Accounts[i].iPopAccountName) == 0)
{
account->DeletePopAccountL(arrayPop3Accounts[i]);
// Just ensure that if we try to delete it again we hopefuly get an error
// or can see that it has been deleted.
arrayPop3Accounts.Remove(i);
deleteFlag = ETrue;
break;
}
}
if(deleteFlag)
{
INFO_PRINTF2(_L("Pop acount \" %S \" deleted"), &popAccountName);
}
else
{
ERR_PRINTF2(_L("Pop acount \" %S \" not found"), &popAccountName);
SetTestStepResult(EFail);
User::Leave(KErrNotFound);
}
}
CleanupStack::PopAndDestroy(2, account); //arrayPop3Accounts,account
}
return TestStepResult();
}
示例3: doTestStepL
/**
doTestStepL()
Reads the expected count from the ini file.
Obtains the count of the POP accounts created and compares against the expected number.
@return
Returns the test step result.
*/
TVerdict CT_MsgVerifyPopAccountsCount::doTestStepL()
{
INFO_PRINTF1(_L("Test Step: Verify Pop Accounts Count"));
TInt expectedCount = -1;
if(!GetIntFromConfig(ConfigSection(), KExpectedCount, expectedCount) && expectedCount < 0)
{
ERR_PRINTF1(_L("ExpectedCount is not Specified or < 0"));
SetTestStepResult(EFail);
}
else
{
CEmailAccounts *account = CEmailAccounts::NewLC();
RArray<TPopAccount> arrayPopAccounts;
account->GetPopAccountsL(arrayPopAccounts);
TInt count = arrayPopAccounts.Count();
CleanupStack::PopAndDestroy(account);
arrayPopAccounts.Reset();
if (count != expectedCount)
{
ERR_PRINTF3(_L("Number of POP accounts do not match ! expected = %d actual = %d"),
expectedCount, count);
SetTestStepResult(EFail);
}
else
{
INFO_PRINTF2(_L("Number of POP accounts matched value = %d !"), expectedCount);
}
}
return TestStepResult();
}