Skip to content

Commit

Permalink
Remove instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jcouv committed Dec 26, 2021
1 parent 6ac8a87 commit 81dc580
Showing 1 changed file with 22 additions and 30 deletions.
52 changes: 22 additions & 30 deletions src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTupleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28563,41 +28563,33 @@ static void verify(FieldSymbol field)
[Fact]
public void TupleWithElementNamedWithDefaultName()
{
// Instrumenting test as part of investigating flakiness: https://github.com/dotnet/roslyn/issues/52658
for (int i = 0; i < 1000; i++)
{
string source = @"
string source = @"
class C
{
(int Item1, int Item2) M() => throw null;
}
";
var comp = CreateCompilation(source);
var m = (MethodSymbol)comp.GetMember("C.M");
var tuple = m.ReturnType;
Assert.Equal("(System.Int32 Item1, System.Int32 Item2)", tuple.ToTestDisplayString());
Assert.IsType<ConstructedNamedTypeSymbol>(tuple);

var item1 = tuple.GetMember<TupleElementFieldSymbol>("Item1");
// Instrumenting test as part of investigating flakiness: https://github.com/dotnet/roslyn/issues/52658
RoslynDebug.AssertOrFailFast(0 == item1.TupleElementIndex);

var item1Underlying = item1.TupleUnderlyingField;
Assert.IsType<SubstitutedFieldSymbol>(item1Underlying);
Assert.Equal("System.Int32 (System.Int32 Item1, System.Int32 Item2).Item1", item1Underlying.ToTestDisplayString());
// Instrumenting test as part of investigating flakiness: https://github.com/dotnet/roslyn/issues/52658
RoslynDebug.AssertOrFailFast(0 == item1Underlying.TupleElementIndex);
Assert.Same(item1Underlying, item1Underlying.TupleUnderlyingField);

var item2 = tuple.GetMember<TupleElementFieldSymbol>("Item2");
// Instrumenting test as part of investigating flakiness: https://github.com/dotnet/roslyn/issues/52658
RoslynDebug.AssertOrFailFast(1 == item2.TupleElementIndex);
var item2Underlying = item2.TupleUnderlyingField;
Assert.IsType<SubstitutedFieldSymbol>(item2Underlying);
// Instrumenting test as part of investigating flakiness: https://github.com/dotnet/roslyn/issues/52658
RoslynDebug.AssertOrFailFast(1 == item2Underlying.TupleElementIndex);
Assert.Same(item2Underlying, item2Underlying.TupleUnderlyingField);
}
var comp = CreateCompilation(source);
var m = (MethodSymbol)comp.GetMember("C.M");
var tuple = m.ReturnType;
Assert.Equal("(System.Int32 Item1, System.Int32 Item2)", tuple.ToTestDisplayString());
Assert.IsType<ConstructedNamedTypeSymbol>(tuple);

var item1 = tuple.GetMember<TupleElementFieldSymbol>("Item1");
Assert.Equal(0, item1.TupleElementIndex);

var item1Underlying = item1.TupleUnderlyingField;
Assert.IsType<SubstitutedFieldSymbol>(item1Underlying);
Assert.Equal("System.Int32 (System.Int32 Item1, System.Int32 Item2).Item1", item1Underlying.ToTestDisplayString());
Assert.Equal(0, item1Underlying.TupleElementIndex);
Assert.Same(item1Underlying, item1Underlying.TupleUnderlyingField);

var item2 = tuple.GetMember<TupleElementFieldSymbol>("Item2");
Assert.Equal(1, item2.TupleElementIndex);
var item2Underlying = item2.TupleUnderlyingField;
Assert.IsType<SubstitutedFieldSymbol>(item2Underlying);
Assert.Equal(1, item2Underlying.TupleElementIndex);
Assert.Same(item2Underlying, item2Underlying.TupleUnderlyingField);
}

[Fact]
Expand Down

0 comments on commit 81dc580

Please sign in to comment.