diff -r 417699dc19c9 -r c7e9f1c97567 xml/legacyminidomparser/xmlparser/test/t_GmxmlFailure.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml/legacyminidomparser/xmlparser/test/t_GmxmlFailure.h Mon Sep 13 13:16:40 2010 +0530 @@ -0,0 +1,76 @@ +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#include +#include +#include + +/** @file + * This file contains the declaration of the generic CGmxmlFailure class + * which is responsible for testing the memory leak in the XMLParser. + */ + +class CGmxmlFailure : public CActive, public MMDXMLParserObserver + { +public: + /** Allocates and constructs a new CGmxmlFailure test. + @return New CGmxmlFailure + */ + static CGmxmlFailure* NewLC(); + + // Second constructor + void ConstructL(); + + /** Constructor. */ + CGmxmlFailure(); + + /** Destructor. */ + ~CGmxmlFailure(); + + /** + * Functions from MMDXMLParserObserver class + */ + void ParseFileCompleteL(); + + /** + * Function from MMDXMLComposerObserver + */ + void ComposeFileCompleteL(); + + void LoadXmlFile(const TDesC &aFilePath); + void LockXmlFile(); + +public: // from CActive + void DoCancel(); + /* + * RunL function inherited from CActive base class - carries out the actual + * parser leak test. + * @leave can Leave due to OOM + */ + void RunL(); + +private: + CMDXMLParser* iCMDXMLParser; + RFs iSession; // File session for ParseFile. + TInt iState; + enum TStates + { + EEndState = 0x00, + ENonExistFileState, + ELockFileState, + }; + }; + +