From 157bd87ca9d2799ab804e3b0ea50c873a52fc28a Mon Sep 17 00:00:00 2001 From: Arthur Bols Date: Sun, 11 Mar 2018 19:51:26 +0100 Subject: [PATCH] improved wormtest --- OGP1718-Worms/tests/worms/model/WormTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OGP1718-Worms/tests/worms/model/WormTest.java b/OGP1718-Worms/tests/worms/model/WormTest.java index 9b41ce7..b422258 100644 --- a/OGP1718-Worms/tests/worms/model/WormTest.java +++ b/OGP1718-Worms/tests/worms/model/WormTest.java @@ -10,7 +10,7 @@ import worms.util.Tuple; import java.util.Random; class WormTest { - + private static Worm worm; private static Random r = new Random(); @@ -63,7 +63,7 @@ class WormTest { } @RepeatedTest(5000) - void jump(RepetitionInfo repetitionInfo) { + void jump() { worm = new Worm(Tuple.create(0.0, 0.0), 0, "Test", 1); double maxAngle = Math.abs(2 * Math.PI - worm.getOrientation()); @@ -79,9 +79,9 @@ class WormTest { } else { double orient = worm.getOrientation(); - double force = 5 * worm.getActionPoints() + worm.getMass() * worm.G; - double v = force / worm.getMass() * worm.FORCE_TIME; - double newLocX = worm.getLocation().item1 + Math.pow(v, 2) * Math.sin(2 * orient) / worm.G; + double force = 5 * worm.getActionPoints() + worm.getMass() * Worm.G; + double v = force / worm.getMass() * Worm.FORCE_TIME; + double newLocX = worm.getLocation().item1 + Math.pow(v, 2) * Math.sin(2 * orient) / Worm.G; worm.jump(); assertEquals(Tuple.create(newLocX, worm.getLocation().item2), worm.getLocation()); }