From 4205a8c84270cc81af14b2f74e4ae7c921338585 Mon Sep 17 00:00:00 2001 From: anniemao <amao9098@gmail.com> Date: Tue, 21 Jul 2020 15:07:03 -0700 Subject: [PATCH] Fix junit tests in AVL --- src/tests/gitlab/ckpt2/AVLTreeTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/gitlab/ckpt2/AVLTreeTests.java b/src/tests/gitlab/ckpt2/AVLTreeTests.java index fccc9bb..46da5a6 100644 --- a/src/tests/gitlab/ckpt2/AVLTreeTests.java +++ b/src/tests/gitlab/ckpt2/AVLTreeTests.java @@ -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")); } -- GitLab