Skip to content

Commit

Permalink
Fix JUnit lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tzaeschke committed Oct 5, 2023
1 parent fd5fe08 commit 42196e3
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 95 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
54 changes: 27 additions & 27 deletions core/src/test/java/org/ode4j/math/DMatrix3Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
48 changes: 24 additions & 24 deletions core/src/test/java/org/ode4j/math/DQuaternionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand All @@ -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);
}

Expand Down
38 changes: 18 additions & 20 deletions core/src/test/java/org/ode4j/math/DVector3Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down
48 changes: 24 additions & 24 deletions core/src/test/java/org/ode4j/math/DVector6Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 42196e3

Please sign in to comment.