Add test for corrupted LZ4 block input stream by Marcono1234 · Pull Request #7 · yawkat/lz4-java

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this because the previous implementation was quite error-prone: It looks like all test methods in this class used the same LZ4BlockStreamingTest instance, and therefore also the same preInitializedBuilder. Therefore tests could affect each other if they forgot to overwrite / reset all builder configurations.

This happened to me while adding this new test, and due to the usage of randomizedtesting it made the resulting test failures even non-deterministic (unless you reran with the same seed I guess?).

An alternative might be to configure this test to create a new LZ4BlockStreamingTest per test method / test execution (in case that is possible).