Skip to content
Snippets Groups Projects
Commit 4205a8c8 authored by anniemao's avatar anniemao
Browse files

Fix junit tests in AVL

parent d2052ade
No related branches found
No related tags found
No related merge requests found
......@@ -116,7 +116,7 @@ public class AVLTreeTests {
incCount(tree, str);
}
// Delete them all
// Calculate count of all values in tree
int totalCount = 0;
for (Item<String, Integer> dc : tree) {
assertEquals((Integer.parseInt(dc.key) + 1) * 5, dc.value.intValue());
......@@ -124,8 +124,8 @@ public class AVLTreeTests {
}
// Check for accuracy
assertEquals(totalCount, (n * (n + 1)) / 2 * 5);
assertEquals(tree.size(), n);
assertEquals((n * (n + 1)) / 2 * 5, totalCount);
assertEquals(n, tree.size());
assertNotNull(tree.find("00851"));
assertEquals(4260, (int) tree.find("00851"));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment