You've already forked linux-packaging-mono
Imported Upstream version 5.10.0.47
Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
parent
88ff76fe28
commit
e46a49ecf1
@@ -7,6 +7,61 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Tests", "
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {68F87E68-E13F-4354-A6D6-B44727FE53EE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Tests.Assembly_0_0_0_0", "tests\AssemblyVersion\System.Reflection.Tests.Assembly_0_0_0_0.csproj", "{5B003EB4-DD06-4BC6-B2E9-A9F0E445CB86}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {68F87E68-E13F-4354-A6D6-B44727FE53EE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Tests.Assembly_1_0_0_0", "tests\AssemblyVersion\System.Reflection.Tests.Assembly_1_0_0_0.csproj", "{80696796-DE63-42CA-ACB0-A83E5AA7AE06}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {68F87E68-E13F-4354-A6D6-B44727FE53EE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Tests.Assembly_1_1_0_0", "tests\AssemblyVersion\System.Reflection.Tests.Assembly_1_1_0_0.csproj", "{E28C7916-1BCE-434A-B045-9F755A00A7C4}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {68F87E68-E13F-4354-A6D6-B44727FE53EE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Tests.Assembly_1_1_1_0", "tests\AssemblyVersion\System.Reflection.Tests.Assembly_1_1_1_0.csproj", "{0AC47423-D050-46D4-8C4C-E2D44102FAB6}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {68F87E68-E13F-4354-A6D6-B44727FE53EE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Tests.Assembly_1_1_1_2", "tests\AssemblyVersion\System.Reflection.Tests.Assembly_1_1_1_2.csproj", "{652B7191-D7FE-4889-8E45-1AF7739C0EAD}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {68F87E68-E13F-4354-A6D6-B44727FE53EE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Tests.Assembly_1_1_1_3", "tests\AssemblyVersion\System.Reflection.Tests.Assembly_1_1_1_3.csproj", "{072D1E70-A0A4-44AB-92B8-2F6B772626CC}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {68F87E68-E13F-4354-A6D6-B44727FE53EE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Tests.Assembly_1_1_2_0", "tests\AssemblyVersion\System.Reflection.Tests.Assembly_1_1_2_0.csproj", "{3E30213F-6E59-4BE8-BF4A-64D2AAED5B2E}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {68F87E68-E13F-4354-A6D6-B44727FE53EE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Tests.Assembly_1_1_3_0", "tests\AssemblyVersion\System.Reflection.Tests.Assembly_1_1_3_0.csproj", "{02758899-6A37-4FF1-B765-F1C38B40BC9C}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {68F87E68-E13F-4354-A6D6-B44727FE53EE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Tests.Assembly_1_2_0_0", "tests\AssemblyVersion\System.Reflection.Tests.Assembly_1_2_0_0.csproj", "{510CC907-F5AA-432D-AEEB-14A10AE3F811}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {68F87E68-E13F-4354-A6D6-B44727FE53EE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Tests.Assembly_1_3_0_0", "tests\AssemblyVersion\System.Reflection.Tests.Assembly_1_3_0_0.csproj", "{68AD3675-F57E-4FB3-9943-49E602678BCA}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {68F87E68-E13F-4354-A6D6-B44727FE53EE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Tests.Assembly_3_0_0_0", "tests\AssemblyVersion\System.Reflection.Tests.Assembly_3_0_0_0.csproj", "{42E66302-6F46-47BE-936B-4264DFD6004F}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {68F87E68-E13F-4354-A6D6-B44727FE53EE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.CoreCLR.Tests", "tests\CoreCLR\System.Reflection.CoreCLR.Tests.csproj", "{C8049356-559D-4F34-AC17-56F3AE62C897}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {68F87E68-E13F-4354-A6D6-B44727FE53EE}
|
||||
@@ -40,6 +95,50 @@ Global
|
||||
{B027C72E-F04E-42E0-A7F7-993AEF8400D2}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{B027C72E-F04E-42E0-A7F7-993AEF8400D2}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{B027C72E-F04E-42E0-A7F7-993AEF8400D2}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{5B003EB4-DD06-4BC6-B2E9-A9F0E445CB86}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{5B003EB4-DD06-4BC6-B2E9-A9F0E445CB86}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{5B003EB4-DD06-4BC6-B2E9-A9F0E445CB86}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{5B003EB4-DD06-4BC6-B2E9-A9F0E445CB86}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{80696796-DE63-42CA-ACB0-A83E5AA7AE06}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{80696796-DE63-42CA-ACB0-A83E5AA7AE06}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{80696796-DE63-42CA-ACB0-A83E5AA7AE06}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{80696796-DE63-42CA-ACB0-A83E5AA7AE06}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{E28C7916-1BCE-434A-B045-9F755A00A7C4}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{E28C7916-1BCE-434A-B045-9F755A00A7C4}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{E28C7916-1BCE-434A-B045-9F755A00A7C4}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{E28C7916-1BCE-434A-B045-9F755A00A7C4}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{0AC47423-D050-46D4-8C4C-E2D44102FAB6}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{0AC47423-D050-46D4-8C4C-E2D44102FAB6}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{0AC47423-D050-46D4-8C4C-E2D44102FAB6}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{0AC47423-D050-46D4-8C4C-E2D44102FAB6}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{652B7191-D7FE-4889-8E45-1AF7739C0EAD}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{652B7191-D7FE-4889-8E45-1AF7739C0EAD}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{652B7191-D7FE-4889-8E45-1AF7739C0EAD}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{652B7191-D7FE-4889-8E45-1AF7739C0EAD}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{072D1E70-A0A4-44AB-92B8-2F6B772626CC}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{072D1E70-A0A4-44AB-92B8-2F6B772626CC}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{072D1E70-A0A4-44AB-92B8-2F6B772626CC}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{072D1E70-A0A4-44AB-92B8-2F6B772626CC}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{3E30213F-6E59-4BE8-BF4A-64D2AAED5B2E}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{3E30213F-6E59-4BE8-BF4A-64D2AAED5B2E}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{3E30213F-6E59-4BE8-BF4A-64D2AAED5B2E}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{3E30213F-6E59-4BE8-BF4A-64D2AAED5B2E}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{02758899-6A37-4FF1-B765-F1C38B40BC9C}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{02758899-6A37-4FF1-B765-F1C38B40BC9C}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{02758899-6A37-4FF1-B765-F1C38B40BC9C}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{02758899-6A37-4FF1-B765-F1C38B40BC9C}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{510CC907-F5AA-432D-AEEB-14A10AE3F811}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{510CC907-F5AA-432D-AEEB-14A10AE3F811}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{510CC907-F5AA-432D-AEEB-14A10AE3F811}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{510CC907-F5AA-432D-AEEB-14A10AE3F811}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{68AD3675-F57E-4FB3-9943-49E602678BCA}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{68AD3675-F57E-4FB3-9943-49E602678BCA}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{68AD3675-F57E-4FB3-9943-49E602678BCA}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{68AD3675-F57E-4FB3-9943-49E602678BCA}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{42E66302-6F46-47BE-936B-4264DFD6004F}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{42E66302-6F46-47BE-936B-4264DFD6004F}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{42E66302-6F46-47BE-936B-4264DFD6004F}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{42E66302-6F46-47BE-936B-4264DFD6004F}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{C8049356-559D-4F34-AC17-56F3AE62C897}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
|
||||
{C8049356-559D-4F34-AC17-56F3AE62C897}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
|
||||
{C8049356-559D-4F34-AC17-56F3AE62C897}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
|
||||
@@ -62,6 +161,17 @@ Global
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{B027C72E-F04E-42E0-A7F7-993AEF8400D2} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{5B003EB4-DD06-4BC6-B2E9-A9F0E445CB86} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{80696796-DE63-42CA-ACB0-A83E5AA7AE06} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{E28C7916-1BCE-434A-B045-9F755A00A7C4} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{0AC47423-D050-46D4-8C4C-E2D44102FAB6} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{652B7191-D7FE-4889-8E45-1AF7739C0EAD} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{072D1E70-A0A4-44AB-92B8-2F6B772626CC} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{3E30213F-6E59-4BE8-BF4A-64D2AAED5B2E} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{02758899-6A37-4FF1-B765-F1C38B40BC9C} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{510CC907-F5AA-432D-AEEB-14A10AE3F811} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{68AD3675-F57E-4FB3-9943-49E602678BCA} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{42E66302-6F46-47BE-936B-4264DFD6004F} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{C8049356-559D-4F34-AC17-56F3AE62C897} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{8C19B991-41E9-4B38-9602-E19375397F1D} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{68F87E68-E13F-4354-A6D6-B44727FE53EE} = {E107E9C1-E893-4E87-987E-04EF0DCEAEFD}
|
||||
|
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Xunit;
|
||||
|
||||
namespace System.Reflection.Tests
|
||||
@@ -304,6 +305,177 @@ namespace System.Reflection.Tests
|
||||
Assert.Contains("Version=255.1.2.3", assemblyName.FullName);
|
||||
}
|
||||
|
||||
private static readonly string VersionUnspecifiedStr = ushort.MaxValue.ToString(NumberFormatInfo.InvariantInfo);
|
||||
|
||||
private static IEnumerable<object[]> Constructor_String_InvalidVersionTest_MemberData()
|
||||
{
|
||||
// No components
|
||||
yield return new object[] { "" };
|
||||
yield return new object[] { $"{VersionUnspecifiedStr}" };
|
||||
yield return new object[] { $"{VersionUnspecifiedStr}.{VersionUnspecifiedStr}" };
|
||||
yield return new object[] { $"{VersionUnspecifiedStr}.{VersionUnspecifiedStr}.{VersionUnspecifiedStr}" };
|
||||
yield return new object[] { $"{VersionUnspecifiedStr}.{VersionUnspecifiedStr}.{VersionUnspecifiedStr}.{VersionUnspecifiedStr}" };
|
||||
|
||||
// No major version
|
||||
yield return new object[] { $"{VersionUnspecifiedStr}.1" };
|
||||
yield return new object[] { $"{VersionUnspecifiedStr}.1.1" };
|
||||
yield return new object[] { $"{VersionUnspecifiedStr}.1.1.1" };
|
||||
|
||||
// No minor version
|
||||
yield return new object[] { "1" };
|
||||
yield return new object[] { $"1.{VersionUnspecifiedStr}" };
|
||||
yield return new object[] { $"1.{VersionUnspecifiedStr}.1" };
|
||||
yield return new object[] { $"1.{VersionUnspecifiedStr}.1.1" };
|
||||
|
||||
// Too long
|
||||
yield return new object[] { "1.1.1.1." };
|
||||
yield return new object[] { "1.1.1.1.1" };
|
||||
|
||||
// Invalid component
|
||||
foreach (var invalidComponent in new string[] { "", ".", ".1", "-1", "65536", "foo" })
|
||||
{
|
||||
yield return new object[] { "" + invalidComponent };
|
||||
yield return new object[] { "1." + invalidComponent };
|
||||
yield return new object[] { "1.1." + invalidComponent };
|
||||
yield return new object[] { "1.1.1." + invalidComponent };
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(Constructor_String_InvalidVersionTest_MemberData))]
|
||||
[SkipOnTargetFramework(
|
||||
TargetFrameworkMonikers.NetFramework,
|
||||
".NET Core behavior differs from .NET Framework since it does not want to replicate some bugs")]
|
||||
public static void Constructor_String_InvalidVersionTest(string versionStr)
|
||||
{
|
||||
Assert.Throws<FileLoadException>(() => new AssemblyName("a, Version=" + versionStr));
|
||||
|
||||
if (versionStr.Split('.').Length < 2 || // Version(string) should throw when the minor version is not specified
|
||||
(
|
||||
// The Version class has components of size int32, while AssemblyName(string) only allows uint16 values
|
||||
versionStr.IndexOf(VersionUnspecifiedStr, StringComparison.Ordinal) == -1 &&
|
||||
versionStr.IndexOf("65536", StringComparison.Ordinal) == -1
|
||||
))
|
||||
{
|
||||
Assert.ThrowsAny<Exception>(() => new Version(versionStr));
|
||||
}
|
||||
else
|
||||
{
|
||||
new Version(versionStr);
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<object[]> Constructor_String_VersionTest_MemberData()
|
||||
{
|
||||
// No build
|
||||
var expectedVersion = new Version(1, 1);
|
||||
yield return new object[] { expectedVersion, "1.1" };
|
||||
yield return new object[] { expectedVersion, $"1.1.{VersionUnspecifiedStr}" };
|
||||
yield return new object[] { expectedVersion, $"1.1.{VersionUnspecifiedStr}.1" };
|
||||
|
||||
// No revision
|
||||
expectedVersion = new Version(1, 1, 1);
|
||||
yield return new object[] { expectedVersion, "1.1.1" };
|
||||
yield return new object[] { expectedVersion, $"1.1.1.{VersionUnspecifiedStr}" };
|
||||
|
||||
// All components
|
||||
yield return new object[] { new Version(1, 1, 1, 1), "1.1.1.1" };
|
||||
// 65535 causes the component to be considered unspecified. That's not very interesting, so using 65534 instead.
|
||||
yield return new object[] { new Version(65534, 65534, 65534, 65534), "65534.65534.65534.65534" };
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(Constructor_String_VersionTest_MemberData))]
|
||||
[SkipOnTargetFramework(
|
||||
TargetFrameworkMonikers.NetFramework,
|
||||
".NET Core behavior differs from .NET Framework since it does not want to replicate some bugs")]
|
||||
public static void Constructor_String_VersionTest(Version expectedVersion, string versionStr)
|
||||
{
|
||||
Assert.NotNull(expectedVersion);
|
||||
|
||||
Action<AssemblyName> verify =
|
||||
an =>
|
||||
{
|
||||
if (expectedVersion == null)
|
||||
{
|
||||
Assert.Null(an.Version);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.Equal(expectedVersion, an.Version);
|
||||
}
|
||||
};
|
||||
|
||||
var assemblyNameFromStr = new AssemblyName("a, Version=" + versionStr);
|
||||
verify(assemblyNameFromStr);
|
||||
verify(new AssemblyName(assemblyNameFromStr.FullName));
|
||||
|
||||
var versionFromStr = new Version(versionStr);
|
||||
|
||||
// The Version class has components of size int32, while AssemblyName(string) only allows uint16 values
|
||||
if (versionStr.IndexOf(VersionUnspecifiedStr, StringComparison.Ordinal) == -1)
|
||||
{
|
||||
Assert.Equal(expectedVersion, versionFromStr);
|
||||
}
|
||||
|
||||
assemblyNameFromStr = new AssemblyName("a, Version=" + versionFromStr);
|
||||
verify(assemblyNameFromStr);
|
||||
verify(new AssemblyName(assemblyNameFromStr.FullName));
|
||||
|
||||
assemblyNameFromStr = new AssemblyName() { Name = "a", Version = expectedVersion };
|
||||
verify(assemblyNameFromStr);
|
||||
verify(new AssemblyName(assemblyNameFromStr.FullName));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[SkipOnTargetFramework(
|
||||
TargetFrameworkMonikers.NetFramework,
|
||||
".NET Core behavior differs from .NET Framework since it does not want to replicate some bugs")]
|
||||
public static void Constructor_String_LoadVersionTest()
|
||||
{
|
||||
string assemblyNamePrefix = "System.Reflection.Tests.Assembly_";
|
||||
|
||||
// Requested version 1.0 does not load 0.0.0.0, but loads 1.2.0.0, 3.0.0.0
|
||||
Assert.Throws<FileLoadException>(() => Assembly.Load(new AssemblyName(assemblyNamePrefix + "0_0_0_0, Version=1.0")));
|
||||
Assert.NotNull(Assembly.Load(new AssemblyName(assemblyNamePrefix + "1_2_0_0, Version=1.0")));
|
||||
Assert.NotNull(Assembly.Load(new AssemblyName(assemblyNamePrefix + "3_0_0_0, Version=1.0")));
|
||||
|
||||
// Requested version 1.1 does not load 1.0.0.0, but loads 1.1.2.0, 1.3.0.0
|
||||
Assert.Throws<FileLoadException>(() => Assembly.Load(new AssemblyName(assemblyNamePrefix + "1_0_0_0, Version=1.1")));
|
||||
Assert.NotNull(Assembly.Load(new AssemblyName(assemblyNamePrefix + "1_1_2_0, Version=1.1")));
|
||||
Assert.NotNull(Assembly.Load(new AssemblyName(assemblyNamePrefix + "1_3_0_0, Version=1.1")));
|
||||
|
||||
// Requested version 1.1.1 does not load 1.1.0.0, but loads 1.1.1.2, 1.1.3.0
|
||||
Assert.Throws<FileLoadException>(() => Assembly.Load(new AssemblyName(assemblyNamePrefix + "1_1_0_0, Version=1.1.1")));
|
||||
Assert.NotNull(Assembly.Load(new AssemblyName(assemblyNamePrefix + "1_1_1_2, Version=1.1.1")));
|
||||
Assert.NotNull(Assembly.Load(new AssemblyName(assemblyNamePrefix + "1_1_3_0, Version=1.1.1")));
|
||||
|
||||
// Requested version 1.1.1.1 does not load 1.1.1.0, but loads 1.1.1.3
|
||||
Assert.Throws<FileLoadException>(() => Assembly.Load(new AssemblyName(assemblyNamePrefix + "1_1_1_0, Version=1.1.1.1")));
|
||||
Assert.NotNull(Assembly.Load(new AssemblyName(assemblyNamePrefix + "1_1_1_3, Version=1.1.1.1")));
|
||||
|
||||
Constructor_String_LoadVersionTest_ReferenceVersionAssemblies();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)] // delay type loading so that the test above can run first
|
||||
private static void Constructor_String_LoadVersionTest_ReferenceVersionAssemblies()
|
||||
{
|
||||
// The purpose of this function is only to have a static reference to each of the test assemblies required by
|
||||
// Constructor_String_LoadVersionTest so that the compiler does not optimize away the project references and ILC can
|
||||
// include them in the closure. Otherwise, the test does not work on UapAot.
|
||||
Assert.NotNull(typeof(AssemblyVersion.Program_0_0_0_0));
|
||||
Assert.NotNull(typeof(AssemblyVersion.Program_1_0_0_0));
|
||||
Assert.NotNull(typeof(AssemblyVersion.Program_1_1_0_0));
|
||||
Assert.NotNull(typeof(AssemblyVersion.Program_1_1_1_0));
|
||||
Assert.NotNull(typeof(AssemblyVersion.Program_1_1_1_2));
|
||||
Assert.NotNull(typeof(AssemblyVersion.Program_1_1_1_3));
|
||||
Assert.NotNull(typeof(AssemblyVersion.Program_1_1_2_0));
|
||||
Assert.NotNull(typeof(AssemblyVersion.Program_1_1_3_0));
|
||||
Assert.NotNull(typeof(AssemblyVersion.Program_1_2_0_0));
|
||||
Assert.NotNull(typeof(AssemblyVersion.Program_1_3_0_0));
|
||||
Assert.NotNull(typeof(AssemblyVersion.Program_3_0_0_0));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Foo")]
|
||||
[InlineData("Hi There")]
|
||||
|
8
external/corefx/src/System.Reflection/tests/AssemblyVersion/Configurations.props
vendored
Normal file
8
external/corefx/src/System.Reflection/tests/AssemblyVersion/Configurations.props
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<BuildConfigurations>
|
||||
netstandard;
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
</Project>
|
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_0_0_0_0.cs
vendored
Normal file
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_0_0_0_0.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAssembly]
|
||||
|
||||
namespace System.Reflection.Tests.AssemblyVersion
|
||||
{
|
||||
public class Program_0_0_0_0
|
||||
{
|
||||
}
|
||||
}
|
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_0_0_0.cs
vendored
Normal file
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_0_0_0.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAssembly]
|
||||
|
||||
namespace System.Reflection.Tests.AssemblyVersion
|
||||
{
|
||||
public class Program_1_0_0_0
|
||||
{
|
||||
}
|
||||
}
|
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_1_0_0.cs
vendored
Normal file
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_1_0_0.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAssembly]
|
||||
|
||||
namespace System.Reflection.Tests.AssemblyVersion
|
||||
{
|
||||
public class Program_1_1_0_0
|
||||
{
|
||||
}
|
||||
}
|
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_1_1_0.cs
vendored
Normal file
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_1_1_0.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAssembly]
|
||||
|
||||
namespace System.Reflection.Tests.AssemblyVersion
|
||||
{
|
||||
public class Program_1_1_1_0
|
||||
{
|
||||
}
|
||||
}
|
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_1_1_2.cs
vendored
Normal file
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_1_1_2.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAssembly]
|
||||
|
||||
namespace System.Reflection.Tests.AssemblyVersion
|
||||
{
|
||||
public class Program_1_1_1_2
|
||||
{
|
||||
}
|
||||
}
|
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_1_1_3.cs
vendored
Normal file
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_1_1_3.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAssembly]
|
||||
|
||||
namespace System.Reflection.Tests.AssemblyVersion
|
||||
{
|
||||
public class Program_1_1_1_3
|
||||
{
|
||||
}
|
||||
}
|
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_1_2_0.cs
vendored
Normal file
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_1_2_0.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAssembly]
|
||||
|
||||
namespace System.Reflection.Tests.AssemblyVersion
|
||||
{
|
||||
public class Program_1_1_2_0
|
||||
{
|
||||
}
|
||||
}
|
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_1_3_0.cs
vendored
Normal file
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_1_3_0.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAssembly]
|
||||
|
||||
namespace System.Reflection.Tests.AssemblyVersion
|
||||
{
|
||||
public class Program_1_1_3_0
|
||||
{
|
||||
}
|
||||
}
|
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_2_0_0.cs
vendored
Normal file
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_2_0_0.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAssembly]
|
||||
|
||||
namespace System.Reflection.Tests.AssemblyVersion
|
||||
{
|
||||
public class Program_1_2_0_0
|
||||
{
|
||||
}
|
||||
}
|
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_3_0_0.cs
vendored
Normal file
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_1_3_0_0.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAssembly]
|
||||
|
||||
namespace System.Reflection.Tests.AssemblyVersion
|
||||
{
|
||||
public class Program_1_3_0_0
|
||||
{
|
||||
}
|
||||
}
|
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_3_0_0_0.cs
vendored
Normal file
12
external/corefx/src/System.Reflection/tests/AssemblyVersion/Program_3_0_0_0.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAssembly]
|
||||
|
||||
namespace System.Reflection.Tests.AssemblyVersion
|
||||
{
|
||||
public class Program_3_0_0_0
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{5B003EB4-DD06-4BC6-B2E9-A9F0E445CB86}</ProjectGuid>
|
||||
<AssemblyVersion>0.0.0.0</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
<!-- Default configurations to help VS understand the configurations -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<Compile Include="Program_0_0_0_0.cs" />
|
||||
<Compile Include="$(CommonPath)\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs">
|
||||
<Link>Common\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{80696796-DE63-42CA-ACB0-A83E5AA7AE06}</ProjectGuid>
|
||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
<!-- Default configurations to help VS understand the configurations -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<Compile Include="Program_1_0_0_0.cs" />
|
||||
<Compile Include="$(CommonPath)\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs">
|
||||
<Link>Common\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{E28C7916-1BCE-434A-B045-9F755A00A7C4}</ProjectGuid>
|
||||
<AssemblyVersion>1.1.0.0</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
<!-- Default configurations to help VS understand the configurations -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<Compile Include="Program_1_1_0_0.cs" />
|
||||
<Compile Include="$(CommonPath)\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs">
|
||||
<Link>Common\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{0AC47423-D050-46D4-8C4C-E2D44102FAB6}</ProjectGuid>
|
||||
<AssemblyVersion>1.1.1.0</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
<!-- Default configurations to help VS understand the configurations -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<Compile Include="Program_1_1_1_0.cs" />
|
||||
<Compile Include="$(CommonPath)\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs">
|
||||
<Link>Common\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{652B7191-D7FE-4889-8E45-1AF7739C0EAD}</ProjectGuid>
|
||||
<AssemblyVersion>1.1.1.2</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
<!-- Default configurations to help VS understand the configurations -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<Compile Include="Program_1_1_1_2.cs" />
|
||||
<Compile Include="$(CommonPath)\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs">
|
||||
<Link>Common\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{072D1E70-A0A4-44AB-92B8-2F6B772626CC}</ProjectGuid>
|
||||
<AssemblyVersion>1.1.1.3</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
<!-- Default configurations to help VS understand the configurations -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<Compile Include="Program_1_1_1_3.cs" />
|
||||
<Compile Include="$(CommonPath)\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs">
|
||||
<Link>Common\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user