Skip to content

Commit

Permalink
Test003: refactor to the new testClose() method
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jul 8, 2024
1 parent 167d27a commit 32082ba
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/test/java/testjoltjni/junit/Test003.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public void test003() {
Assert.assertTrue(jobSystem.hasAssignedNativeObject());
Assert.assertTrue(jobSystem.ownsNativeObject());
Assert.assertNotEquals(0L, jobSystem.va());
jobSystem.close();

testClose(jobSystem);
}

// JobSystemThreadPool:
Expand All @@ -99,7 +100,19 @@ public void test003() {
jobSystem.setNumThreads(3);
Assert.assertEquals(4, jobSystem.getMaxConcurrency());

jobSystem.close();
testClose(jobSystem);
}
// *************************************************************************
// Java private methods

/**
* Test the {@code close()} method of the specified object.
*
* @param object the object to test (not null)
*/
private static void testClose(JoltPhysicsObject object) {
object.close();
Assert.assertFalse(object.hasAssignedNativeObject());
Assert.assertFalse(object.ownsNativeObject());
}
}

0 comments on commit 32082ba

Please sign in to comment.