Skip to content

Improved property tests with null examples that reveals bugs#3

Open
luisggpina wants to merge 1 commit intodragan-ivanovic:masterfrom
bitslab:master
Open

Improved property tests with null examples that reveals bugs#3
luisggpina wants to merge 1 commit intodragan-ivanovic:masterfrom
bitslab:master

Conversation

@luisggpina
Copy link

Hi!

In an effort to improve the coverage of the property tests, I improved the existing property tests to test null handling and found some bugs:

  • testInsertion adds a bunch of keys mapping to null that cause a NullPointerException when balancing the tree:
Caused by: java.lang.NullPointerException                                                                 
        at org.cellx.logish.IntMap$Node.balanceLeft(IntMap.java:614)                                                                                                                                                
        at org.cellx.logish.IntMap$Node.without(IntMap.java:686)                                                                                                                                                    
        at org.cellx.logish.IntMap$Node.with(IntMap.java:641)                                                                                                                                                       
        at org.cellx.logish.IntMap.withAll(IntMap.java:338)                                                                                                                                                         
        at org.cellx.logishTest.IntMapTests.testInsertion(IntMapTests.java:26)    
  • testDeletion attempts to delete keys from an empty map, which also causes NullPointerException as the delete operation sometimes returns an empty map and other times returns null:
Caused by: java.lang.NullPointerException                                                                 
        at org.cellx.logishTest.IntMapTests.testDeletion(IntMapTests.java:48)   

More info on how to replicate these issues:

[ERROR] Failures:                                                                                         
[ERROR]   IntMapTests.testDeletion Unexpected error in property testDeletion with args [[15]] and seeds [6787329991909443937]                                                                                       
[ERROR]   IntMapTests.testInsertion Unexpected error in property testInsertion with args [[83]] and seeds [3090420391447367513]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant