Skip to content

Commit

Permalink
2008-09-06 Zoltan Varga <vargaz@gmail.com>
Browse files Browse the repository at this point in the history
	* libtest.c pinvoke2.cs: Add float tests.

svn path=/branches/mono-2-0/mono/; revision=112423
  • Loading branch information
vargaz committed Sep 6, 2008
1 parent 742bd55 commit 676e17a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mono/tests/ChangeLog
@@ -1,3 +1,7 @@
2008-09-06 Zoltan Varga <vargaz@gmail.com>

* libtest.c pinvoke2.cs: Add float tests.

2008-08-28 Zoltan Varga <vargaz@gmail.com>

* libtest.c (mono_xr_as_handle): Initialize ref before returning it.
Expand Down
5 changes: 5 additions & 0 deletions mono/tests/libtest.c
Expand Up @@ -109,6 +109,11 @@ mono_return_int (int a) {
return a;
}

LIBTEST_API float STDCALL
mono_test_marshal_pass_return_float (float f) {
return f + 1.0;
}

struct ss
{
int i;
Expand Down
12 changes: 12 additions & 0 deletions mono/tests/pinvoke2.cs
Expand Up @@ -1179,6 +1179,18 @@ public struct TestStruct6 {
return mono_test_stdcall_name_mangling (0, 1, 2) == 3 ? 0 : 1;
}

/* Float test */

[DllImport ("libtest", EntryPoint="mono_test_marshal_pass_return_float")]
public static extern float mono_test_marshal_pass_return_float (float f);

public static int test_0_pass_return_float () {
float f = mono_test_marshal_pass_return_float (1.5f);

Console.WriteLine (f);
return (f == 2.5f) ? 0 : 1;
}

/*
* Pointers to structures can not be passed
*/
Expand Down

0 comments on commit 676e17a

Please sign in to comment.