kerneltest/e32test/heap/t_fail.cpp
changeset 293 0659d0e1a03c
parent 189 a5496987b1da
equal deleted inserted replaced
291:206a6eaaeb71 293:0659d0e1a03c
     1 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   248 	RHeap* rHeap = UserHeap::ChunkHeap(NULL, 0, pageSize);
   248 	RHeap* rHeap = UserHeap::ChunkHeap(NULL, 0, pageSize);
   249 	test_NotNull(rHeap);
   249 	test_NotNull(rHeap);
   250 	__RHEAP_RESET(rHeap);
   250 	__RHEAP_RESET(rHeap);
   251 	__RHEAP_MARK(rHeap);
   251 	__RHEAP_MARK(rHeap);
   252 
   252 
   253 
       
   254 	// Prepare for __KHEAP tests by:
       
   255 	// Turning off lazy dll unloading
       
   256 	RLoader l;
       
   257 	test(l.Connect()==KErrNone);
       
   258 	test(l.CancelLazyDllUnload()==KErrNone);
       
   259 	l.Close();
       
   260 
       
   261 	// Loading the kernel heap test driver
   253 	// Loading the kernel heap test driver
   262 	test.Next(_L("Load/open d_kheap test driver"));
   254 	test.Next(_L("Load/open d_kheap test driver"));
   263 	TInt r = User::LoadLogicalDevice(KHeapTestDriverName);
   255 	TInt r = User::LoadLogicalDevice(KHeapTestDriverName);
   264 	test( r==KErrNone || r==KErrAlreadyExists);
   256 	test( r==KErrNone || r==KErrAlreadyExists);
   265 	if( KErrNone != (r=KHeapDevice.Open()) )	
   257 	if( KErrNone != (r=KHeapDevice.Open()) )	
   651 #else
   643 #else
   652 GLDEF_C TInt E32Main()
   644 GLDEF_C TInt E32Main()
   653 //
   645 //
   654 // __KHEAP_SETFAIL etc. not available in release mode, so don't test
   646 // __KHEAP_SETFAIL etc. not available in release mode, so don't test
   655 //
   647 //
   656 	{	 
   648 	{
       
   649 	COMPLETE_POST_BOOT_SYSTEM_TASKS();
   657 
   650 
   658 	test.Title();
   651 	test.Title();
   659 	test.Start(_L("No tests in release mode"));
   652 	test.Start(_L("No tests in release mode"));
   660 	test.End();
   653 	test.End();
   661 	return(KErrNone);
   654 	return(KErrNone);