kerneltest/e32test/mmu/t_chunk3.cpp
author Tom Cosgrove <tom.cosgrove@nokia.com>
Fri, 28 May 2010 16:29:07 +0100
changeset 137 8aab599e3476
parent 0 a41df078684a
child 109 b3a1d9898418
permissions -rw-r--r--
Fix for bug 2283 (RVCT 4.0 support is missing from PDK 3.0.h) Have multiple extension sections in the bld.inf, one for each version of the compiler. The RVCT version building the tools will build the runtime libraries for its version, but make sure we extract all the other versions from zip archives. Also add the archive for RVCT4.

// Copyright (c) 1995-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 "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:
// e32test\mmu\t_chunk3.cpp
// 
//

#include <e32test.h>
#include "u32std.h"
#include "../misc/prbs.h"

RTest test(_L("T_CHUNK3"));
const TInt KHeapSize=4096;

GLDEF_C TInt E32Main()
	{
	TUint seed[2];
	seed[0]=0xddb3d743;
	seed[1]=0;

	test.Title();
	test.Start(_L("Testing chunk resizing"));

	RChunk c1;
	RChunk c2;
	TInt r=c1.CreateLocal(0,0x01000000);	// initial 0 max 16Mb
	test(r==KErrNone);
	r=c2.CreateLocal(0,0x01000000);			// initial 0 max 16Mb
	test(r==KErrNone);

	FOREVER
		{
		r=c1.Adjust(0x400000);				// adjust first chunk to 4Mb
		test(r==KErrNone);
		r=c1.Adjust(0);						// now adjust back to 0
		test(r==KErrNone);
		r=c1.Adjust(0x100000);				// adjust first chunk to 1Mb
		test(r==KErrNone);
		r=c2.Adjust(0x200000);				// now adjust second chunk to 2Mb
		test(r==KErrNone);

		TUint wait=Random(seed);
		wait &= 16383;						// delay in us between 0 and 16383
		User::AfterHighRes(wait);			// wait for a bit

		r=c2.Adjust(0);						// then back to zero
		test(r==KErrNone);
		r=c1.Adjust(0);						// both chunks back to zero
		test(r==KErrNone);
		}

//	test.End();
	}