diff --git a/CHANGELOG.md b/CHANGELOG.md index fa4b2ba1..04876910 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ ## unreleased - Fix DVector3.cross() returning always 0. [#128](https://github.com/tzaeschke/ode4j/issues/128) +- Fix JUnit test lint. [#130](https://github.com/tzaeschke/ode4j/pull/130) ## 0.5.1 - 2023-09-17 - Support for HiDPI screens / Apple Silicon/Retina. Contribution by valb3r, diff --git a/core/src/test/java/org/ode4j/math/DMatrix3Test.java b/core/src/test/java/org/ode4j/math/DMatrix3Test.java index 9e1f947c..31ad1830 100644 --- a/core/src/test/java/org/ode4j/math/DMatrix3Test.java +++ b/core/src/test/java/org/ode4j/math/DMatrix3Test.java @@ -34,24 +34,24 @@ public class DMatrix3Test { @Test public void testGet(){ DMatrix3 x = newM3(); - assertEquals(x.get00(), 1., 0); - assertEquals(x.get01(), 2., 0); - assertEquals(x.get02(), 3., 0); - assertEquals(x.get10(), 4., 0); - assertEquals(x.get11(), 5., 0); - assertEquals(x.get12(), 6., 0); - assertEquals(x.get20(), 7., 0); - assertEquals(x.get21(), 8., 0); - assertEquals(x.get22(), 9., 0); - assertEquals(x.get(0, 0), 1., 0); - assertEquals(x.get(0, 1), 2., 0); - assertEquals(x.get(0, 2), 3., 0); - assertEquals(x.get(1, 0), 4., 0); - assertEquals(x.get(1, 1), 5., 0); - assertEquals(x.get(1, 2), 6., 0); - assertEquals(x.get(2, 0), 7., 0); - assertEquals(x.get(2, 1), 8., 0); - assertEquals(x.get(2, 2), 9., 0); + assertEquals(1., x.get00(), 0); + assertEquals(2., x.get01(), 0); + assertEquals(3., x.get02(), 0); + assertEquals(4., x.get10(), 0); + assertEquals(5., x.get11(), 0); + assertEquals(6., x.get12(), 0); + assertEquals(7., x.get20(), 0); + assertEquals(8., x.get21(), 0); + assertEquals(9., x.get22(), 0); + assertEquals(1., x.get(0, 0), 0); + assertEquals(2., x.get(0, 1), 0); + assertEquals(3., x.get(0, 2), 0); + assertEquals(4., x.get(1, 0), 0); + assertEquals(5., x.get(1, 1), 0); + assertEquals(6., x.get(1, 2), 0); + assertEquals(7., x.get(2, 0), 0); + assertEquals(8., x.get(2, 1), 0); + assertEquals(9., x.get(2, 2), 0); } @Test @@ -76,23 +76,23 @@ public void testSet(){ //test setIJ() x.set00(1); - assertEquals(x.get00(), 1., 0); + assertEquals(1., x.get00(), 0); x.set01(2); - assertEquals(x.get01(), 2., 0); + assertEquals(2., x.get01(), 0); x.set02(3); - assertEquals(x.get02(), 3., 0); + assertEquals(3., x.get02(), 0); x.set10(4); - assertEquals(x.get10(), 4., 0); + assertEquals(4., x.get10(), 0); x.set11(5); - assertEquals(x.get11(), 5., 0); + assertEquals(5., x.get11(), 0); x.set12(6); - assertEquals(x.get12(), 6., 0); + assertEquals(6., x.get12(), 0); x.set20(7); - assertEquals(x.get20(), 7., 0); + assertEquals(7., x.get20(), 0); x.set21(8); - assertEquals(x.get21(), 8., 0); + assertEquals(8., x.get21(), 0); x.set22(9); - assertEquals(x.get22(), 9., 0); + assertEquals(9., x.get22(), 0); assertEquals(x, x2); //test set(i, j) diff --git a/core/src/test/java/org/ode4j/math/DQuaternionTest.java b/core/src/test/java/org/ode4j/math/DQuaternionTest.java index 1ce9d815..b27a5c35 100644 --- a/core/src/test/java/org/ode4j/math/DQuaternionTest.java +++ b/core/src/test/java/org/ode4j/math/DQuaternionTest.java @@ -142,14 +142,14 @@ public void testReInverse() { @Test public void testGet(){ DQuaternion x = new DQuaternion(1, 2, 3, 4); - assertEquals(x.get0(), 1., 0); - assertEquals(x.get1(), 2., 0); - assertEquals(x.get2(), 3., 0); - assertEquals(x.get3(), 4., 0); - assertEquals(x.get(0), 1., 0); - assertEquals(x.get(1), 2., 0); - assertEquals(x.get(2), 3., 0); - assertEquals(x.get(3), 4., 0); + assertEquals(1., x.get0(), 0); + assertEquals(2., x.get1(), 0); + assertEquals(3., x.get2(), 0); + assertEquals(4., x.get3(), 0); + assertEquals(1., x.get(0), 0); + assertEquals(2., x.get(1), 0); + assertEquals(3., x.get(2), 0); + assertEquals(4., x.get(3), 0); } @Test @@ -174,23 +174,23 @@ public void testSet(){ DQuaternion y = new DQuaternion(5, 6, 7, 8); DQuaternion z = new DQuaternion(9, 10, 11, 12); x.set0(9); - assertEquals(x.get0(), 9., 0); + assertEquals(9., x.get0(), 0); x.set1(10); - assertEquals(x.get1(), 10., 0); + assertEquals(10., x.get1(), 0); x.set2(11); - assertEquals(x.get2(), 11., 0); + assertEquals(11., x.get2(), 0); x.set3(12); - assertEquals(x.get3(), 12., 0); + assertEquals(12., x.get3(), 0); assertEquals(x, z); x.set(0, 5); - assertEquals(x.get0(), 5., 0); + assertEquals(5., x.get0(), 0); x.set(1, 6); - assertEquals(x.get1(), 6., 0); + assertEquals(6., x.get1(), 0); x.set(2, 7); - assertEquals(x.get2(), 7., 0); + assertEquals(7., x.get2(), 0); x.set(3, 8); - assertEquals(x.get3(), 8., 0); + assertEquals(8., x.get3(), 0); assertEquals(x, y); x.set(1, 2, 3, 4); @@ -207,14 +207,14 @@ public void testInit(){ DQuaternion z = new DQuaternion(x); assertTrue(x.isEq(z, 0)); assertFalse(x.isEq(y, 0)); - assertEquals(y.get0(), 0., 0); - assertEquals(y.get1(), 0., 0); - assertEquals(y.get2(), 0., 0); - assertEquals(y.get3(), 0., 0); - - assertEquals(z.get0(), 1., 0); - assertEquals(z.get1(), 2., 0); - assertEquals(z.get2(), 3., 0); + assertEquals(0., y.get0(), 0); + assertEquals(0., y.get1(), 0); + assertEquals(0., y.get2(), 0); + assertEquals(0., y.get3(), 0); + + assertEquals(1., z.get0(), 0); + assertEquals(2., z.get1(), 0); + assertEquals(3., z.get2(), 0); assertEquals(z.get3(), 4., 0); } diff --git a/core/src/test/java/org/ode4j/math/DVector3Test.java b/core/src/test/java/org/ode4j/math/DVector3Test.java index 24689e7d..98096186 100644 --- a/core/src/test/java/org/ode4j/math/DVector3Test.java +++ b/core/src/test/java/org/ode4j/math/DVector3Test.java @@ -25,8 +25,6 @@ import org.junit.Test; import org.ode4j.ode.OdeMath; -import java.util.Arrays; - import static org.junit.Assert.*; public class DVector3Test { @@ -98,12 +96,12 @@ public void testToFloatArray(){ @Test public void testGet(){ DVector3 x = new DVector3(1, 2, 3); - assertEquals(x.get0(), 1., 0); - assertEquals(x.get1(), 2., 0); - assertEquals(x.get2(), 3., 0); - assertEquals(x.get(0), 1., 0); - assertEquals(x.get(1), 2., 0); - assertEquals(x.get(2), 3., 0); + assertEquals(1., x.get0(), 0); + assertEquals(2., x.get1(), 0); + assertEquals(3., x.get2(), 0); + assertEquals(1., x.get(0), 0); + assertEquals(2., x.get(1), 0); + assertEquals(3., x.get(2), 0); } @Test @@ -126,19 +124,19 @@ public void testSet(){ DVector3 y = new DVector3(4, 5, 6); DVector3 z = new DVector3(7, 8, 9); x.set0(7); - assertEquals(x.get0(), 7., 0); + assertEquals(7., x.get0(), 0); x.set1(8); - assertEquals(x.get1(), 8., 0); + assertEquals(8., x.get1(), 0); x.set2(9); - assertEquals(x.get2(), 9., 0); + assertEquals(9., x.get2(), 0); assertTrue(x.isEq(z, 0)); x.set(0, 4); - assertEquals(x.get0(), 4., 0); + assertEquals(4., x.get0(), 0); x.set(1, 5); - assertEquals(x.get1(), 5., 0); + assertEquals(5., x.get1(), 0); x.set(2, 6); - assertEquals(x.get2(), 6., 0); + assertEquals(6., x.get2(), 0); assertTrue(x.isEq(y, 0)); x.set(1, 2, 3); @@ -166,13 +164,13 @@ public void testInit(){ DVector3 z = new DVector3(x); assertTrue(x.isEq(z, 0)); assertFalse(x.isEq(y, 0)); - assertEquals(y.get0(), 0., 0); - assertEquals(y.get1(), 0., 0); - assertEquals(y.get2(), 0., 0); + assertEquals(0., y.get0(), 0); + assertEquals(0., y.get1(), 0); + assertEquals(0., y.get2(), 0); - assertEquals(z.get0(), 1., 0); - assertEquals(z.get1(), 2., 0); - assertEquals(z.get2(), 3., 0); + assertEquals(1., z.get0(), 0); + assertEquals(2., z.get1(), 0); + assertEquals(3., z.get2(), 0); } @Test diff --git a/core/src/test/java/org/ode4j/math/DVector6Test.java b/core/src/test/java/org/ode4j/math/DVector6Test.java index 1194ba3c..87bda0ef 100644 --- a/core/src/test/java/org/ode4j/math/DVector6Test.java +++ b/core/src/test/java/org/ode4j/math/DVector6Test.java @@ -32,18 +32,18 @@ public class DVector6Test { @Test public void testGet(){ DVector6 x = new DVector6(1, 2, 3, 4, 5, 6); - assertEquals(x.get0(), 1., 0); - assertEquals(x.get1(), 2., 0); - assertEquals(x.get2(), 3., 0); - assertEquals(x.get3(), 4., 0); - assertEquals(x.get4(), 5., 0); - assertEquals(x.get5(), 6., 0); - assertEquals(x.get(0), 1., 0); - assertEquals(x.get(1), 2., 0); - assertEquals(x.get(2), 3., 0); - assertEquals(x.get(3), 4., 0); - assertEquals(x.get(4), 5., 0); - assertEquals(x.get(5), 6., 0); + assertEquals(1., x.get0(), 0); + assertEquals(2., x.get1(), 0); + assertEquals(3., x.get2(), 0); + assertEquals(4., x.get3(), 0); + assertEquals(5., x.get4(), 0); + assertEquals(6., x.get5(), 0); + assertEquals(1., x.get(0), 0); + assertEquals(2., x.get(1), 0); + assertEquals(3., x.get(2), 0); + assertEquals(4., x.get(3), 0); + assertEquals(5., x.get(4), 0); + assertEquals(6., x.get(5), 0); } @Test @@ -102,19 +102,19 @@ public void testInit(){ DVector6 z = new DVector6(x); assertTrue(x.isEq(z, 0)); assertFalse(x.isEq(y, 0)); - assertEquals(y.get0(), 0., 0); - assertEquals(y.get1(), 0., 0); - assertEquals(y.get2(), 0., 0); - assertEquals(y.get3(), 0., 0); - assertEquals(y.get4(), 0., 0); - assertEquals(y.get5(), 0., 0); + assertEquals(0., y.get0(), 0); + assertEquals(0., y.get1(), 0); + assertEquals(0., y.get2(), 0); + assertEquals(0., y.get3(), 0); + assertEquals(0., y.get4(), 0); + assertEquals(0., y.get5(), 0); - assertEquals(z.get0(), 1., 0); - assertEquals(z.get1(), 2., 0); - assertEquals(z.get2(), 3., 0); - assertEquals(z.get3(), 4., 0); - assertEquals(z.get4(), 5., 0); - assertEquals(z.get5(), 6., 0); + assertEquals(1., z.get0(), 0); + assertEquals(2., z.get1(), 0); + assertEquals(3., z.get2(), 0); + assertEquals(4., z.get3(), 0); + assertEquals(5., z.get4(), 0); + assertEquals(6., z.get5(), 0); } @Test