Author: zoltan
Date: 2005-05-12 09:09:53 -0400 (Thu, 12 May 2005)
New Revision: 44437
Modified:
trunk/mono/mono/tests/ChangeLog
trunk/mono/mono/tests/libtest.c
trunk/mono/mono/tests/pinvoke2.cs
Log:
2005-05-12 Zoltan Varga <[EMAIL PROTECTED]>
* pinvoke2.cs libtest.c: Add test for ftnptr->delegate conversion in
structures.
Modified: trunk/mono/mono/tests/ChangeLog
===================================================================
--- trunk/mono/mono/tests/ChangeLog 2005-05-12 13:09:26 UTC (rev 44436)
+++ trunk/mono/mono/tests/ChangeLog 2005-05-12 13:09:53 UTC (rev 44437)
@@ -1,3 +1,8 @@
+2005-05-12 Zoltan Varga <[EMAIL PROTECTED]>
+
+ * pinvoke2.cs libtest.c: Add test for ftnptr->delegate conversion in
+ structures.
+
2005-05-12 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* main-returns-background-change.cs: New test for changing the
Modified: trunk/mono/mono/tests/libtest.c
===================================================================
--- trunk/mono/mono/tests/libtest.c 2005-05-12 13:09:26 UTC (rev 44436)
+++ trunk/mono/mono/tests/libtest.c 2005-05-12 13:09:53 UTC (rev 44437)
@@ -367,10 +367,16 @@
SimpleDelegate func, func2;
} DelegateStruct;
-STDCALL int
+STDCALL DelegateStruct
mono_test_marshal_delegate_struct (DelegateStruct ds)
{
- return ds.func (ds.a) + ds.func2 (ds.a);
+ DelegateStruct res;
+
+ res.a = ds.func (ds.a) + ds.func2 (ds.a);
+ res.func = ds.func;
+ res.func2 = ds.func2;
+
+ return res;
}
STDCALL int
Modified: trunk/mono/mono/tests/pinvoke2.cs
===================================================================
--- trunk/mono/mono/tests/pinvoke2.cs 2005-05-12 13:09:26 UTC (rev 44436)
+++ trunk/mono/mono/tests/pinvoke2.cs 2005-05-12 13:09:53 UTC (rev 44437)
@@ -173,7 +173,7 @@
public static extern int mono_test_marshal_delegate (SimpleDelegate d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate_struct")]
- public static extern int mono_test_marshal_delegate_struct
(DelegateStruct d);
+ public static extern DelegateStruct mono_test_marshal_delegate_struct
(DelegateStruct d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_return_delegate")]
public static extern SimpleDelegate mono_test_marshal_return_delegate
(SimpleDelegate d);
@@ -415,7 +415,16 @@
s.del = new SimpleDelegate (delegate_test);
s.del2 = new SimpleDelegate (delegate_test);
- return mono_test_marshal_delegate_struct (s);
+ DelegateStruct res = mono_test_marshal_delegate_struct (s);
+
+ if (res.a != 0)
+ return 1;
+ if (res.del (2) != 0)
+ return 2;
+ if (res.del2 (2) != 0)
+ return 3;
+
+ return 0;
}
static int test_0_marshal_point () {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches