You've already forked linux-packaging-mono
Imported Upstream version 5.8.0.22
Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
parent
5f4a27cc8a
commit
7d05485754
@@ -526,10 +526,10 @@ namespace System.Reflection.Emit.Tests
|
||||
{
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).First();
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new FieldInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -537,10 +537,10 @@ namespace System.Reflection.Emit.Tests
|
||||
{
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance).First();
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new FieldInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -554,10 +554,10 @@ namespace System.Reflection.Emit.Tests
|
||||
|
||||
ConstructorInfo con = typeBuilder.CreateTypeInfo().AsType().GetConstructor(new Type[0]);
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new FieldInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -606,10 +606,10 @@ namespace System.Reflection.Emit.Tests
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructor(new Type[] { typeof(object) });
|
||||
object[] constructorArgs = new object[] { value };
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new FieldInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -620,10 +620,10 @@ namespace System.Reflection.Emit.Tests
|
||||
{
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructor(constructorTypes);
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs, new FieldInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs, new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
public static IEnumerable<object[]> IntPtrAttributeTypes_TestData()
|
||||
@@ -660,10 +660,10 @@ namespace System.Reflection.Emit.Tests
|
||||
ConstructorInfo con = typeBuilder.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, new Type[] { type });
|
||||
object[] constructorArgs = new object[] { value };
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs, new FieldInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs, new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -732,8 +732,8 @@ namespace System.Reflection.Emit.Tests
|
||||
FieldInfo[] namedFields = new FieldInfo[] { field };
|
||||
object[] fieldValues = new object[] { value };
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedFields, fieldValues));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], namedFields, fieldValues));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedFields, fieldValues));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], namedFields, fieldValues));
|
||||
}
|
||||
|
||||
public static IEnumerable<object[]> FieldDoesntBelongToConstructorDeclaringType_TestData()
|
||||
@@ -751,8 +751,8 @@ namespace System.Reflection.Emit.Tests
|
||||
{
|
||||
FieldInfo[] namedFields = new FieldInfo[] { field };
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedFields, new object[] { 5 }));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], namedFields, new object[] { 5 }));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedFields, new object[] { 5 }));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], namedFields, new object[] { 5 }));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -809,8 +809,8 @@ namespace System.Reflection.Emit.Tests
|
||||
FieldInfo[] namedFields = Helpers.GetFields(typeof(TestAttribute), nameof(TestAttribute.ObjectField));
|
||||
object[] fieldValues = new object[] { value };
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedFields, fieldValues));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], namedFields, fieldValues));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedFields, fieldValues));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], namedFields, fieldValues));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -871,8 +871,8 @@ namespace System.Reflection.Emit.Tests
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructor(new Type[0]);
|
||||
FieldInfo[] namedFields = Helpers.GetFields(typeof(TestAttribute), fieldNames);
|
||||
|
||||
Assert.Throws<ArgumentException>(paramName, () => new CustomAttributeBuilder(con, new object[0], namedFields, fieldValues));
|
||||
Assert.Throws<ArgumentException>(paramName, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], namedFields, fieldValues));
|
||||
AssertExtensions.Throws<ArgumentException>(paramName, () => new CustomAttributeBuilder(con, new object[0], namedFields, fieldValues));
|
||||
AssertExtensions.Throws<ArgumentException>(paramName, () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], namedFields, fieldValues));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -929,8 +929,8 @@ namespace System.Reflection.Emit.Tests
|
||||
PropertyInfo[] namedProperties = new PropertyInfo[] { property };
|
||||
object[] propertyValues = new object[] { value };
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues, new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues, new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
public static IEnumerable<object[]> PropertyDoesntBelongToConstructorDeclaringType_TestData()
|
||||
@@ -948,8 +948,8 @@ namespace System.Reflection.Emit.Tests
|
||||
{
|
||||
PropertyInfo[] namedProperties = new PropertyInfo[] { property };
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedProperties, new object[] { 5 }));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedProperties, new object[] { 5 }, new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedProperties, new object[] { 5 }));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedProperties, new object[] { 5 }, new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -971,8 +971,8 @@ namespace System.Reflection.Emit.Tests
|
||||
PropertyInfo[] namedProperties = Helpers.GetProperties(typeof(TestAttribute), nameof(TestAttribute.ObjectProperty));
|
||||
object[] propertyValues = new object[] { value };
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues));
|
||||
Assert.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues, new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues, new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -1032,8 +1032,8 @@ namespace System.Reflection.Emit.Tests
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructor(new Type[0]);
|
||||
PropertyInfo[] namedProperties = Helpers.GetProperties(typeof(TestAttribute), propertyNames);
|
||||
|
||||
Assert.Throws<ArgumentException>(paramName, () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues));
|
||||
Assert.Throws<ArgumentException>(paramName, () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues, new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>(paramName, () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues));
|
||||
AssertExtensions.Throws<ArgumentException>(paramName, () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues, new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
private static Type CreateEnum(Type underlyingType, params object[] literalValues)
|
||||
|
||||
@@ -62,8 +62,8 @@ namespace System.Reflection.Emit.Tests
|
||||
SignatureHelper helper = SignatureHelper.GetFieldSigHelper(module);
|
||||
helper.GetSignature();
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => helper.AddArgument(typeof(string)));
|
||||
Assert.Throws<ArgumentException>(null, () => helper.AddArgument(typeof(string), null, null));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => helper.AddArgument(typeof(string)));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => helper.AddArgument(typeof(string), null, null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -73,8 +73,8 @@ namespace System.Reflection.Emit.Tests
|
||||
SignatureHelper helper = SignatureHelper.GetFieldSigHelper(module);
|
||||
helper.GetSignature();
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => helper.AddArgument(typeof(string), new Type[] { typeof(int) }, null));
|
||||
Assert.Throws<ArgumentException>(null, () => helper.AddArgument(typeof(string), null, new Type[] { typeof(int) }));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => helper.AddArgument(typeof(string), new Type[] { typeof(int) }, null));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => helper.AddArgument(typeof(string), null, new Type[] { typeof(int) }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace System.Reflection.Emit.Tests
|
||||
SignatureHelper helper = SignatureHelper.GetFieldSigHelper(module);
|
||||
helper.GetSignature();
|
||||
|
||||
Assert.Throws<ArgumentException>(null, () => helper.AddArguments(new Type[] { typeof(string) }, null, null));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => helper.AddArguments(new Type[] { typeof(string) }, null, null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -63,10 +63,10 @@ namespace System.Reflection.Emit.Tests
|
||||
SignatureHelper helper = SignatureHelper.GetFieldSigHelper(module);
|
||||
|
||||
AssertExtensions.Throws<ArgumentException>("requiredCustomModifiers", () => helper.AddArguments(new Type[] { typeof(string) }, new Type[][] { new Type[] { typeof(int), typeof(int[]) } }, null));
|
||||
Assert.Throws<ArgumentException>(null, () => helper.AddArguments(new Type[] { typeof(string) }, new Type[][] { new Type[] { typeof(int) }, new Type[] { typeof(char) } }, null));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => helper.AddArguments(new Type[] { typeof(string) }, new Type[][] { new Type[] { typeof(int) }, new Type[] { typeof(char) } }, null));
|
||||
|
||||
AssertExtensions.Throws<ArgumentException>("optionalCustomModifiers", () => helper.AddArguments(new Type[] { typeof(string) }, null, new Type[][] { new Type[] { typeof(int), typeof(int[]) } }));
|
||||
Assert.Throws<ArgumentException>(null, () => helper.AddArguments(new Type[] { typeof(string) }, null, new Type[][] { new Type[] { typeof(int) }, new Type[] { typeof(char) } }));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => helper.AddArguments(new Type[] { typeof(string) }, null, new Type[][] { new Type[] { typeof(int) }, new Type[] { typeof(char) } }));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -35,9 +35,6 @@
|
||||
<Compile Include="SignatureHelper\SignatureHelperToString.cs" />
|
||||
<Compile Include="CustomAttributeBuilderTests.cs" />
|
||||
<Compile Include="Utilities.cs" />
|
||||
<Compile Include="$(CommonTestPath)\System\AssertExtensions.cs">
|
||||
<Link>Common\System\AssertExtensions.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
Reference in New Issue
Block a user