Skip to content

Commit

Permalink
Enhance P2P test to include inline arrays
Browse files Browse the repository at this point in the history
Repro for #918
  • Loading branch information
AArnott committed Apr 17, 2023
1 parent 85cf01f commit 6d822c4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,8 @@ public void TBButton([CombinatorialMemberData(nameof(SpecificCpuArchitectures))]
[Theory, PairwiseData]
public void ProjectReferenceBetweenTwoGeneratingProjects(bool internalsVisibleTo)
{
this.compilation = this.compilation.WithOptions(this.compilation.Options.WithPlatform(Platform.X64));

CSharpCompilation referencedProject = this.compilation
.WithAssemblyName("refdProj");
if (internalsVisibleTo)
Expand All @@ -840,6 +842,7 @@ public void ProjectReferenceBetweenTwoGeneratingProjects(bool internalsVisibleTo
Assert.True(referencedGenerator.TryGenerate("LockWorkStation", CancellationToken.None));
Assert.True(referencedGenerator.TryGenerate("CreateFile", CancellationToken.None));
Assert.True(referencedGenerator.TryGenerate("RAWHID", CancellationToken.None));
Assert.True(referencedGenerator.TryGenerate("SHFILEINFOW", CancellationToken.None)); // generates inline arrays + extension methods
referencedProject = this.AddGeneratedCode(referencedProject, referencedGenerator);
this.AssertNoDiagnostics(referencedProject);

Expand All @@ -848,6 +851,7 @@ public void ProjectReferenceBetweenTwoGeneratingProjects(bool internalsVisibleTo
this.generator = this.CreateGenerator(new GeneratorOptions { ClassName = "P2" });
Assert.True(this.generator.TryGenerate("HidD_GetAttributes", CancellationToken.None));
Assert.True(this.generator.TryGenerate("RAWHID", CancellationToken.None));
Assert.True(this.generator.TryGenerate("DROPDESCRIPTION", CancellationToken.None)); // reuses the same inline array and extension methods as SHFILEINFOW.
this.CollectGeneratedCode(this.generator);
this.AssertNoDiagnostics();
}
Expand Down

0 comments on commit 6d822c4

Please sign in to comment.