Add unit tests for gov.nasa.jpf.util.FixedBitSet#596
Add unit tests for gov.nasa.jpf.util.FixedBitSet#596HritikRaj2 wants to merge 1 commit intojavapathfinder:masterfrom
Conversation
|
Hi Hritik, |
Hi @Mahmoud-Khawaja, thank you for pointing this out! You are completely right—I missed the existing BitSet64Test.java file and we definitely shouldn't fragment the test coverage. Looking at my PR, while the set, get, and clear tests are indeed redundant, I did add new test coverage for cardinality and toString. @cyrille-artho, would you prefer I port those two specific tests over to the existing BitSet64Test.java and update this PR, or is the current coverage sufficient, and I should just close this PR to keep the repo clean? |
Description
This PR adds a new test class
gov.nasa.jpf.test.util.FixedBitSetTestto improve test coverage for thegov.nasa.jpf.utilpackage.FixedBitSetis a critical interface for memory-efficient bit manipulation in JPF. Since it is an interface, these tests verify its contract using the concrete implementationBitSet64.Changes
src/tests/gov/nasa/jpf/test/util/FixedBitSetTest.javaTests Added
testBasicSetGet: Verifies setting specific bits and ensuring unset bits remain false.testClear: Ensures bits can be toggled off correctly.testCardinality: Verifies the count of set bits (population count).testToString: Checks that the string representation correctly lists set indices.Verification
./gradlew testBitSet64).Fixes #595