Browse Source

Tests: fix test bug where GetHashCode was tested against known result

v2
Christoph Ruegg 13 years ago
parent
commit
4060899bcd
  1. 4
      src/UnitTests/LinearAlgebraTests/Complex/VectorTests.cs
  2. 4
      src/UnitTests/LinearAlgebraTests/Complex32/VectorTests.cs
  3. 4
      src/UnitTests/LinearAlgebraTests/Double/VectorTests.cs
  4. 4
      src/UnitTests/LinearAlgebraTests/Single/VectorTests.cs

4
src/UnitTests/LinearAlgebraTests/Complex/VectorTests.cs

@ -232,7 +232,9 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
public void CanGetHashCode()
{
var vector = CreateVector(new[] { new Complex(1, 1), new Complex(2, 1), new Complex(3, 1), new Complex(4, 1), new Complex(5, 1) });
Assert.AreEqual(-344264403, vector.GetHashCode());
Assert.AreEqual(vector.GetHashCode(), vector.GetHashCode());
Assert.AreEqual(vector.GetHashCode(), CreateVector(new[] { new Complex(1, 1), new Complex(2, 1), new Complex(3, 1), new Complex(4, 1), new Complex(5, 1) }).GetHashCode());
Assert.AreNotEqual(vector.GetHashCode(), CreateVector(new[] { new Complex(1, 1) }).GetHashCode());
}
/// <summary>

4
src/UnitTests/LinearAlgebraTests/Complex32/VectorTests.cs

@ -232,7 +232,9 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32
public void CanGetHashCode()
{
var vector = CreateVector(new[] { new Complex32(1, 1), new Complex32(2, 1), new Complex32(3, 1), new Complex32(4, 1), new Complex32(5, 1) });
Assert.AreEqual(-26300510, vector.GetHashCode());
Assert.AreEqual(vector.GetHashCode(), vector.GetHashCode());
Assert.AreEqual(vector.GetHashCode(), CreateVector(new[] { new Complex32(1, 1), new Complex32(2, 1), new Complex32(3, 1), new Complex32(4, 1), new Complex32(5, 1) }).GetHashCode());
Assert.AreNotEqual(vector.GetHashCode(), CreateVector(new[] { new Complex32(1, 1) }).GetHashCode());
}
/// <summary>

4
src/UnitTests/LinearAlgebraTests/Double/VectorTests.cs

@ -230,7 +230,9 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double
public void CanGetHashCode()
{
var vector = CreateVector(new double[] { 1, 2, 3, 4 });
Assert.AreEqual(-1140355183, vector.GetHashCode());
Assert.AreEqual(vector.GetHashCode(), vector.GetHashCode());
Assert.AreEqual(vector.GetHashCode(), CreateVector(new double[] { 1, 2, 3, 4 }).GetHashCode());
Assert.AreNotEqual(vector.GetHashCode(), CreateVector(new double[] { 1 }).GetHashCode());
}
/// <summary>

4
src/UnitTests/LinearAlgebraTests/Single/VectorTests.cs

@ -230,7 +230,9 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single
public void CanGetHashCode()
{
var vector = CreateVector(new float[] { 1, 2, 3, 4 });
Assert.AreEqual(-642805871, vector.GetHashCode());
Assert.AreEqual(vector.GetHashCode(), vector.GetHashCode());
Assert.AreEqual(vector.GetHashCode(), CreateVector(new float[] { 1, 2, 3, 4 }).GetHashCode());
Assert.AreNotEqual(vector.GetHashCode(), CreateVector(new float[] { 1 }).GetHashCode());
}
/// <summary>

Loading…
Cancel
Save