/**
doTestStepL()
Performs the comparison of POP messages

@return
Returns the teststep result.
*/
TVerdict CT_MsgComparePopEmailMsgs::doTestStepL()
	{
	INFO_PRINTF1(_L("Test Step: Compare Pop Email Msgs"));
		
	if(LoadParametersL())
		{
		User::LeaveIfError(iFs.Connect());
		CleanupClosePushL(iFs);
		
			// Normally do not push an object that is a data member of another object.
			// But in this case we want to close early if we get a leave.
			// Otherwise the iFs would be open till the thread had begun to die.
		if(TestStepResult() == EPass)
			{
			CMsvEntry* recvMsvEntry = iSharedDataPOP.iSession->GetEntryL(KMsvRootIndexEntryId);
			CleanupStack::PushL(recvMsvEntry);
			CMsvEntry* sentMsvEntry = iSharedDataPOP.iSession->GetEntryL(KMsvRootIndexEntryId);
			CleanupStack::PushL(sentMsvEntry);

			for(TInt i = 0;i < iInboxSelectionList->Count();i++)
				{
				recvMsvEntry->SetEntryL(iInboxSelectionList->At(i));
				TMsvEntry recvEntry = recvMsvEntry->Entry();
				for(TInt j = 0;j < iSentSelectionList->Count();j++)
					{
					sentMsvEntry->SetEntryL(iSentSelectionList->At(j));
					TMsvEntry sentEntry = sentMsvEntry->Entry();
					if(recvEntry.iDescription.Compare(sentEntry.iDescription) == 0) 
						{
						CExpPop3MailInfo* pExpMailInfo = NULL;
						for(int k = 0;k < iExpResults.Count();k++)
							{
							if(iExpResults[k]->GetDescription().Compare(recvEntry.iDescription) == 0)
								{
								pExpMailInfo =  iExpResults[k];
								break;
								}
							}
						if(! pExpMailInfo)
							{
							ERR_PRINTF2(_L("Test %d failed could not retrieve expected mail info"), j+1);
							SetTestStepResult(EFail);
							break;
							}

						if(! DoCompareL(recvEntry, *pExpMailInfo, sentEntry))
							{
							INFO_PRINTF2(_L("Test %d failed"), j + 1);
							SetTestStepResult(EFail);
							}														
						}
					}
				}
			CleanupStack::PopAndDestroy(2, recvMsvEntry); // recvMsvEntry, sentMsvEntry
			}		
		CleanupStack::PopAndDestroy();
		}		
	INFO_PRINTF1(_L("T_ComparePopEmailMsgs Completed"));
	return TestStepResult();
	}
void CPackagerTestSession::NextStepL() const
/** Called by active object to do second stage of client request,
i.e. compare items and complete the result back to the client */
	{
	iMessage->Complete(DoCompareL());
	}