65 references to Equality
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (65)
Symbols\FunctionPointerTypeSymbolTests.cs (65)
709AssertEqualityAndHashCode((FunctionPointerTypeSymbol)m.Parameters[0].Type, (FunctionPointerTypeSymbol)m.Parameters[1].Type, returnEquality: Equality.Equal, callingConventionEquality: Equality.Equal);
727returnEquality: Equality.DifferingNullability, callingConventionEquality: Equality.Equal,
728Equality.Equal, Equality.DifferingNullability);
746returnEquality: Equality.Equal, callingConventionEquality: Equality.Equal,
747Equality.Equal, Equality.Equal, Equality.Equal, Equality.Equal);
764returnEquality: Equality.Equal, callingConventionEquality: Equality.Equal,
765Equality.Equal);
783returnEquality: Equality.DifferingNullability, callingConventionEquality: Equality.Equal,
784Equality.DifferingNullability);
801returnEquality: Equality.NotEqual, callingConventionEquality: Equality.Equal,
802Equality.Equal, Equality.Equal, Equality.Equal, Equality.Equal);
819returnEquality: Equality.Equal, callingConventionEquality: Equality.Equal,
820Equality.Equal, Equality.Equal, Equality.Equal, Equality.NotEqual);
837returnEquality: Equality.Equal, callingConventionEquality: Equality.NotEqual,
838Equality.Equal, Equality.Equal, Equality.Equal, Equality.Equal);
855returnEquality: Equality.Equal, callingConventionEquality: Equality.Equal,
856Equality.NotEqual, Equality.NotEqual, Equality.NotEqual, Equality.Equal);
873returnEquality: Equality.NotEqual, callingConventionEquality: Equality.Equal,
874Equality.Equal, Equality.Equal, Equality.Equal, Equality.Equal);
891returnEquality: Equality.Equal, callingConventionEquality: Equality.Equal,
892Equality.Equal);
902private void AssertEqualityAndHashCode(FunctionPointerTypeSymbol p1, FunctionPointerTypeSymbol p2, Equality returnEquality, Equality callingConventionEquality, params Equality[] parameterEqualities)
904var overallEquality = returnEquality | callingConventionEquality | (parameterEqualities.Length > 0 ? parameterEqualities.Aggregate((acc, cur) => acc | cur) : 0);
911if (hasFlag(returnEquality, Equality.NotEqual))
924Assert.Equal(returnEquality == Equality.Equal, ret1.Equals(ret2, TypeCompareKind.ConsiderEverything));
932if (parameterEqualities[i] == Equality.Equal)
942assertSymbolEquality(param1, p2.Signature.Parameters[j], Equality.NotEqual);
943assertSymbolEquality(param2, p1.Signature.Parameters[j], Equality.NotEqual);
947static bool hasFlag(Equality eq, Equality flag) => (eq & flag) == flag;
948static void assertSymbolEquality(Symbol s1, Symbol s2, Equality eq)
950if (hasFlag(eq, Equality.NotEqual))
959Assert.Equal(eq == Equality.Equal, s1.Equals(s2, TypeCompareKind.ConsiderEverything));