Imported Upstream version 4.2.0.179

Former-commit-id: 4610231f55806d2a05ed69e5ff3faa7336cc1479
This commit is contained in:
Xamarin Public Jenkins
2015-08-26 07:17:56 -04:00
committed by Jo Shields
parent aa7da660d6
commit c042cd0c52
7507 changed files with 90259 additions and 657307 deletions

View File

@ -14,6 +14,7 @@ using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
@ -260,6 +261,26 @@ namespace MonoTests.System.Reflection
}
#endif
class TestParamAttribute : Attribute
{
}
public static int TestCustomAttribute_Method ([TestParamAttribute] string arg)
{
return arg.Length;
}
[Test]
public void TestCustomAttribute ()
{
var metInfo = GetType ().GetMethod ("TestCustomAttribute_Method", new Type[] { typeof(string) });
var paramInfos = metInfo.GetParameters ();
var argParamInfo = paramInfos[0];
var custAttrs = argParamInfo.GetCustomAttributes ();
Assert.AreEqual (1, custAttrs.Count ());
}
class MyParameterInfo2 : ParameterInfo
{
public ParameterAttributes MyAttrsImpl;
@ -332,7 +353,9 @@ namespace MonoTests.System.Reflection
}
#endif
Assert.IsFalse (p.IsIn, "#7");
#if FEATURE_USE_LCID
Assert.IsFalse (p.IsLcid, "#8");
#endif
Assert.IsFalse (p.IsOptional, "#9");
Assert.IsFalse (p.IsOut, "#10");
Assert.IsFalse (p.IsRetval, "#10");