Skip to content

Commit

Permalink
Test007: add 10 more assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Sep 8, 2024
1 parent ba05d0e commit a3a8e32
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/java/testjoltjni/junit/Test007.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,13 @@ private static void doConvexHullShape() {
ConvexHullShape shape = (ConvexHullShape) ref.getPtr();

TestUtils.assertEquals(0f, 0f, 0f, shape.getCenterOfMass(), 0f);
Assert.assertEquals(0.025f, shape.getConvexRadius(), 0f);
Assert.assertEquals(3, shape.getFaceVertices(3, new int[3]));
Assert.assertEquals(Math.sqrt(3.), shape.getInnerRadius(), 1e-6f);
Assert.assertEquals(4, shape.getNumFaces());
Assert.assertEquals(4, shape.getNumPoints());
Assert.assertEquals(3, shape.getNumVerticesInFace(3));
TestUtils.assertEquals(-3f, 3f, -3f, shape.getPoint(1), 0f);
Assert.assertEquals(3, shape.getRefCount());
Assert.assertEquals(EShapeSubType.ConvexHull, shape.getSubType());
Assert.assertEquals(EShapeType.Convex, shape.getType());
Expand Down Expand Up @@ -275,6 +278,7 @@ private static void doMutableCompoundShape() {

TestUtils.assertEquals(0f, 0f, 0f, shape.getCenterOfMass(), 0f);
Assert.assertEquals(Float.MAX_VALUE, shape.getInnerRadius(), 0f);
Assert.assertEquals(0, shape.getNumSubShapes());
Assert.assertEquals(3, shape.getRefCount());
Assert.assertEquals(EShapeSubType.MutableCompound, shape.getSubType());
Assert.assertEquals(EShapeType.Compound, shape.getType());
Expand Down Expand Up @@ -399,6 +403,7 @@ private static void doStaticCompoundShape() {

TestUtils.assertEquals(0f, 0f, 0f, shape.getCenterOfMass(), 0f);
Assert.assertEquals(1f, shape.getInnerRadius(), 0f);
Assert.assertEquals(2, shape.getNumSubShapes());
Assert.assertEquals(3, shape.getRefCount());
Assert.assertEquals(EShapeSubType.StaticCompound, shape.getSubType());
Assert.assertEquals(EShapeType.Compound, shape.getType());
Expand Down Expand Up @@ -488,7 +493,9 @@ private static void testBoxDefaults(BoxShape shape) {
*/
private static void testCapsuleDefaults(CapsuleShape shape) {
TestUtils.assertEquals(0f, 0f, 0f, shape.getCenterOfMass(), 0f);
Assert.assertEquals(1f, shape.getHalfHeightOfCylinder(), 0f);
Assert.assertEquals(1f, shape.getInnerRadius(), 0f);
Assert.assertEquals(1f, shape.getRadius(), 0f);
Assert.assertEquals(EShapeSubType.Capsule, shape.getSubType());
Assert.assertEquals(EShapeType.Convex, shape.getType());
Assert.assertEquals(0L, shape.getUserData());
Expand All @@ -503,7 +510,9 @@ private static void testCapsuleDefaults(CapsuleShape shape) {
private static void testCylinderDefaults(CylinderShape shape) {
TestUtils.assertEquals(0f, 0f, 0f, shape.getCenterOfMass(), 0f);
Assert.assertEquals(0.05f, shape.getConvexRadius(), 0f);
Assert.assertEquals(1f, shape.getHalfHeight(), 0f);
Assert.assertEquals(1f, shape.getInnerRadius(), 0f);
Assert.assertEquals(1f, shape.getRadius(), 0f);
Assert.assertEquals(EShapeSubType.Cylinder, shape.getSubType());
Assert.assertEquals(EShapeType.Convex, shape.getType());
Assert.assertEquals(0L, shape.getUserData());
Expand All @@ -518,6 +527,7 @@ private static void testCylinderDefaults(CylinderShape shape) {
private static void testSphereDefaults(SphereShape shape) {
TestUtils.assertEquals(0f, 0f, 0f, shape.getCenterOfMass(), 0f);
Assert.assertEquals(1f, shape.getInnerRadius(), 0f);
Assert.assertEquals(1f, shape.getRadius(), 0f);
Assert.assertEquals(EShapeSubType.Sphere, shape.getSubType());
Assert.assertEquals(EShapeType.Convex, shape.getType());
Assert.assertEquals(0L, shape.getUserData());
Expand Down

0 comments on commit a3a8e32

Please sign in to comment.