Author: zoltan
Date: 2006-05-18 09:23:22 -0400 (Thu, 18 May 2006)
New Revision: 60818

Modified:
   trunk/mono/mono/tests/ChangeLog
   trunk/mono/mono/tests/libtest.c
   trunk/mono/mono/tests/pinvoke2.cs
Log:
2006-05-18  Zoltan Varga  <[EMAIL PROTECTED]>

        * pinvoke2.cs libtest.c: Add tests for UnamangedType.LPStruct and 
blittable types.


Modified: trunk/mono/mono/tests/ChangeLog
===================================================================
--- trunk/mono/mono/tests/ChangeLog     2006-05-18 13:22:12 UTC (rev 60817)
+++ trunk/mono/mono/tests/ChangeLog     2006-05-18 13:23:22 UTC (rev 60818)
@@ -1,3 +1,7 @@
+2006-05-18  Zoltan Varga  <[EMAIL PROTECTED]>
+
+       * pinvoke2.cs libtest.c: Add tests for UnamangedType.LPStruct and 
blittable types.
+
 2006-05-17  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * pinvoke2.cs libtest.c: Add tests for marshalling 
UnmanagedType.LPStruct.

Modified: trunk/mono/mono/tests/libtest.c
===================================================================
--- trunk/mono/mono/tests/libtest.c     2006-05-18 13:22:12 UTC (rev 60817)
+++ trunk/mono/mono/tests/libtest.c     2006-05-18 13:23:22 UTC (rev 60818)
@@ -303,6 +303,11 @@
        gunichar2 *d2;
 } simplestruct;
 
+typedef struct {
+       double x;
+       double y;
+} point;
+
 STDCALL simplestruct
 mono_test_return_vtype (int i)
 {
@@ -460,6 +465,15 @@
        return 1;
 }
 
+STDCALL int 
+mono_test_marshal_lpstruct_blittable (point *p)
+{
+       if (p->x == 1.0 && p->y == 2.0)
+               return 0;
+       else
+               return 1;
+}
+
 STDCALL int
 mono_test_marshal_struct_array (simplestruct2 *ss)
 {
@@ -1145,11 +1159,6 @@
        return osvi->a + osvi->b;
 }
 
-typedef struct {
-       double x;
-       double y;
-} point;
-
 STDCALL int
 mono_test_marshal_point (point pt)
 {

Modified: trunk/mono/mono/tests/pinvoke2.cs
===================================================================
--- trunk/mono/mono/tests/pinvoke2.cs   2006-05-18 13:22:12 UTC (rev 60817)
+++ trunk/mono/mono/tests/pinvoke2.cs   2006-05-18 13:23:22 UTC (rev 60818)
@@ -204,6 +204,9 @@
        [DllImport ("libtest", EntryPoint="mono_test_marshal_lpstruct")]
        public static extern int mono_test_marshal_lpstruct ([In, 
MarshalAs(UnmanagedType.LPStruct)] SimpleStruct ss);
 
+       [DllImport ("libtest", 
EntryPoint="mono_test_marshal_lpstruct_blittable")]
+       public static extern int mono_test_marshal_lpstruct_blittable ([In, 
MarshalAs(UnmanagedType.LPStruct)] Point p);
+
        [DllImport ("libtest", EntryPoint="mono_test_marshal_struct_array")]
        public static extern int mono_test_marshal_struct_array 
(SimpleStruct2[] ss);
 
@@ -394,6 +397,14 @@
                return mono_test_marshal_lpstruct (ss);
        }
 
+       public static int test_0_marshal_lpstruct_blittable () {
+               Point p = new Point ();
+               p.x = 1.0;
+               p.y = 2.0;
+               
+               return mono_test_marshal_lpstruct_blittable (p);
+       }
+
        public static int test_0_marshal_struct_array () {
                SimpleStruct2[] ss_arr = new SimpleStruct2 [2];
 

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

Reply via email to