Author: zoltan
Date: 2007-05-23 17:47:20 -0400 (Wed, 23 May 2007)
New Revision: 77872

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

        * pinvoke2.cs libtest.c: Fix up asany in/out tests.


Modified: trunk/mono/mono/tests/ChangeLog
===================================================================
--- trunk/mono/mono/tests/ChangeLog     2007-05-23 21:38:59 UTC (rev 77871)
+++ trunk/mono/mono/tests/ChangeLog     2007-05-23 21:47:20 UTC (rev 77872)
@@ -1,3 +1,7 @@
+2007-05-23  Zoltan Varga  <[EMAIL PROTECTED]>
+
+       * pinvoke2.cs libtest.c: Fix up asany in/out tests.
+
 2007-03-28  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * Makefile.am (test-bug-80307): Don't set PATH.

Modified: trunk/mono/mono/tests/libtest.c
===================================================================
--- trunk/mono/mono/tests/libtest.c     2007-05-23 21:38:59 UTC (rev 77871)
+++ trunk/mono/mono/tests/libtest.c     2007-05-23 21:47:20 UTC (rev 77872)
@@ -416,6 +416,8 @@
 {
        gboolean res = (ss->a == a && ss->b == b && ss->c == c && strcmp 
(ss->d, d) == 0);
 
+       marshal_free (ss->d);
+
        ss->a = !ss->a;
        ss->b = !ss->b;
        ss->c = !ss->c;
@@ -1372,11 +1374,22 @@
 } AsAnyStruct;
 
 STDCALL int
+mono_test_marshal_asany_in (void* ptr)
+{
+       AsAnyStruct* asAny = ptr;
+       int res = asAny->i + asAny->j + asAny->k;
+
+       return res;
+}
+
+STDCALL int
 mono_test_marshal_asany_inout (void* ptr)
 {
        AsAnyStruct* asAny = ptr;
        int res = asAny->i + asAny->j + asAny->k;
 
+       marshal_free (asAny->s);
+
        asAny->i = 10;
        asAny->j = 20;
        asAny->k = 30;
@@ -1385,6 +1398,20 @@
        return res;
 }
 
+STDCALL int
+mono_test_marshal_asany_out (void* ptr)
+{
+       AsAnyStruct* asAny = ptr;
+       int res = asAny->i + asAny->j + asAny->k;
+
+       asAny->i = 10;
+       asAny->j = 20;
+       asAny->k = 30;
+       asAny->s = 0;
+
+       return res;
+}
+
 /*
  * AMD64 marshalling tests.
  */

Modified: trunk/mono/mono/tests/pinvoke2.cs
===================================================================
--- trunk/mono/mono/tests/pinvoke2.cs   2007-05-23 21:38:59 UTC (rev 77871)
+++ trunk/mono/mono/tests/pinvoke2.cs   2007-05-23 21:47:20 UTC (rev 77872)
@@ -249,10 +249,10 @@
        [DllImport ("libtest", EntryPoint="mono_test_asany", 
CharSet=CharSet.Unicode)]
        public static extern int mono_test_asany_unicode ([MarshalAs 
(UnmanagedType.AsAny)] object o, int what);
 
-       [DllImport("libtest", EntryPoint="mono_test_marshal_asany_inout")]
+       [DllImport("libtest", EntryPoint="mono_test_marshal_asany_in")]
        static extern void mono_test_asany_in 
([MarshalAs(UnmanagedType.AsAny)][In] object obj); 
 
-       [DllImport("libtest", EntryPoint="mono_test_marshal_asany_inout")]
+       [DllImport("libtest", EntryPoint="mono_test_marshal_asany_out")]
        static extern void mono_test_asany_out 
([MarshalAs(UnmanagedType.AsAny)][Out] object obj); 
        [DllImport("libtest", EntryPoint="mono_test_marshal_asany_inout")]
        static extern void mono_test_asany_inout 
([MarshalAs(UnmanagedType.AsAny)][In, Out] object obj); 

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

Reply via email to