Fix tests...
This commit is contained in:
@ -3,7 +3,6 @@ import java.util.Objects;
|
||||
public class Aufgabe3Test {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
//test classes BodyLinkedList and BodyForceTreeMap
|
||||
|
||||
// create five bodies
|
||||
@ -78,10 +77,9 @@ public class Aufgabe3Test {
|
||||
testValue(bfm.get(earth).distanceTo(earth.gravitationalForce(sun)), 0);
|
||||
testValue(bfm.get(sun).distanceTo(sun.gravitationalForce(earth).plus(sun.gravitationalForce(venus))), 0);
|
||||
|
||||
testValue(bfm.put(earth, new Vector3(0, 0, 0)).distanceTo(earth.gravitationalForce(sun)), 0);
|
||||
testValue(bfm.get(mercury).distanceTo(mercury.gravitationalForce(sun)), 0);
|
||||
testValue(bfm.get(earth).distanceTo(new Vector3(0, 0, 0)), 0);
|
||||
testValue(bfm.get(mercury), mercury.gravitationalForce(sun));
|
||||
|
||||
}
|
||||
|
||||
public static void testComparison(Object first, Object second, boolean expected) {
|
||||
@ -95,7 +93,7 @@ public class Aufgabe3Test {
|
||||
}
|
||||
|
||||
public static void testValue(Object given, Object expected) {
|
||||
if (given == expected) {
|
||||
if (Objects.equals(given, expected)) {
|
||||
System.out.println("Successful test");
|
||||
} else {
|
||||
System.out.println("Test NOT successful! Expected value: " + expected + " / Given value: " + given);
|
||||
|
Reference in New Issue
Block a user