diff -r e8c1ea2c6496 -r 8758140453c0 messaging/Src/TestMessProcessExistingMsg.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messaging/Src/TestMessProcessExistingMsg.cpp Thu Jan 21 12:53:44 2010 +0000 @@ -0,0 +1,91 @@ +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Symbian Foundation License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// This contains CTestMessProcessExistingMsg +// Base class for processing an existing message +// +// + + + +/** + @file TestMessProcessExistingMsg.cpp +*/ + +#include "TestMessProcessExistingMsg.h" + +// EPOC includes +#include +#include +#include +#include +#include + +/** + * Constructor. + * @return - None + * +*/ +CTestMessProcessExistingMsg::CTestMessProcessExistingMsg() +: CTestMessBase(ETrue) + { + } + +/** + * Override of base class pure virtual function + * @return - TVerdict code + * @leave - KErrNoMemory - memory allocatior failure + * @leave - KErrBadLibraryEntryPoint - Malformed MTM + * @leave - KErrNotFound - Not found the mtmUid and StepStepResult set to Fail + * +*/ +TVerdict CTestMessProcessExistingMsg::doTestStepL() + { + if ( TestStepResult() == EPass ) + { + CClientMtmRegistry* clientMtmRegistry=CClientMtmRegistry::NewL(*iSession); + CleanupStack::PushL(clientMtmRegistry); + + iMtmID=EntryL().Entry().iMtm; + + CBaseMtm* baseMtm=clientMtmRegistry->NewMtmL(iMtmID); + CleanupStack::PushL(baseMtm); + + // switch the context + TMsvId msgId=EntryL().EntryId(); + PrintEntryL(EntryL()); + baseMtm->SwitchCurrentEntryL(msgId); + baseMtm->LoadMessageL(); + + ProcessMessageL(*baseMtm, msgId); + + if ( TestStepResult() == EPass ) + { + PostProcessMessageL(); + } + + CleanupStack::PopAndDestroy(2, clientMtmRegistry); + } + + return TestStepResult(); + } + +/** + * Nothing done for open + * @return None + * @leave KErrNone and TestStepResult set to EFail + * +*/ +void CTestMessProcessExistingMsg::PostProcessMessageL() + { + }