commsfwutils/commsbufs/TS_mbufmgr/Test01CreateDeleteMBufMgr.cpp
changeset 0 dfb7c4ff071f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/commsfwutils/commsbufs/TS_mbufmgr/Test01CreateDeleteMBufMgr.cpp	Thu Dec 17 09:22:25 2009 +0200
@@ -0,0 +1,75 @@
+// Copyright (c) 2002-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:
+// Contains MBufMgr Test Step 01 to Create & destroy RMBufManager
+// 
+//
+
+// EPOC includes
+#include <e32base.h>
+
+// Test system includes
+#ifdef SYMBIAN_OLD_EXPORT_LOCATION
+#include "networking/log.h"
+#include "networking/teststep.h"
+#else
+#include <networking/log.h>
+#include <networking/teststep.h>
+#endif
+#include "TestStepCTMbufmgr.h"
+#include "TestSuiteCTMbufmgr.h"
+
+#include "Test01CreateDeleteMBufMgr.h"
+#include <comms-infras/commsbufpond.h>
+
+// constructor
+CTest01CreateDeleteMBufMgr::CTest01CreateDeleteMBufMgr()
+	{
+	iTestStepName = _L("MBufMgrTest01");// Store the name of this test case
+	}
+
+// destructor
+CTest01CreateDeleteMBufMgr::~CTest01CreateDeleteMBufMgr()
+	{
+	}
+
+//
+enum TVerdict CTest01CreateDeleteMBufMgr::doTestStepL(void)
+	{
+	__UHEAP_MARK;
+	
+#ifdef __CFLOG_ACTIVE
+	__CFLOG_CREATEL;
+	__CFLOG_OPEN;
+#endif
+	//-------------- substep 1 --------------------
+	Log(_L("  01 Create CMBufManager and install active scheduler:"));
+    CleanupStack::PushL( iActSch = new(ELeave) CActiveScheduler );
+	CActiveScheduler::Install(iActSch);
+	CreateInstanceMBufMgrL(KMBufDefaultHeapSize);
+
+	//-------------- substep 2 --------------------
+	Log(_L("  02 Clean up stack:"));
+	iBufPond.Close();
+	CActiveScheduler::Install(NULL);
+	CleanupStack::PopAndDestroy(iActSch);
+
+#ifdef __CFLOG_ACTIVE
+	__CFLOG_CLOSE;
+	__CFLOG_DELETE;
+#endif
+
+	__UHEAP_MARKEND;
+	return EPass;
+	}
+