Author: zoltan
Date: 2006-05-17 13:52:47 -0400 (Wed, 17 May 2006)
New Revision: 60794
Modified:
trunk/mono/mono/tests/ChangeLog
trunk/mono/mono/tests/libtest.c
trunk/mono/mono/tests/pinvoke2.cs
Log:
2006-05-17 Zoltan Varga <[EMAIL PROTECTED]>
* pinvoke2.cs libtest.c: Add tests for marshalling
UnmanagedType.LPStruct.
Modified: trunk/mono/mono/tests/ChangeLog
===================================================================
--- trunk/mono/mono/tests/ChangeLog 2006-05-17 17:51:16 UTC (rev 60793)
+++ trunk/mono/mono/tests/ChangeLog 2006-05-17 17:52:47 UTC (rev 60794)
@@ -1,5 +1,7 @@
2006-05-17 Zoltan Varga <[EMAIL PROTECTED]>
+ * pinvoke2.cs libtest.c: Add tests for marshalling
UnmanagedType.LPStruct.
+
* marshal8.cs: Applied a patch from Jonathan Chambers to add a test
case to
#77523.
Modified: trunk/mono/mono/tests/libtest.c
===================================================================
--- trunk/mono/mono/tests/libtest.c 2006-05-17 17:51:16 UTC (rev 60793)
+++ trunk/mono/mono/tests/libtest.c 2006-05-17 17:52:47 UTC (rev 60794)
@@ -450,6 +450,16 @@
return 1;
}
+STDCALL int
+mono_test_marshal_lpstruct (simplestruct *ss)
+{
+ if (ss->a == 0 && ss->b == 1 && ss->c == 0 &&
+ !strcmp (ss->d, "TEST"))
+ return 0;
+
+ return 1;
+}
+
STDCALL int
mono_test_marshal_struct_array (simplestruct2 *ss)
{
Modified: trunk/mono/mono/tests/pinvoke2.cs
===================================================================
--- trunk/mono/mono/tests/pinvoke2.cs 2006-05-17 17:51:16 UTC (rev 60793)
+++ trunk/mono/mono/tests/pinvoke2.cs 2006-05-17 17:52:47 UTC (rev 60794)
@@ -201,6 +201,9 @@
[DllImport ("libtest", EntryPoint="mono_test_empty_struct")]
public static extern int mono_test_empty_struct (int a, EmptyStruct es,
int b);
+ [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_struct_array")]
public static extern int mono_test_marshal_struct_array
(SimpleStruct2[] ss);
@@ -383,6 +386,14 @@
return 0;
}
+ public static int test_0_marshal_lpstruct () {
+ SimpleStruct ss = new SimpleStruct ();
+ ss.b = true;
+ ss.d = "TEST";
+
+ return mono_test_marshal_lpstruct (ss);
+ }
+
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