Skip to content

Commit

Permalink
Fixing unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarsouza committed Dec 8, 2017
1 parent e71a2a1 commit 6064bb1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Unit Tests/Accord.Tests.Controls/BlobCounterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void blobcounter_test()
image.Save(Path.Combine(basePath, "test.png"));
#endregion

Assert.AreEqual(0, blobs.Length);
Assert.AreEqual(25, blobs.Length);
}
}
}
24 changes: 12 additions & 12 deletions Unit Tests/Accord.Tests.MachineLearning/Structures/VPTreeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ public void FromDataTest2()

// Results will be:
NodeDistance<VPTreeNode<double[]>>[] result = neighbors.ToArray();
double d1 = result[0].Distance;
double[] p1 = result[0].Node.Position;
double d1 = result[0].Distance; // 1
double[] p1 = result[0].Node.Position; // { 5, 4 }

double d2 = result[0].Distance;
double[] p2 = result[0].Node.Position;
double d2 = result[1].Distance; // 3
double[] p2 = result[1].Node.Position; // { 2, 3 }

double d3 = result[0].Distance;
double[] p3 = result[0].Node.Position;
double d3 = result[2].Distance; // 3
double[] p3 = result[2].Node.Position; // { 7, 2 }


// We can also navigate the tree using:
Expand All @@ -123,13 +123,13 @@ public void FromDataTest2()
}
#endregion

Assert.AreEqual(0, d1);
Assert.AreEqual(0, d2);
Assert.AreEqual(0, d3);
Assert.AreEqual(1, d1);
Assert.AreEqual(3, d2);
Assert.AreEqual(3, d3);

Assert.AreEqual(0, p1);
Assert.AreEqual(0, p2);
Assert.AreEqual(0, p3);
Assert.AreEqual(new[] { 5.0, 4.0 }, p1);
Assert.AreEqual(new[] { 2.0, 3.0 }, p2);
Assert.AreEqual(new[] { 7.0, 2.0 }, p3);

foreach (VPTreeNode<double[]> n in tree)
{
Expand Down

0 comments on commit 6064bb1

Please sign in to comment.