commsfwutils/commsbufs/TS_mbufmgr/Test01CreateDeleteMBufMgr.cpp
author Fionntina Carville <fionntinac@symbian.org>
Wed, 17 Nov 2010 16:18:58 +0000
branchRCL_3
changeset 88 077156ad1d4e
parent 0 dfb7c4ff071f
permissions -rw-r--r--
Bug 2675. Take default commdb from ipconnmgmt instead.

// 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;
	}