Skip to content

Commit

Permalink
Test003: additional testing
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jul 8, 2024
1 parent 9f3564f commit 6c10330
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/test/java/testjoltjni/junit/Test003.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ of this software and associated documentation files (the "Software"), to deal
*/
package testjoltjni.junit;

import com.github.stephengold.joltjni.AaBox;
import com.github.stephengold.joltjni.JobSystem;
import com.github.stephengold.joltjni.JobSystemSingleThreaded;
import com.github.stephengold.joltjni.JobSystemThreadPool;
import com.github.stephengold.joltjni.Jolt;
import com.github.stephengold.joltjni.Vec3;
import com.github.stephengold.joltjni.Vec3Arg;
import org.junit.Assert;
import org.junit.Test;
import testjoltjni.Utils;
Expand Down Expand Up @@ -52,6 +55,23 @@ public void test003() {
Jolt.newFactory();
Jolt.registerTypes();

// AaBox:
{
AaBox box1 = new AaBox();
Assert.assertTrue(box1.hasAssignedNativeObject());
Assert.assertTrue(box1.ownsNativeObject());
Assert.assertNotEquals(0L, box1.va());
box1.close();

Vec3Arg max = new Vec3(1f, 2f, 3f);
Vec3Arg min = new Vec3(4f, 5f, 6f);
AaBox box2 = new AaBox(min, max);
Assert.assertTrue(box2.hasAssignedNativeObject());
Assert.assertTrue(box2.ownsNativeObject());
Assert.assertNotEquals(0L, box2.va());
box2.close();
}

// JobSystemSingleThreaded:
{
JobSystem jobSystem
Expand All @@ -75,6 +95,10 @@ public void test003() {
Assert.assertTrue(jobSystem.hasAssignedNativeObject());
Assert.assertTrue(jobSystem.ownsNativeObject());
Assert.assertNotEquals(0L, jobSystem.va());

jobSystem.setNumThreads(3);
Assert.assertEquals(4, jobSystem.getMaxConcurrency());

jobSystem.close();
}
}
Expand Down

0 comments on commit 6c10330

Please sign in to comment.