当前位置: 首页>>代码示例>>C++>>正文


C++ CEmailAccounts::GetPopAccountsL方法代码示例

本文整理汇总了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);	
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:35,代码来源:CMtfTestActionGetPopAccountInArray.cpp

示例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();
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:69,代码来源:T_DeletePopAccount.cpp

示例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();
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:40,代码来源:T_VerifyPopAccountsCount.cpp


注:本文中的CEmailAccounts::GetPopAccountsL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。