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

Add explicit tests around CompareAssemblyIdentity implementation #5974

Open
rainersigwald opened this issue Dec 16, 2020 · 0 comments
Open
Labels
help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. testing triaged
Milestone

Comments

@rainersigwald
Copy link
Member

Before the .NET Core port, ResolveAssemblyReferences compared assembly identities using a native method call:

https://github.com/Microsoft/msbuild/blob/a939f1547a3f8b91512d0d2d270a8d0f0111e7e7/src/XMakeTasks/NativeMethods.cs#L976-L985

Now, there's a managed implementation that optionally calls that one on Windows:

// TODO: Verify correctness of this implementation and
// extend to more cases.
internal static void CompareAssemblyIdentity(
string assemblyIdentity1,
bool fUnified1,
string assemblyIdentity2,
bool fUnified2,
out bool pfEquivalent,
out AssemblyComparisonResult pResult)
{
#if FEATURE_FUSION_COMPAREASSEMBLYIDENTITY
if (NativeMethodsShared.IsWindows)
{
CompareAssemblyIdentityWindows(
assemblyIdentity1,
fUnified1,
assemblyIdentity2,
fUnified2,
out pfEquivalent,
out pResult);
}
#endif

We should have tests that validate that implementation using the native method as a reference. This is a nice unit-testing problem since it's functional and idempotent, so we can probably hit 100% code coverage.

Related: #3930, #5973

@rainersigwald rainersigwald added help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. testing labels Dec 16, 2020
@rainersigwald rainersigwald added this to the Backlog milestone Dec 16, 2020
@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. testing triaged
Projects
None yet
Development

No branches or pull requests

2 participants