X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Ftests%2Flibtest.c;h=650e7716e583d8af4318a59a900c7ad8b742780c;hb=8c32f9c042d4e05acf8d712dcb9f00b8362da55f;hp=de80d9f693f06a8e96a032c2da3cbb9423792e19;hpb=564fe71fa8cccb5a6cdbeaf713a2f1eaa7729593;p=mono.git diff --git a/mono/tests/libtest.c b/mono/tests/libtest.c index de80d9f693f..650e7716e58 100644 --- a/mono/tests/libtest.c +++ b/mono/tests/libtest.c @@ -1109,6 +1109,22 @@ mono_test_marshal_return_delegate_delegate (ReturnDelegateDelegate d) return (d ()) (55); } +typedef int (STDCALL *VirtualDelegate) (int); + +LIBTEST_API int STDCALL +mono_test_marshal_virtual_delegate (VirtualDelegate del) +{ + return del (42); +} + +typedef char* (STDCALL *IcallDelegate) (const char *); +LIBTEST_API int STDCALL +mono_test_marshal_icall_delegate (IcallDelegate del) +{ + char *res = del ("ABC"); + return strcmp (res, "ABC") == 0 ? 0 : 1; +} + LIBTEST_API int STDCALL mono_test_marshal_stringbuilder (char *s, int n) { @@ -1323,6 +1339,8 @@ mono_test_return_empty_struct (int a) { EmptyStruct s; + memset (&s, 0, sizeof (s)); + g_assert (a == 42); return s;