Description
Copied from VSO ID: 803447
Test:
Name="Color API Test" Priority="1" Area="2D" SubArea="API Tests"
Fails due to a change in GetHashCode from corefx. What the test code is doing is generating 2 different colors and verifying that the resulting hash codes are not equal, the hashcode is calculated from System.Windows.Media.Color by overriding GetHashCode:
which essentially only returns the hashcode from its internal struct which is defined as:
wpf/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Color.cs
Lines 1158 to 1161 in 9c5dd1a
in Framework different values for a,r,g,b would result in a different HashCode in Core it seems only the first value is considered for HashCode calculation, our test has the same first value so the hash code is the same.
As per corefx recommendation (https://github.com/dotnet/corefx/issues/35613) we should override and implement a correct HashCode mechanism for our 4 floats in MILColorF, ideally mirroring what Framework used to do