Update contrib.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
23 #include "t_message.h"
25 #include "t_testactionspec.h"
28 _LIT8(KMessageStart, "<message>");
29 _LIT8(KMessageEnd, "</message>");
31 CTestActionMessage* CTestActionMessage::NewL(CConsoleBase& aConsole,
33 const TTestActionSpec& aTestActionSpec)
35 CTestActionMessage* self = CTestActionMessage::NewLC(aConsole, aOut, aTestActionSpec);
36 CleanupStack::Pop(self);
40 CTestActionMessage* CTestActionMessage::NewLC(CConsoleBase& aConsole,
42 const TTestActionSpec& aTestActionSpec)
44 CTestActionMessage* self = new(ELeave) CTestActionMessage(aConsole, aOut);
45 CleanupStack::PushL(self);
46 self->ConstructL(aTestActionSpec);
50 CTestActionMessage::~CTestActionMessage()
55 void CTestActionMessage::DoPerformPrerequisite(TRequestStatus& aStatus)
57 iActionState = EAction;
58 TRequestStatus* status = &aStatus;
59 User::RequestComplete(status, KErrNone);
62 void CTestActionMessage::PerformAction(TRequestStatus& aStatus)
64 TRequestStatus* status = &aStatus;
65 User::RequestComplete(status, KErrNone);
66 iActionState = EPostrequisite;
69 void CTestActionMessage::DoPerformPostrequisite(TRequestStatus& aStatus)
71 TRequestStatus* status = &aStatus;
72 User::RequestComplete(status, KErrNone);
77 void CTestActionMessage::PerformMessage()
79 __ASSERT_DEBUG(EFalse, User::Panic(_L("CTestActionMessage::PerformMessage()"), 1));
82 void CTestActionMessage::Reset()
84 __ASSERT_DEBUG(EFalse, User::Panic(_L("CTestActionMessage::Reset()"), 1));
87 CTestActionMessage::CTestActionMessage(CConsoleBase& aConsole,
89 : CTestAction(aConsole, aOut)
93 void CTestActionMessage::ConstructL(const TTestActionSpec& aTestActionSpec)
95 CTestAction::ConstructL(aTestActionSpec);
98 HBufC8* aBody = HBufC8::NewLC(aTestActionSpec.iActionBody.Length());
99 aBody->Des().Copy(aTestActionSpec.iActionBody);
100 TPtrC8 pMessage = Input::ParseElement(*aBody, KMessageStart, KMessageEnd, pos, err);
101 User::LeaveIfError(err);
102 iMessage = pMessage.AllocL();
103 CleanupStack::PopAndDestroy();
106 void CTestActionMessage::DoReportAction()
108 iOut.writeString(*iMessage);
113 void CTestActionMessage::DoCheckResult(TInt /*aError*/)