Author: spouliot
Date: 2006-08-28 11:39:26 -0400 (Mon, 28 Aug 2006)
New Revision: 64477

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]>

        * MarshalTest.cs: Added test for ReadInt32 (versus arch endianess).



Modified: trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/ChangeLog        
2006-08-28 15:25:51 UTC (rev 64476)
+++ trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/ChangeLog        
2006-08-28 15:39:26 UTC (rev 64477)
@@ -1,3 +1,7 @@
+2005-08-28  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * MarshalTest.cs: Added test for ReadInt32 (versus arch endianess).
+
 2006-6-8  Jonathan Chambers  <[EMAIL PROTECTED]>
 
        * MarshalTest.cs: Added tests for GetComSlotForMethodInfo.

Modified: 
trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs   
2006-08-28 15:25:51 UTC (rev 64476)
+++ trunk/mcs/class/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs   
2006-08-28 15:39:26 UTC (rev 64477)
@@ -5,7 +5,7 @@
 //     Gonzalo Paniagua Javier ([EMAIL PROTECTED])
 //     Sebastien Pouliot  <[EMAIL PROTECTED]>
 //
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com)
 //
 
 using NUnit.Framework;
@@ -152,6 +152,23 @@
                        s = Marshal.PtrToStringUni (handle);
                        Assert.AreEqual (19, s.Length, "#2");
                }
+
+               [Test]
+               public void ReadInt32_Endian ()
+               {
+                       IntPtr ptr = Marshal.AllocHGlobal (4);
+                       try {
+                               Marshal.WriteByte (ptr, 0, 0x01);
+                               Marshal.WriteByte (ptr, 1, 0x02);
+                               Marshal.WriteByte (ptr, 2, 0x03);
+                               Marshal.WriteByte (ptr, 3, 0x04);
+                               Assert.AreEqual (0x04030201, Marshal.ReadInt32 
(ptr), "ReadInt32");
+                       }
+                       finally {
+                               Marshal.FreeHGlobal (ptr);
+                       }
+               }
+
 #if NET_2_0
                private const string NotSupported = "Not supported before 
Windows 2000 Service Pack 3";
                private static char[] PlainText = new char[] { 'a', 'b', 'c' };

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

Reply via email to