201017_06
authorhgs
Wed, 05 May 2010 05:11:16 +0100
changeset 131 e880629062dd
parent 130 c30940f6d922
child 132 e4a7b1cbe40c
201017_06
halservices/hal/bld.inf
halservices/hal/inc/hal.h
halservices/hal/inc/hal_data.h
halservices/hal/rom/haltests.auto.bat
halservices/hal/rom/haltests.iby
halservices/hal/rom/tshell_haltests.oby
halservices/hal/src/hal_main.cpp
halservices/hal/tsrc/t_haldefect.cpp
halservices/hal/tsrc/t_haldefect.mmp
halservices/hal/tsrc/t_newhal.cpp
kernel/eka/debug/trkdummyapp/group/bld.inf
kernel/eka/include/e32ver.h
kernel/eka/release.txt
kerneltest/e32utils/group/base_e32utils.mrp
kerneltest/e32utils/group/bld.inf
kerneltest/f32test/filesystem/automounter/automounter.inf
kerneltest/f32test/filesystem/automounter/bld.inf
kerneltest/f32test/group/bld.inf
kerneltest/f32test/server/t_falsespace.cpp
kerneltest/f32test/server/t_filecache.cpp
userlibandfileserver/fileserver/group/release.txt
userlibandfileserver/fileserver/inc/f32ver.h
userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp
userlibandfileserver/fileserver/sfile/sf_file_cache.cpp
--- a/halservices/hal/bld.inf	Tue May 04 09:44:26 2010 +0100
+++ b/halservices/hal/bld.inf	Wed May 05 05:11:16 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-2010 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"
@@ -25,16 +25,30 @@
 
 BASEUSERDEFAULT
 
+
 PRJ_EXPORTS
-inc/hal_int.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(kernel/)
-inc/hal_data.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(hal_data.h)
-inc/hal.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(hal.h)
-rom/hal.iby		/epoc32/rom/hal/	//
-rom/hal.hby		/epoc32/rom/hal/	//
+
+inc/hal_int.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(kernel/)
+inc/hal_data.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(hal_data.h)
+inc/hal.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(hal.h)
+
+rom/hal.iby				/epoc32/rom/hal/	//
+rom/hal.hby				/epoc32/rom/hal/	//
+
+
+PRJ_TESTEXPORTS
+
+rom/haltests.iby		/epoc32/rom/include/haltests.iby
+rom/haltests.auto.bat	/epoc32/rom/include/haltests.auto.bat
+
+rom/tshell_haltests.oby	 ../../kernel/eka/rombuild/tshell_haltests.oby
+
+
 
 PRJ_MMPFILES
 src/hal_lib
 
 PRJ_TESTMMPFILES
-tsrc/t_newhal
-tsrc/savehal
+tsrc/t_newhal		manual
+tsrc/savehal		manual
+tsrc/t_haldefect
--- a/halservices/hal/inc/hal.h	Tue May 04 09:44:26 2010 +0100
+++ b/halservices/hal/inc/hal.h	Wed May 05 05:11:16 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-2010 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"
@@ -124,14 +124,17 @@
     Gets all HAL attributes, and their properties.
 
     For attributes that are not meaningful on this device (ie. those which have
-	not been defined in the config.hcf file),
-	the attribute value and its associated property value are set to zero in
-	the returned array.
+	not been defined in the config.hcf file), the attribute value and its 
+	associated property value are set to zero in the returned array.
 
 	Attributes for which multiple values can be retrieved
 	ie. EDisplayIsPalettized, EDisplayBitsPerPixel, EDisplayOffsetToFirstPixel,
 	EDisplayOffsetBetweenLines, and EDisplayPaletteEntry will also be zero in
 	the returned array.
+	
+	Attributes that allocate resources and open handles are also not returned 
+	by this API. Their value and property values will be set to zero in the
+	returned array. Use HAL::Get() for these attributes.
 
     @param aNumEntries On successful return, contains the total number
                        of HAL attributes.
--- a/halservices/hal/inc/hal_data.h	Tue May 04 09:44:26 2010 +0100
+++ b/halservices/hal/inc/hal_data.h	Wed May 05 05:11:16 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-2010 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"
@@ -35,6 +35,11 @@
     
     They are also used by the HAL accessor functions.
     
+    Note: It is not recommended to use HAL attributes to pass handles from the  
+	kernel to user-side clients due to resource overhead's that will affect 
+	existing clients of HAL. HAL is designed to allow simply hardware parameters
+	to be shared with user-side clients without resource allocation overheads.
+    
     @see HAL::Get()
     @see HAL::Set()
     */
@@ -1080,6 +1085,9 @@
 		
 		/**
 		A Handle to the display memory.
+		This attribute opens a chunk, the client is responsible for closing it.
+		Using HAL attribtues to open handles is not recommended and this 
+		attribute may be removed in the future. 
 
 		@prototype 9.5
 		*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/halservices/hal/rom/haltests.auto.bat	Wed May 05 05:11:16 2010 +0100
@@ -0,0 +1,17 @@
+rem
+rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of the License "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+t_haldefect
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/halservices/hal/rom/haltests.iby	Wed May 05 05:11:16 2010 +0100
@@ -0,0 +1,28 @@
+// Copyright (c) 2010 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:
+// HAL Test Applications
+//
+
+#ifndef __HALTESTS_IBY__
+#define __HALTESTS_IBY__
+
+
+file=\Epoc32\Release\##MAIN##\##BUILD##\t_haldefect.exe 	\sys\bin\t_haldefect.exe
+file=\Epoc32\Release\##MAIN##\##BUILD##\t_newhal.exe 		\sys\bin\t_newhal.exe
+file=\Epoc32\Release\##MAIN##\##BUILD##\savehal.exe 		\sys\bin\savehal.exe
+
+data=\epoc32\rom\include\haltests.auto.bat					\haltests.auot.bat
+
+
+#endif // __HALTESTS_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/halservices/hal/rom/tshell_haltests.oby	Wed May 05 05:11:16 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2010 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:
+*
+*/
+
+#define BASE_ROM
+#include <rom\##VARIANT##\header.iby>
+
+
+files=
+
+#include <rom\##VARIANT##\kernel.iby>
+#include "user.iby"
+#include <rom\hal\hal.iby>
+#include <rom\f32\f32.iby>
+
+#include <rom\include\haltests.iby>
--- a/halservices/hal/src/hal_main.cpp	Tue May 04 09:44:26 2010 +0100
+++ b/halservices/hal/src/hal_main.cpp	Wed May 05 05:11:16 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-2010 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"
@@ -119,7 +119,14 @@
 			{
 			TInt offset = device*(TInt)ENumHalAttributes + i;
 			TInt properties=HalInternal::Properties[i];
-			if (properties & HAL::EValid)
+			// Exclusion of the EDisplayMemoryHandle attribute is a work around
+			// to avoid the handle and resources related to it from being 
+			// allocated. Callers of this API (halsettings - to save modifiable 
+			// atrributes) need to avoid this resource overhead. Clients of 
+			// this attribute need to use HAL::Get() directly.
+			// HAL should not be used for handle opening and this
+			// attribute should be replaced with a better API.
+			if ((properties & HAL::EValid) && (i != EDisplayMemoryHandle))
 				{
 				THalImplementation f=HalInternal::Implementation[i];
 				if (f)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/halservices/hal/tsrc/t_haldefect.cpp	Wed May 05 05:11:16 2010 +0100
@@ -0,0 +1,109 @@
+// Copyright (c) 2010 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:
+//
+
+#define __E32TEST_EXTENSION__
+#include <e32test.h>
+#include <e32svr.h>
+#include <e32cmn.h>
+#include <e32cmn_private.h>
+#include <hal.h>
+
+LOCAL_D RTest test(_L("T_HalDefect Testcases"));
+
+
+	
+void DoTestRC_361803()
+	{
+	__UHEAP_MARK;
+	test.Start(_L("DoTestRC_361803 tests"));
+
+	TInt origValue = 0;
+	TInt r = HAL::Get(HALData::EDisplayMemoryHandle, origValue);
+	// Standard base emulator PSL without "-1 check", HAL::Get, r==KErrArgument
+	// Standard base emulator PSL, no mods, HAL::GetAll, r==KErrNone, origValue==0
+	// NaviEngine PSL, no mods, r==KErrNotSupported
+	// Platforms that support it: r==KErrNone, origValue==+ve 
+	if ((r == KErrNotSupported) || (r == KErrArgument) || 
+	    (origValue == 0))						 // Skip test if not supported
+		{
+		test.Printf(_L("Platform doesn't support EDigitiserOrientation, skipping, (%d, %d)\n"), r, origValue);
+		test.End();
+		__UHEAP_MARKEND;
+		return;
+		}
+	// Attribute supported
+	test_KErrNone(r);
+	RHandleBase handle;
+	handle.SetHandle(origValue);
+	handle.Close();
+	test.Printf(_L("Platform DOES support EDigitiserOrientation, handle closed\n"));
+			
+	HAL::SEntry* pE = 0;
+	TInt pC = 0;
+	r = HAL::GetAll(pC, pE);
+	test_KErrNone(r);
+	
+	const HAL::SEntry* pS=pE;
+	const HAL::SEntry* pEnd=pS + pC;
+	TBool displayMemHandleFound = EFalse;
+		
+    test.Printf(_L("ENumHalAttributes == %d, nEntries == %d\n"), HALData::ENumHalAttributes, pC);
+	for (TInt s = 0; pS<pEnd; ++pS, ++s)
+		{
+		// Following line only needed for development and debug of test case.
+		// test.Printf(_L("Attr: %d; Prop: %x; Value: %x\n"), s, pS->iProperties, pS->iValue );
+ 
+		if ((pS->iProperties & HAL::EEntryValid ) &&
+		    ((s%HAL::ENumHalAttributes) == HALData::EDisplayMemoryHandle))
+		    {		    
+		    // Note, GetAll on Emulator PSL will set r==KErrNone and value to 0
+		    // So check value to ensure a handle has been allocated.
+		    if( pS->iValue >= 0 )
+		        {
+		        displayMemHandleFound++;
+		        RHandleBase handle;
+		        handle.SetHandle(pS->iValue);
+		        handle.Close();
+				break;
+		        }
+		    }	
+		}
+	
+	test.Printf(_L("HAL::GetAll() DisplayMemHandle should not have been found (0), result == (%d)\n"), displayMemHandleFound );
+	test_Equal(displayMemHandleFound, 0);
+		
+	test.Printf(_L("DoTestRC_361803 - complete\n"));
+	test.End();
+	__UHEAP_MARKEND;
+	}
+
+
+GLDEF_C TInt E32Main()
+    {
+	__UHEAP_MARK;
+	
+ 	test.Title();
+	test.Start(_L("User-side HAL Defect Test Cases"));
+	
+	DoTestRC_361803();	// ox1cimx1#361803
+	
+	test.Printf(_L("\n"));
+	test.End();
+	test.Close();
+
+	__UHEAP_MARKEND;
+    return KErrNone;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/halservices/hal/tsrc/t_haldefect.mmp	Wed May 05 05:11:16 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2010 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:
+*
+*/
+
+TARGET		t_haldefect.exe
+TARGETTYPE	EXE
+
+CAPABILITY	WriteDeviceData
+VENDORID	0x70000001
+SMPSAFE
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+SOURCEPATH	.
+SOURCE		t_haldefect.cpp
+
+LIBRARY		euser.lib
+LIBRARY		hal.lib
+
+
+
--- a/halservices/hal/tsrc/t_newhal.cpp	Tue May 04 09:44:26 2010 +0100
+++ b/halservices/hal/tsrc/t_newhal.cpp	Wed May 05 05:11:16 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-2010 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"
@@ -236,8 +236,11 @@
 			}
 		else
 			{
-			test.Printf(_L("Attribute %S not supported on this platform or requires parameter\n"),&att_name,r);
-			test(r==KErrNotSupported || r==KErrArgument);
+			test.Printf(_L("Attribute %S not supported on this platform or requires parameter: r==%d\n"),&att_name,r);
+			// For some reason the following attribtues come back "KErrNone" on 
+			// emulator...so guard added
+			if (i != HALData::EDisplayMemoryHandle)
+				test(r==KErrNotSupported || r==KErrArgument);
 			}
 		}
 	User::Free(pE);
--- a/kernel/eka/debug/trkdummyapp/group/bld.inf	Tue May 04 09:44:26 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-// Copyright (c) 2008-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:
-//
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-trkdummyapp.mmp
-trkdummyapp2.mmp
-trkdummyapp200159D8.mmp
-trkdummyapp200170BC.mmp
--- a/kernel/eka/include/e32ver.h	Tue May 04 09:44:26 2010 +0100
+++ b/kernel/eka/include/e32ver.h	Wed May 05 05:11:16 2010 +0100
@@ -28,7 +28,7 @@
 
 const TInt KE32MajorVersionNumber=2;
 const TInt KE32MinorVersionNumber=0;
-const TInt KE32BuildVersionNumber=3075;
+const TInt KE32BuildVersionNumber=3076;
 
 const TInt KMachineConfigurationMajorVersionNumber=1;
 const TInt KMachineConfigurationMinorVersionNumber=0;
--- a/kernel/eka/release.txt	Tue May 04 09:44:26 2010 +0100
+++ b/kernel/eka/release.txt	Wed May 05 05:11:16 2010 +0100
@@ -1,3 +1,16 @@
+Version 2.00.3076
+=================
+(Made by vfebvre 30/04/2010)
+
+1.	stmansfi
+	1.	ou1cimx1#352017 (MCL) Advisory notes related to cat x in TB92SF_1116 and MSF00398
+	2.	ou1cimx1#361803 (MCL) Adjust HAL::GetAll() to ignore DisplayMemoryHandle attribute
+
+2.	vfebvre
+	1.	ou1cimx1#357360 Some test binaries are targeted by several bld.inf files
+	2.	ou1cimx1#363918 Non-test binaries targeted by several bld.inf files
+
+
 Version 2.00.3075
 =================
 (Made by vfebvre 29/04/2010)
--- a/kerneltest/e32utils/group/base_e32utils.mrp	Tue May 04 09:44:26 2010 +0100
+++ b/kerneltest/e32utils/group/base_e32utils.mrp	Wed May 05 05:11:16 2010 +0100
@@ -1,18 +1,3 @@
-#
-# Copyright (c) 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: 
-#
 # component name "E32 Utilities"
 
 component	base_e32utils
@@ -32,6 +17,7 @@
 source	\sf\os\kernelhwsrv\kerneltest\e32utils\trace
 source	\sf\os\kernelhwsrv\kerneltest\e32utils\usbmsapp
 source	\sf\os\kernelhwsrv\kerneltest\e32utils\sdpartition	
+source	\sf\os\kernelhwsrv\kerneltest\e32utils\nandboot\coreldr\bootstrap_smrif.h
 	
 #MattD: Reltools 2.67 don't understand 'cwtools' are the CW equivelent of 'tools' and try to do '-what cwtools udeb' instead of '-what cwtools deb'.
 #binary	\sf\os\kernelhwsrv\kerneltest\e32utils\group cwtools
--- a/kerneltest/e32utils/group/bld.inf	Tue May 04 09:44:26 2010 +0100
+++ b/kerneltest/e32utils/group/bld.inf	Wed May 05 05:11:16 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-2010 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"
@@ -30,20 +30,19 @@
 
 PRJ_EXPORTS
 
-
-
+../nandboot/coreldr/bootstrap_smrif.h 		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bootstrap_smrif.h)
 
 ../profiler/profiler.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(profiler.h)
 
-../analyse/profiler.rtf	/epoc32/engdoc/profiler/profiler.rtf
+../analyse/profiler.rtf						/epoc32/engdoc/profiler/profiler.rtf
 
-../d_exc/printstk.pl /epoc32/rom/tools/printstk.pl
-../d_exc/printsym.pl /epoc32/rom/tools/printsym.pl
+../d_exc/printstk.pl 						/epoc32/rom/tools/printstk.pl
+../d_exc/printsym.pl 						/epoc32/rom/tools/printsym.pl
 
-../setcap/setcap.iby  /epoc32/rom/include/setcap.iby
+../setcap/setcap.iby						/epoc32/rom/include/setcap.iby
 
 ../demandpaging/dptest.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(dptest.h)
-../demandpaging/dptestcons.oby /epoc32/rom/include/dptestcons.oby
+../demandpaging/dptestcons.oby 				/epoc32/rom/include/dptestcons.oby
 
 PRJ_TESTEXPORTS
 ../trace/btracevw.pl /epoc32/tools/btracevw.pl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/filesystem/automounter/automounter.inf	Wed May 05 05:11:16 2010 +0100
@@ -0,0 +1,30 @@
+// Copyright (c) 1998-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:
+// 
+// Test code for file server
+// 
+//
+
+/**
+ @file
+*/
+
+
+PRJ_PLATFORMS
+
+BASEUSERDEFAULT
+
+PRJ_TESTMMPFILES
+t_automounter
+
--- a/kerneltest/f32test/filesystem/automounter/bld.inf	Tue May 04 09:44:26 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-// Copyright (c) 1998-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:
-// 
-// Test code for file server
-// 
-//
-
-/**
- @file
-*/
-
-
-PRJ_PLATFORMS
-
-BASEUSERDEFAULT
-
-PRJ_TESTMMPFILES
-t_automounter
-
--- a/kerneltest/f32test/group/bld.inf	Tue May 04 09:44:26 2010 +0100
+++ b/kerneltest/f32test/group/bld.inf	Wed May 05 05:11:16 2010 +0100
@@ -251,7 +251,7 @@
 
 t_swapfsys manual
 #include "../filesystem/fat/group/fatfs.inf"
-#include "../filesystem/automounter/bld.inf"
+#include "../filesystem/automounter/automounter.inf"
 
 
 #include "perf_test.inf"
--- a/kerneltest/f32test/server/t_falsespace.cpp	Tue May 04 09:44:26 2010 +0100
+++ b/kerneltest/f32test/server/t_falsespace.cpp	Wed May 05 05:11:16 2010 +0100
@@ -13,6 +13,7 @@
 // Description:
 //
 
+#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32svr.h>
@@ -67,7 +68,7 @@
 
     #endif
 
-    test(nRes == KErrNone);
+    test_KErrNone(nRes);
 }
 
 void SynchronousClose(RFs &aSession)
@@ -149,11 +150,11 @@
 
 	test.Start(_L("Fill disk to capacity"));
 	TInt r=TheFs.MkDirAll(KBasePath);
-	test(r==KErrNone || r==KErrAlreadyExists);
+	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
 	gCount=0;
 	TFileName sessionPath;
 	r=TheFs.SessionPath(sessionPath);
-	test(r==KErrNone);
+	test_KErrNone(r);
 	TBuf<128> fileName=KBaseName();
 	
 	TInt64 freespace=0;
@@ -179,7 +180,7 @@
 				else
 					fillfilesize=fillfilesize/2;
 				}
-			test(r==KErrNone || r==KErrDiskFull);
+			test_Value(r, r == KErrNone || r==KErrDiskFull);
 			if(r==KErrNone)
 				gCount++;
 			}
@@ -222,7 +223,7 @@
 	TVolumeInfo v;
 
 	TInt r=TheFs.Volume(v,gTestDrive);
-	test(r==KErrNone);
+	test_KErrNone(r);
 	aFree=v.iFree;
 	}
 
@@ -242,31 +243,31 @@
 	TInt64 diff;
 
 	r=TheFs.GetReserveAccess(gTestDrive);
-	test(r==KErrPermissionDenied);
+	test_Value(r, r == KErrPermissionDenied);
 	
 	//make sure nothing odd happens if we didnt already have access
 	r=TheFs.ReleaseReserveAccess(gTestDrive);
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	
 	GetFreeDiskSpace(free2);
 
 	r=TheFs.ReserveDriveSpace(gTestDrive,0x1000);
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	GetFreeDiskSpace(free1);
 	diff = free2 - free1;
 	test(I64INT(diff) > 0xfe0 && I64INT(diff) < 0x1100); 
 	
 	r=TheFs.GetReserveAccess(gTestDrive);
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	GetFreeDiskSpace(free1);
 	TInt64 temp = free2-free1;
 	test(I64INT(temp)>(-0x90) && I64INT(temp)<0x90);
 	
 	r=TheFs.ReleaseReserveAccess(gTestDrive);
-	test(r==KErrNone);
+	test_KErrNone(r);
 	GetFreeDiskSpace(free1);
 
 	diff = free2 - free1;
@@ -275,24 +276,24 @@
 	
 	//test reallocation of reserved space is possible
 	r=TheFs.ReserveDriveSpace(gTestDrive,0x2000);
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	//test upper limit of reserved space 
 	r=TheFs.ReserveDriveSpace(gTestDrive,0x2000000);
-	test(r==KErrArgument);
+	test_Value(r, r == KErrArgument);
 
 	r=TheFs.ReserveDriveSpace(gTestDrive,0);
-	test(r==KErrNone);
+	test_KErrNone(r);
 	
 	r=TheFs.GetReserveAccess(gTestDrive);
-	test(r==KErrPermissionDenied);
+	test_Value(r, r == KErrPermissionDenied);
 
 	//make sure nothing odd happens if we didnt already have access
 	r=TheFs.ReleaseReserveAccess(gTestDrive);
-	test(r==KErrNone);
+	test_KErrNone(r);
 	
 	r=TheFs.ReserveDriveSpace(gTestDrive,-45);
-	test(r==KErrArgument);
+	test_Value(r, r == KErrArgument);
 	}
 
 
@@ -315,12 +316,12 @@
 	for(i=0; i<17; i++)
 		{
 		r = sessions[i].Connect();
-		test(r==KErrNone);
+		test_KErrNone(r);
 		}
 
 	test.Next(_L("Test breaching sesson reserve limit"));
 	r=sessions[0].ReserveDriveSpace(gTestDrive,0x10001);
-	test(r==KErrArgument);
+	test_Value(r, r == KErrArgument);
 
 	//Get Volume Free Space
 	r = sessions[0].Volume(v, gTestDrive);
@@ -332,12 +333,12 @@
 		for (i=0; i<16; i++)
 			{
 			r=sessions[i].ReserveDriveSpace(gTestDrive,0x10000);
-			test(r==KErrNone);
+			test_KErrNone(r);
 			}
 
 		//The straw
 		r=sessions[16].ReserveDriveSpace(gTestDrive,0x10);
-		test(r==KErrTooBig);
+		test_Value(r, r == KErrTooBig);
 		}
 	else
 		{
@@ -347,12 +348,12 @@
 		for(i=0; (v.iFree -= 0x10000) >= 0; i++)
 			{
 			r=sessions[i].ReserveDriveSpace(gTestDrive,0x10000);
-			test(r==KErrNone);
+			test_KErrNone(r);
 			}
 
 		//The straw
 		r=sessions[i].ReserveDriveSpace(gTestDrive,0x10000);
-		test(r==KErrDiskFull);
+		test_Value(r, r == KErrDiskFull);
 		}
 
 	//Close Sessions
@@ -379,16 +380,16 @@
 	
 	TInt r=0;
 	r = fs1.Connect();
-	test(r==KErrNone);
+	test_KErrNone(r);
 	r = fs2.Connect();
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	GetFreeDiskSpace(free1);
 
 	r=fs1.ReserveDriveSpace(gTestDrive,0x10000);
-	test(r==KErrNone);
+	test_KErrNone(r);
 	r=fs2.ReserveDriveSpace(gTestDrive,0x10000);
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	GetFreeDiskSpace(free2);
 	diff = free1 - free2;
@@ -401,14 +402,14 @@
 	test(I64INT(diff)>0xFA00 && I64INT(diff)<0x103C4); 
 
 	r = fs1.Connect();
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	GetFreeDiskSpace(free1);
 	diff= free1-free2;
 	test(I64INT(diff)== 0 || I64INT(diff)<0xFA0 ); 
 
 	r=fs1.ReserveDriveSpace(gTestDrive,0x10000);
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	GetFreeDiskSpace(free2);
 	diff = free1 - free2;
@@ -416,16 +417,16 @@
 
 	// Make sure no reserve space is allocated
 	r=fs1.ReserveDriveSpace(gTestDrive,0);
-	test(r==KErrNone);
+	test_KErrNone(r);
 	r=fs2.ReserveDriveSpace(gTestDrive,0);
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	// Now fill up the disk
 	FillUpDisk();
 	
 	// Should fail as there is no space
 	r=fs1.ReserveDriveSpace(gTestDrive,0x10000);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	SynchronousClose(fs1);
 	SynchronousClose(fs2);
@@ -452,7 +453,7 @@
 
 	RFs fs;
 	TInt r=fs.Connect();
-	test(r==KErrNone);
+	test_KErrNone(r);
 	TInt64 freeA(0);
 	TInt64 freeB(0);
 	RFile file;
@@ -465,140 +466,140 @@
 	buf[0]=(TUint16)gCh;
 
 	r=file.Replace(fs, buf, EFileWrite);
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	r=file.Write(KTestData());
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	file.Close();
 
 	r=fs.ReserveDriveSpace(gTestDrive,0x10000);		//reserve some disk space
-	test(r==KErrNone);
+	test_KErrNone(r);
 		
 	FillUpDisk();									//fill up the disk
 
 	TVolumeInfo v;									//get disk space
 	r=fs.Volume(v,gTestDrive);
-	test(r==KErrNone);
+	test_KErrNone(r);
 	freeA=v.iFree;
 
 	r=fs.GetReserveAccess(gTestDrive);				//get access to reserve space
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	r=fs.Volume(v,gTestDrive);						//get disk space
-	test(r==KErrNone);
+	test_KErrNone(r);
 	freeB=v.iFree;
 	
 	r=fs.ReleaseReserveAccess(gTestDrive);			//release reserve space
-	test(r==KErrNone);
+	test_KErrNone(r);
 	
 	test(freeA == (freeB - 0x10000));				//test difference in space is equal to the amount reserved
 
 	r=fs.Volume(v,gTestDrive);						//get disk space
-	test(r==KErrNone);
+	test_KErrNone(r);
 	freeB=v.iFree;
 	test(freeA == freeB);							//check reading is still correct
 	
 	TBuf <20> dir = KDir();
 	dir[0]=(TUint16)gCh;
 	r=fs.MkDir(dir);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	r=fs.MkDirAll(dir);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	TFileName temp;
 	TBuf<5> drv = KDrv();
 	drv[0]=(TUint16)gCh;
 	r=file.Temp(fs, drv, temp, EFileWrite);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	r=file.Replace(fs, buf, EFileWrite);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	r=file.Create(fs, buf, EFileWrite);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	r=file.Open(fs, buf, EFileWrite);
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	r=file.Write(128, KTestData());
 
 	if ((gDriveCacheFlags & EFileCacheWriteOn) && (r == KErrNone))
 		r = file.Flush();
 	
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	r=file.SetSize(0x1000);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	r=file.SetAtt(KEntryAttHidden,0); 
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	TTime dtime;
 	r=file.SetModified(dtime); 
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	r=file.Set(dtime,KEntryAttHidden,0);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	r=file.Rename(buf);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	file.Close();
 
 
 	// Test that we can create a temporary file & write to it after acquiring reserved access, 
 	r=fs.GetReserveAccess(gTestDrive);				//get access to reserve space
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	r=fs.Volume(v,gTestDrive);						//get disk space
-	test(r==KErrNone);
+	test_KErrNone(r);
 	freeA = v.iFree;
 
 	r=file.Temp(fs, drv, temp, EFileWrite);
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	r = file.Write(KTestData());
-	test (r == KErrNone);
+	test_KErrNone(r);
 
 	// If write caching is enabled, call RFs::Entry() to flush the file "anonymously"
 	if ((gDriveCacheFlags & EFileCacheWriteOn) && (r == KErrNone))
 		{
 		r = file.Flush();
-		test (r == KErrNone);
+		test_KErrNone(r);
 		}
 
 	r=fs.Volume(v,gTestDrive);						//get disk space
-	test(r==KErrNone);
+	test_KErrNone(r);
 	freeB = v.iFree;
 	test (freeB < freeA);
 
 	file.Close();
 
 	r=fs.ReleaseReserveAccess(gTestDrive);			//release reserve space
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 
 	TBuf<20> newname =KNewName();
 	newname[0]=(TUint16)gCh;
 	r=fs.Rename(buf, newname);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	r=fs.Replace(buf, newname);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	r=fs.SetEntry(buf, dtime, KEntryAttHidden, 0);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	r=fs.CreatePrivatePath(gTestDrive);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	r=fs.SetVolumeLabel(_L("Moooo"), gTestDrive);
-	test(r==KErrDiskFull);	
+	test_Value(r, r == KErrDiskFull);	
 
 	r=fs.SetModified(buf, dtime);
-	test(r==KErrDiskFull);	
+	test_Value(r, r == KErrDiskFull);	
 
 	SynchronousClose(fs);
 	}
@@ -626,41 +627,41 @@
 	TInt r=KErrNone;
 
 	r=fs1.Connect();
-	test(r==KErrNone);
+	test_KErrNone(r);
 	r=fs2.Connect();
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	FormatDrive();
 
 	r=fs1.ReserveDriveSpace(gTestDrive,0x10000);		
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	r=fs2.ReserveDriveSpace(gTestDrive,0x10000);		
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	FillUpDisk();									
 
 	r=fs1.GetReserveAccess(gTestDrive);				
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	TBuf<20> dir = KDir();
 	dir[0]=(TUint16)gCh;
 
 
 	r=fs2.MkDir(dir);
-	test(r==KErrDiskFull);
+	test_Value(r, r == KErrDiskFull);
 
 	r=fs1.ReserveDriveSpace(gTestDrive,0); //can not release reserve space while you have reserve access
-	test(r==KErrInUse);
+	test_Value(r, r == KErrInUse);
 
 	r=fs1.ReleaseReserveAccess(gTestDrive);				
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	r=fs1.ReserveDriveSpace(gTestDrive,0); 
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	r=fs2.MkDir(dir);
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	SynchronousClose(fs1);
 	SynchronousClose(fs2);
@@ -741,19 +742,19 @@
 	TRequestStatus tStat[KNumberThreads];
 
 	r=fsess.Connect();
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	FormatDrive();
 
 	r= fsess.ShareAuto();
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	GetFreeDiskSpace(free1);
 
 	fsess.ReserveDriveSpace(gTestDrive,0x1000);
 		
 	r = t[0].Create(_L("Sub_Thread1"),RsrvSpaceThread,KDefaultStackSize,KHeapSize,KHeapSize,&fsess); 
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	t[0].Rendezvous(tStat[0]);
 	t[0].Resume();
@@ -764,7 +765,7 @@
 	test(tStat[0]==KErrNone);
 
 	r = t[1].Create(_L("Sub_Thread2"),SessCloseThread,KDefaultStackSize,KHeapSize,KHeapSize,&fsess); 
-	test(r==KErrNone);
+	test_KErrNone(r);
 
 	t[1].Rendezvous(tStat[1]);
 	t[1].Resume();
@@ -820,12 +821,12 @@
 	fileName[0] = (TUint16)gCh;
 
 	err = theTestSession.Connect();
-	test(err == KErrNone);
+	test_KErrNone(err);
 
 	// determine the cluster size
 	RFile theFile;
 	err=theFile.Replace(theTestSession, fileName, EFileShareAny | EFileWrite);
-	test(err==KErrNone);
+	test_KErrNone(err);
 
 	// Neither notifier should be triggered here
 	err = theFile.SetSize(1);
@@ -876,7 +877,7 @@
 	// "Normal" notifier to trigger but not the "Reserved" notifier
 	//
 	err=theFile.Replace(theTestSession, fileName, EFileShareAny | EFileWrite);
-	test(err==KErrNone);
+	test_KErrNone(err);
 	test((statNrm == KRequestPending) && (statRes == KRequestPending));
 
 	// Neither notifier should be triggered here
@@ -901,7 +902,7 @@
 	err = theTestSession.ReserveDriveSpace(gTestDrive, resSpace * 3);
 	if (err != KErrArgument)	// will have exceeded limit if resSpace = 32K
 		{
-		test(err == KErrNone);
+		test_KErrNone(err);
 		test((statNrm == KErrNone) && (statRes == KRequestPending));
 		}
 
@@ -926,7 +927,7 @@
     
     RFs fs;
     TInt err = fs.Connect();
-    test(err == KErrNone);
+    test_KErrNone(err);
 
     RFile file;
     TBuf<20> fileName;
@@ -934,43 +935,43 @@
     fileName[0] = (TUint16)gCh;
     
     err = fs.ReserveDriveSpace(gTestDrive,0x10000); 
-    test(err == KErrNone);
+    test_KErrNone(err);
 
     err = file.Replace(fs, fileName, EFileWrite);
-    test(err == KErrNone);
+    test_KErrNone(err);
 
     err = file.Write(KTestData);
-    test(err == KErrNone);
+    test_KErrNone(err);
     
     err = file.Flush();
-    test(err == KErrNone);
+    test_KErrNone(err);
     
     file.Close();
     
     err = file.Open(fs, fileName, EFileRead);
-    test(err == KErrNone);
+    test_KErrNone(err);
     
     err = file.Att(att);
-    test(err == KErrNone);
+    test_KErrNone(err);
     
     err = file.Modified(time);
-    test(err == KErrNone);
+    test_KErrNone(err);
     
     file.Close();
     
     FillUpDisk();
     
     err = file.Open(fs, fileName, EFileRead);
-    test(err == KErrNone);
+    test_KErrNone(err);
     
     TUint att1;
     err = file.Att(att1);
-    test(err == KErrNone);
+    test_KErrNone(err);
     test(att1 == att);
     
     TTime time1;
     err = file.Modified(time1);
-    test(err == KErrNone);
+    test_KErrNone(err);
     test(time1 == time);
     
     file.Close();
@@ -1000,7 +1001,7 @@
     TVolumeInfo volInfo;
 	
 	TInt nRes = TheFs.Volume(volInfo,gTestDrive);
-	test(nRes == KErrNone);
+	test_KErrNone(nRes);
 	
     if(volInfo.iSize < K4Gig+K1MegaByte)
 		{
@@ -1014,7 +1015,7 @@
     //-- find out media position of the data region start
     TFatBootSector bootSector;
     nRes = ReadBootSector(TheFs, gTestDrive, 0, bootSector);
-    test(nRes == KErrNone);
+    test_KErrNone(nRes);
     test(bootSector.IsValid());
 
     const TInt64 dataStartPos = bootSector.FirstDataSector() << KDefaultSectorLog2;
@@ -1031,28 +1032,59 @@
     for(i=0; i<MaxDummyFiles; ++i)
 		{
         nRes = CreateFileX(KBaseFN, i, DummyFileLen); 
-        test(nRes == KErrNone);
+        test_KErrNone(nRes);
 		}
 
     //-- 3. create a real file that crosses 4G boundary
     nRes = CreateCheckableStuffedFile(TheFs, KBaseFN, 5*K1MegaByte);
-    test(nRes == KErrNone);
+    test_KErrNone(nRes);
     
     test.Printf(_L("Verifying the file that crosses 4G boundary.\n"));
 
     nRes = VerifyCheckableFile(TheFs, KBaseFN);
-    test(nRes == KErrNone);
+    test_KErrNone(nRes);
 
 	
 	nRes = TheFs.Delete(KBaseFN);
-	test(nRes == KErrNone);
+	test_KErrNone(nRes);
     for(i=0; i<MaxDummyFiles; ++i)
 	    {
         nRes = DeleteFileX(KBaseFN, i); 
-        test(nRes == KErrNone);
+        test_KErrNone(nRes);
 		}
 	}
 
+void TestRAMDriveNotification()
+	{
+	test.Next(_L("Verifying RFs::ReserveDriveSpace() triggers RFs::NotifyDiskSpace() events"));
+
+	TInt64 freeSpace;
+	GetFreeDiskSpace(freeSpace);
+	test.Printf(_L("free space: 0x%Lx bytes\n"), freeSpace);
+
+	// set a notification on half the amount we plan to reserve
+	TInt reserve = 4096;
+	TInt64 trigger = freeSpace - 2048;
+	test.Printf(_L("setting notification for space to fall below: 0x%Lx bytes ... "), trigger);
+	TRequestStatus stat;
+	TheFs.NotifyDiskSpace(trigger, gTestDrive, stat);
+	test_Value(stat.Int(), stat == KRequestPending);
+	test.Printf(_L("ok\n"));
+
+	// reserve the space and validate that this triggers the notification
+	test.Printf(_L("reserving 0x%x bytes ..."), reserve);
+	TInt r = TheFs.ReserveDriveSpace(gTestDrive, reserve);
+	test_KErrNone(r);
+	test.Printf(_L("ok\n"));
+
+	test.Printf(_L("validating that the disk space notification triggered ... "));
+	User::After(2000000);	// 2 seconds should be enough to cause the trigger
+	test_Value(stat.Int(), stat == KErrNone);
+	test.Printf(_L("ok\n"));
+	}
+
+
+
 //-----------------------------------------------------------------------------
 
 GLDEF_C void CallTestsL()
@@ -1060,60 +1092,58 @@
 // Do tests relative to session path
 //
 	{
-    //-- set up console output 
-    Fat_Test_Utils::SetConsole(test.Console()); 
+	//-- set up console output 
+	Fat_Test_Utils::SetConsole(test.Console()); 
 	
-	if (UserSvr::DebugMask(2)&0x00000002) // TESTFAST mode set? (for automated test builds)
-		if(IsTestingLFFS())
-			{
-			// Don't run on LFFS (to increase speed of automated testing)
-			test.Printf(_L("TEST NOT RUN FOR THIS DRIVE"));
-			return;
-			}
+	// If TESTFAST mode (for automated test builds) is set, don't run LFFS tests.
+	if ((UserSvr::DebugMask(2) & 0x00000002) && IsTestingLFFS())
+		{
+		test.Printf(_L("TEST NOT RUN FOR LFFS DRIVE"));
+		return;
+		}
 
 	//get the number of the drive we are currently testing
 	TInt r=0;
 	r=RFs::CharToDrive(gSessionPath[0],gTestDrive);
-    test(r==KErrNone);
+	test_KErrNone(r);
 
 	r=RFs::DriveToChar(gTestDrive,gCh);
-	test(r==KErrNone);
-
-    TDriveInfo drv;
-    r = TheFs.Drive(drv, gTestDrive);
-    test(r == KErrNone);
+	test_KErrNone(r);
 
-    if (Is_Win32(TheFs, gTestDrive))
-        {
-        test.Printf(_L("Skipping on emulator %C: drive\n"), gSessionPath[0]);
-        return;
-        }
+	TDriveInfo drv;
+	r = TheFs.Drive(drv, gTestDrive);
+	test_KErrNone(r);
+
+
+	//-- print drive information
+	PrintDrvInfo(TheFs, gTestDrive);
+
 
-    // do not run this test on RAM drive
-    if (drv.iType == EMediaRam)
-        {
-        test.Printf(_L("Test can't run on RAM drive %C:\n"), gSessionPath[0]);
-        return;
-        }
+	// do not run the remainder of this test on RAM drive
+	if (drv.iType == EMediaRam)
+		{
+		TestRAMDriveNotification();	// Test drive space reservations trigger disk space notifications
+		test.Printf(_L("Main tests can't run on RAM drive %C:\n"), gSessionPath[0]);
+		return;
+		}
 
-    //-- print drive information
-    PrintDrvInfo(TheFs, gTestDrive);
+	if (Is_Win32(TheFs, gTestDrive))
+		{
+		test.Printf(_L("Skipping on emulator %C: drive\n"), gSessionPath[0]);
+		return;
+		}
 
-	Test1();	//General test for new APIs
-	Test2();	//Test to ensure drive and session reserve limits are not exceeded
+	Test1();	// General test for new APIs
+	Test2();	// Test to ensure drive and session reserve limits are not exceeded
 	Test3();
-	Test4();	//test filling the drive and that each checked API fails
+	Test4();	// test filling the drive and that each checked API fails
 	Test5();
 	Test6();
 	Test7();
 	TestForDEF142554();
-	Test2();	//run this test to check reserves are being cleared correctly
+	Test2();	// run this test to check reserves are being cleared correctly
 
 	TestFAT4G_Boundary();
     
-    TurnAllocFailureOff();
+	TurnAllocFailureOff();
 	}
-
-
-
-
--- a/kerneltest/f32test/server/t_filecache.cpp	Tue May 04 09:44:26 2010 +0100
+++ b/kerneltest/f32test/server/t_filecache.cpp	Wed May 05 05:11:16 2010 +0100
@@ -22,6 +22,7 @@
 #include "t_server.h"
 #include <e32twin.h>
 #include <e32rom.h>
+#include <u32hal.h>	//*test*
 
 
 //----------------------------------------------------------------------------------------------
@@ -114,7 +115,7 @@
 void PrintFileCacheConfig(TFileCacheConfig& aFileCacheConfig, TBool aDisplay = ETrue)
 	{
 	TInt r = controlIo(TheFs,gDrive, KControlIoFileCacheConfig, aFileCacheConfig);
-	test (r == KErrNone);
+	test_KErrNone(r);
 	if (!aDisplay)
 		return;
 	
@@ -250,6 +251,18 @@
 		}
 	}
 
+//*test**************************************************************************
+TInt FreeRam()
+	{
+	// wait for any async cleanup in the supervisor to finish first...
+	UserSvr::HalFunction(EHalGroupKernel, EKernelHalSupervisorBarrier, 0, 0);
+
+	TMemoryInfoV1Buf meminfo;
+	UserHal::MemoryInfo(meminfo);
+	return meminfo().iFreeRamInBytes;
+	}
+//*test**************************************************************************
+
 
 LOCAL_C void UnitTests()
 //
@@ -271,7 +284,7 @@
 	TBool simulatelockFailureMode;
 	TFileCacheStats fileCacheStats;
 	r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-	test (r == KErrNone);
+	test_KErrNone(r);
 	test.Printf(_L("Number of files on closed queue=%d\n"),fileCacheStats.iFilesOnClosedQueue);
 	test(fileCacheStats.iFilesOnClosedQueue == 0);
 #endif
@@ -280,7 +293,7 @@
 	// turn OFF lock failure mode 
 	simulatelockFailureMode = EFalse;
 	r = controlIo(TheFs, gDrive, KControlIoSimulateLockFailureMode, simulatelockFailureMode);
-	test (r == KErrNone);
+	test_KErrNone(r);
 #endif
 
 	TFileName testFile   = _L("TEST.BIN");
@@ -299,6 +312,68 @@
 	TInt uncachedPacketsRead;
 #endif
 
+//*test**************************************************************************
+	{
+	TInt fileSize = 0;
+	
+	const TInt KWriteLen = 128*1024;
+	test.Next(_L("Test appending to a file with low memory"));
+	gBufPtr.SetLength(KBufSize);
+
+	r = f.Replace(TheFs, testFile, EFileWrite | EFileWriteBuffered);
+	test_KErrNone(r);
+
+	pos = 0;
+
+	writePtr.Set(gBufPtr.MidTPtr(pos, KWriteLen));
+
+	r = f.Write(pos, writePtr);
+	test_KErrNone(r);
+	pos+= writePtr.Length();
+
+	r = f.Size(fileSize);
+	test_KErrNone(r);
+	test_Equal(fileSize,pos);
+
+
+
+	TInt freeRam = FreeRam();
+	test.Printf(_L("FreeRam = %d"), freeRam);
+	const TInt KPageSize=4096;
+
+	RChunk chunk;
+	TChunkCreateInfo chunkInfo;
+	chunkInfo.SetDisconnected(0, 0, freeRam);
+	chunkInfo.SetPaging(TChunkCreateInfo::EUnpaged);
+	test_KErrNone(chunk.Create(chunkInfo));
+
+	TUint commitEnd = 0;
+	TInt r;
+	while(KErrNone == (r = chunk.Commit(commitEnd,KPageSize)))
+		{
+		commitEnd += KPageSize;
+		}
+	test_Equal(KErrNoMemory, r);
+
+
+
+	pos-= KSegmentSize;
+	writePtr.Set(gBufPtr.MidTPtr(pos, KWriteLen));
+
+	r = f.Write(pos, writePtr);
+	test_KErrNone(r);
+	pos+= writePtr.Length();
+
+	r = f.Size(fileSize);
+	test_KErrNone(r);
+	test_Equal(fileSize,pos);
+
+	f.Close();
+
+	chunk.Close();
+	}
+//*test**************************************************************************
+
 	// create an empty file, so that any writes overlapping segemt boundaries
 	// need a read first
 	// create a test file using directIO and then re-open it in buffered mode, 
@@ -618,7 +693,7 @@
 
 	TInt size;
 	r = f.Size(size);
-	test (r == KErrNone);
+	test_KErrNone(r);
 	test (size = KBufSize);
 
 	readPtr.Set(gBuf->Des());
@@ -627,7 +702,7 @@
 	// Allocate full cachelines - so we can enable hole testing
 	TBool allocateAllSegmentsInCacheLine = ETrue;
 	r = controlIo(TheFs, gDrive, KControlIoAllocateMaxSegments, allocateAllSegmentsInCacheLine);
-	test (r == KErrNone);
+	test_KErrNone(r);
 	PrintFileCacheStats(fileCacheStats, EFalse);
 	TInt holesDetected = fileCacheStats.iHoleCount;
 	TInt lockFailures = fileCacheStats.iCommitFailureCount + fileCacheStats.iLockFailureCount;
@@ -712,7 +787,7 @@
 	// Don't allocate full cachelines any more
 	allocateAllSegmentsInCacheLine = EFalse;
 	r = controlIo(TheFs, gDrive, KControlIoAllocateMaxSegments, allocateAllSegmentsInCacheLine);
-	test (r == KErrNone);
+	test_KErrNone(r);
 #endif
 
 
@@ -812,7 +887,7 @@
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 	r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-	test (r == KErrNone);
+	test_KErrNone(r);
 	test.Printf(_L("Number of files on closed queue=%d\n"),fileCacheStats.iFilesOnClosedQueue);
 	test(fileCacheStats.iFilesOnClosedQueue == 1);
 #endif
@@ -846,7 +921,7 @@
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 		r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-		test (r == KErrNone);
+		test_KErrNone(r);
 		test.Printf(_L("Number of files on closed queue=%d\n"),fileCacheStats.iFilesOnClosedQueue);
 		test(fileCacheStats.iFilesOnClosedQueue == 0);
 #endif
@@ -857,7 +932,7 @@
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 		r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-		test (r == KErrNone);
+		test_KErrNone(r);
 		test.Printf(_L("Number of files on closed queue=%d\n"),fileCacheStats.iFilesOnClosedQueue);
 		test(fileCacheStats.iFilesOnClosedQueue == 1);
 #endif
@@ -886,7 +961,7 @@
 
 	#if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 		r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-		test (r == KErrNone);
+		test_KErrNone(r);
 		test.Printf(_L("Number of files on closed queue=%d\n"),fileCacheStats.iFilesOnClosedQueue);
 		test(fileCacheStats.iFilesOnClosedQueue == 0);
 	#endif
@@ -896,7 +971,7 @@
 	// turn lock failure mode back ON (if enabled)
 	simulatelockFailureMode = ETrue;
 	r = controlIo(TheFs, gDrive, KControlIoSimulateLockFailureMode, simulatelockFailureMode);
-	test (r == KErrNone);
+	test_KErrNone(r);
 #endif
 
 	//**************************************************************
@@ -922,7 +997,7 @@
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 	r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-	test (r == KErrNone);
+	test_KErrNone(r);
 	test.Printf(_L("Number of Write-throughs with dirty data=%d\n"),fileCacheStats.iWriteThroughWithDirtyDataCount);
 	TInt writeThroughWithDirtyDataCountOld = fileCacheStats.iWriteThroughWithDirtyDataCount;
 	TInt writeThroughWithDirtyDataCountNew = writeThroughWithDirtyDataCountOld;
@@ -933,7 +1008,7 @@
 		{
 		fileSize = 0;
 		r = f.SetSize(fileSize);
-		test (r == KErrNone);
+		test_KErrNone(r);
 		for (pos = 0; pos < KMaxFileSize; )
 			{
 			r = f.Write(pos, writePtr);
@@ -944,11 +1019,11 @@
 				test.Printf(_L("Flush returned %d"), r);
 				test(0);
 				}
-			test(r == KErrNone);
+			test_KErrNone(r);
 			pos+= writePtr.Length();
 
 			r = f.Size(fileSize);
-			test (r == KErrNone);
+			test_KErrNone(r);
 			if (fileSize != pos)
 				{
 				test.Printf(_L("Iter #%d, write pos %d != size %d"), i, pos, fileSize);
@@ -960,7 +1035,7 @@
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 			r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-			test (r == KErrNone);
+			test_KErrNone(r);
 			writeThroughWithDirtyDataCountNew = fileCacheStats.iWriteThroughWithDirtyDataCount;
 			if (writeThroughWithDirtyDataCountNew > writeThroughWithDirtyDataCountOld)
 				{
@@ -998,9 +1073,9 @@
 
 	RFs fs;
 	TInt r = fs.Connect();
-	test (r==KErrNone);
+	test_KErrNone(r);
 	r = fs.SetSessionPath(gSessionPath);
-	test (r==KErrNone);
+	test_KErrNone(r);
 
 
 	RFile file;
@@ -1236,7 +1311,7 @@
 
 	RFile file;
 	TInt r = file.Replace(TheFs,_L("WRITETST"),EFileStream | aFileMode);
-	test (r == KErrNone);
+	test_KErrNone(r);
 
 	TTime startTime;
 	TTime endTime;
@@ -1600,7 +1675,7 @@
 
 	TVolumeInfo volInfo;
 	TInt r = TheFs.Volume(volInfo, gDrive);
-	test (r == KErrNone);
+	test_KErrNone(r);
 
 	TFullName extName;
 	r = TheFs.ExtensionName(extName,gDrive, 0);
@@ -1635,7 +1710,7 @@
 		// turn OFF lock failure mode
 		TBool simulatelockFailureMode = EFalse;
 		r = controlIo(TheFs, gDrive, KControlIoSimulateLockFailureMode, simulatelockFailureMode);
-		test (r == KErrNone);
+		test_KErrNone(r);
 #endif
 
 		TestFileRead(EFileReadDirectIO);
@@ -1655,7 +1730,7 @@
 		// turn lock failure mode back ON (if enabled)
 		simulatelockFailureMode = ETrue;
 		r = controlIo(TheFs, gDrive, KControlIoSimulateLockFailureMode, simulatelockFailureMode);
-		test (r == KErrNone);
+		test_KErrNone(r);
 #endif
 		}	// if (gRunPerformanceTests)
 
@@ -1779,7 +1854,7 @@
 		{
 		test.Printf(_L("Writing DriveCacheFlags for drive %C = %08X\n"), (TInt) gDriveToTest, gDriveCacheFlags);
 		r = controlIo(TheFs,gDrive, KControlIoFileCacheFlagsWrite, gDriveCacheFlags);
-		test (r == KErrNone);
+		test_KErrNone(r);
 		}
 #endif
 
--- a/userlibandfileserver/fileserver/group/release.txt	Tue May 04 09:44:26 2010 +0100
+++ b/userlibandfileserver/fileserver/group/release.txt	Wed May 05 05:11:16 2010 +0100
@@ -1,3 +1,18 @@
+Version 2.00.3037
+=================
+(Made by vfebvre 30/04/2010)
+
+1.	vfebvre
+	1.	ou1cimx1#357360 Some test binaries are targeted by several bld.inf files
+
+2.	frhofman
+	1.	ou1cimx1#367552 BC Drivers: Os/KernelHwSrv: 2 failures in Base API on Vasco
+
+3.	michcox
+	1.	ou1cimx1#357494 Maps 3.04: File mode EFileWrite (defined in f32file.h) corrupts memory of other processes under certain conditions on 5.0 devices
+	2.	ou1cimx1#367062 Update T_filecache for ou1cimx1#357494
+
+
 Version 2.00.3036
 =================
 (Made by vfebvre 27/04/2010)
--- a/userlibandfileserver/fileserver/inc/f32ver.h	Tue May 04 09:44:26 2010 +0100
+++ b/userlibandfileserver/fileserver/inc/f32ver.h	Wed May 05 05:11:16 2010 +0100
@@ -58,6 +58,6 @@
 
 @see TVersion
 */
-const TInt KF32BuildVersionNumber=3036;
+const TInt KF32BuildVersionNumber=3037;
 //
 #endif
--- a/userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp	Tue May 04 09:44:26 2010 +0100
+++ b/userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp	Wed May 05 05:11:16 2010 +0100
@@ -892,6 +892,13 @@
     if(aLevel == EMountVolParamQuery)
         {
         ASSERT(ConsistentState()); //-- volume state shall be consistent, otherwise its parameters do not make sense
+
+		// Ram Drives calculate their total / free space based on querying HAL parameters
+		// in ::VolumeL(). To make all interfaces return consistent results, we need to force
+		// a fallback to that for RAM drives.
+		if (iRamDrive)
+			return (KErrNotSupported);
+
         switch(aOption)
             {
             //-- Request a certain amount of free space on the volume.
@@ -927,11 +934,8 @@
             //-- A request to obtain size of the mounted volume without blocking (CMountCB::VolumeL() can block).
             case ESQ_MountedVolumeSize:
                 {
-                if(iRamDrive)
-                    return KErrNotSupported; //-- it requires knowledge of free space on the volume
-    
                 TUint64* pVal = (TUint64*)aParam; 
-                *pVal = iSize; //-- physical drive size
+		*pVal = iSize; //-- physical drive size
 
                 //-- take into account space occupied by FAT table, etc.
                 *pVal -= ClusterBasePosition(); 
--- a/userlibandfileserver/fileserver/sfile/sf_file_cache.cpp	Tue May 04 09:44:26 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_file_cache.cpp	Wed May 05 05:11:16 2010 +0100
@@ -1503,6 +1503,11 @@
 					// Need to reset currentOperation.iReadWriteArgs.iTotalLength here to make sure 
 					// TFsFileWrite::PostInitialise() doesn't think there's no data left to process
 					aMsgRequest.ReStart();
+					
+					//Need to preserve the current state otherwise if we are over the ram threshold 
+					//the request can end up in a livelock trying to repeatedly flush.
+					currentOperation->iState = EStWriteThrough;
+					
 					if (r == CFsRequest::EReqActionBusy || r != CFsRequest::EReqActionComplete)
 						return r;
 					}
@@ -1594,17 +1599,13 @@
 
 void CFileCache::PropagateFlushErrorToAllFileShares()
 	{
-	FileShares->Lock();
-	TInt count = FileShares->Count();
-	while(count--)
+	ASSERT(IsDriveThread());
+	TDblQueIter<CFileShare> fileShareIter(iFileCB->FileShareList());
+	CFileShare* pFileShare;
+	while ((pFileShare = fileShareIter++) != NULL)
 		{
-		CFileShare* share = (CFileShare*)(*FileShares)[count];
-		if (&share->File() == iFileCB)
-			{
-			share->iFlushError = iFlushError;
-			}
+		pFileShare->iFlushError = iFlushError;
 		}
-	FileShares->Unlock();
 	}
 
 /**