Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bugs in ManagedMethod parsing, and updated hierarchies. #3704

Merged
merged 5 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Addressed PR messages and fixed encoding issues.
  • Loading branch information
Haplois committed Jul 19, 2022
commit 749aac1c369931603e39994fe751c35c23dfd448
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestPlatform.Extensions.EventLogCollector")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.TestPlatform.AdapterUtilities/Friends.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@

using System.Runtime.CompilerServices;

[assembly: System.Resources.NeutralResourcesLanguage("en-US")]
[assembly: InternalsVisibleTo("Microsoft.TestPlatform.AdapterUtilities.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private static void GetManagedNameAndHierarchy(MethodBase method, bool useClosed

if (!ReflectionHelpers.IsMethod(method))
{
throw new ArgumentException(Resources.Resources.ErrorMethodExpectedAsAnArgument, nameof(method));
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.Resources.ErrorMethodExpectedAsAnArgument, nameof(method)));
}

var semanticType = ReflectionHelpers.GetReflectedType(method)
Expand Down Expand Up @@ -151,12 +151,12 @@ private static void GetManagedNameAndHierarchy(MethodBase method, bool useClosed
var hierarchyPos = AppendTypeString(typeBuilder, semanticType, closedType: useClosedTypes);
if (hierarchyPos is null || hierarchyPos.Length != 3)
Haplois marked this conversation as resolved.
Show resolved Hide resolved
{
throw new ArgumentException(Resources.Resources.ErrorMethodExpectedAsAnArgument, nameof(method));
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.Resources.ErrorMethodExpectedAsAnArgument, nameof(method)));
}

// Method Name with method arity
var arity = method.GetGenericArguments().Length;
AppendMethodString(methodBuilder, method.Name, arity, useClosedTypes);
AppendMethodString(methodBuilder, method.Name, arity);
if (arity > 0)
{
if (useClosedTypes)
Expand Down Expand Up @@ -399,7 +399,7 @@ private static void AppendNamespace(StringBuilder b, string? namespaceString)
}
}

private static void AppendMethodString(StringBuilder methodBuilder, string name, int methodArity, bool closedType)
private static void AppendMethodString(StringBuilder methodBuilder, string name, int methodArity)
{
var arityStart = name.LastIndexOf('`');
var arity = 0;
Expand Down Expand Up @@ -493,7 +493,7 @@ private static int AppendNestedTypeName(StringBuilder b, Type? type, bool closed
? info.GenericTypeParameters.Length
: info.GenericTypeArguments.Length;

AppendMethodString(b, typeName, arity - outerArity, closedType);
AppendMethodString(b, typeName, arity - outerArity);
b.Append('*', stars);
return arity;
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
<value>Method arity must be numeric.</value>
</data>
<data name="ErrorMethodExpectedAsAnArgument" xml:space="preserve">
<value>Argument must be a method.</value>
<value>Argument must be a method. (Argument name: {0})</value>
</data>
<data name="ErrorMethodNotFound" xml:space="preserve">
<value>Method '{0}' not found on type '{1}'</value>
Expand Down Expand Up @@ -159,4 +159,4 @@

Example: 'System.Reflection.MethodBase' is not implemented on this platform!</comment>
</data>
</root>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example: 'System.Reflection.MethodBase' is not implemented on this platform!</no
<note>An error thrown when the type name ended but opened single quote was not matched.</note>
</trans-unit>
<trans-unit id="ErrorMethodExpectedAsAnArgument">
<source>Argument must be a method.</source>
<source>Argument must be a method. (Argument name: {0})</source>
<target state="new">Argument must be a method.</target>
<note></note>
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.VisualStudio.TestPlatform.Client")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestPlatform.Common")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.VisualStudio.TestPlatform.CommunicationUtilities")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestPlatform.CoreUtilities")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.VisualStudio.TestPlatform.CrossPlatEngine")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestPlatform.Extensions.BlameDataCollector")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestPlatform.Extensions.HtmlLogger")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestPlatform.Extensions.TrxLogger")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestPlatfrom.ObjectModel")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestPlatform.PlatformAbstractions")]
[assembly: AssemblyTrademark("")]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestPlatform.TestHostRuntimeProvider")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestPlatform.Utilities")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestPlatform.ManagedConsoleWrapper")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
2 changes: 1 addition & 1 deletion src/datacollector/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("datacollector")]
[assembly: AssemblyTrademark("")]

Expand Down
2 changes: 1 addition & 1 deletion src/testhost.arm64/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestHost")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
2 changes: 1 addition & 1 deletion src/testhost.x86/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestHost.x86")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
2 changes: 1 addition & 1 deletion src/testhost/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft.TestHost")]
[assembly: AssemblyTrademark("")]
[assembly: NeutralResourcesLanguage("en-US")]
Expand Down
Loading