Skip to content

Commit

Permalink
[corlib] Fix CustomAttributeDataTest.MethodIncludesDllImportAttribute…
Browse files Browse the repository at this point in the history
…Data() on watch/tv

Bitcode requires that the native symbol exists.
Changed the pinvoke to something that exists in libc.
  • Loading branch information
akoeplinger committed Feb 12, 2019
1 parent a5f5870 commit 78f05bc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public TestAttrWithObjectArrayCtorParams (object[] o1, params object[] o2) {
public class CustomAttributeDataTest
{
[DllImport ("libc")]
public static extern void pinvoke ();
public static extern int readlink (string path, byte[] buffer, int buflen);

[MarshalAs (UnmanagedType.LPStr)]
[NonSerialized]
Expand Down Expand Up @@ -274,7 +274,7 @@ public void MethodIncludesMarshalAsAttributeData ()
// https://github.com/mono/mono/issues/10544
public void MethodIncludesDllImportAttributeData ()
{
var mi = typeof (CustomAttributeDataTest).FindMembers (MemberTypes.Method, BindingFlags.Static | BindingFlags.Public, (m, criteria) => m.Name == "pinvoke", null);
var mi = typeof (CustomAttributeDataTest).FindMembers (MemberTypes.Method, BindingFlags.Static | BindingFlags.Public, (m, criteria) => m.Name == "readlink", null);
var data = ((MethodInfo)(mi[0])).CustomAttributes;

Assert.AreEqual (2, data.Count ());
Expand Down

0 comments on commit 78f05bc

Please sign in to comment.