Skip to content

Commit

Permalink
Test002: check return codes from PhysicsSystem.update()
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jul 8, 2024
1 parent c35ebb3 commit 87c831f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/test/java/testjoltjni/junit/Test002.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ of this software and associated documentation files (the "Software"), to deal
import com.github.stephengold.joltjni.EActivation;
import com.github.stephengold.joltjni.EMotionQuality;
import com.github.stephengold.joltjni.EMotionType;
import com.github.stephengold.joltjni.EPhysicsUpdateError;
import com.github.stephengold.joltjni.Float3;
import com.github.stephengold.joltjni.IndexedTriangle;
import com.github.stephengold.joltjni.IndexedTriangleList;
Expand Down Expand Up @@ -138,11 +139,12 @@ public void test002() {
Jolt.cMaxPhysicsJobs, Jolt.cMaxPhysicsBarriers, numThreads);

// Simulate physics for half a second:
float deltaTime = 1f / 60;
for (int stepCounter = 0; stepCounter < 30; ++stepCounter) {
int numCollisionSteps = 1;
physicsSystem.update(
final float deltaTime = 1f / 60;
final int numCollisionSteps = 1;
int errors = physicsSystem.update(
deltaTime, numCollisionSteps, tempAllocator, jobSystem);
Assert.assertEquals(EPhysicsUpdateError.None, errors);
}

jobSystem.close();
Expand Down

0 comments on commit 87c831f

Please sign in to comment.