Author: spouliot
Date: 2006-08-28 15:32:36 -0400 (Mon, 28 Aug 2006)
New Revision: 64489

Modified:
   trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/ChangeLog
   trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs
Log:
2005-08-28  Sebastien Pouliot  <[EMAIL PROTECTED]> 
        Added endian check as Marshal must use CPU endianess.


Modified: trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/ChangeLog        
2006-08-28 19:28:55 UTC (rev 64488)
+++ trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/ChangeLog        
2006-08-28 19:32:36 UTC (rev 64489)
@@ -1,6 +1,7 @@
-2005-08-28  Sebastien Pouliot  <[EMAIL PROTECTED]>
+2005-08-28  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * MarshalTest.cs: Added test for ReadInt32 (versus arch endianess).
+       Added endian check as Marshal must use CPU endianess.
 
 2006-6-8  Jonathan Chambers  <[EMAIL PROTECTED]>
 

Modified: 
trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs   
2006-08-28 19:28:55 UTC (rev 64488)
+++ trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs   
2006-08-28 19:32:36 UTC (rev 64489)
@@ -162,7 +162,12 @@
                                Marshal.WriteByte (ptr, 1, 0x02);
                                Marshal.WriteByte (ptr, 2, 0x03);
                                Marshal.WriteByte (ptr, 3, 0x04);
-                               Assert.AreEqual (0x04030201, Marshal.ReadInt32 
(ptr), "ReadInt32");
+                               // Marshal MUST use the native CPU data
+                               if (BitConverter.IsLittleEndian){
+                                       Assert.AreEqual (0x04030201, 
Marshal.ReadInt32 (ptr), "ReadInt32");
+                               } else {
+                                       Assert.AreEqual (0x01020304, 
Marshal.ReadInt32 (ptr), "ReadInt32");
+                               }
                        }
                        finally {
                                Marshal.FreeHGlobal (ptr);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to