-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fuzz): ability to declare fuzz test fixtures (#7428)
* fix(fuzz): deduplicate fuzz inputs * Fix tests, collect fixtures in test setup, arc fixtures * Cleanup * Use fixture_ prefix * Update tests to reflect that random values are used if no fixtures * Review changes * Group fuzz_calldata and fuzz_calldata_from_state in calldata mod * Review changes: remove unnecessary clones, nicer code to collect fixtures * Add support for bytes and string fixtures, fixture strategy macro. Solidity test * Remove unnecessary clone * Use inline config * More robust invariant assume test - previously rejecting when param was 0 (vm.assume(param != 0)) that is param should have been fuzzed twice with 0 in a run - with fuzz input deduplication is now harder to occur, changed rejected if param is not 0 (vm.assume(param != 0)) and narrow down to one run and just 10 depth * Fixtures as storage arrays, remove inline config * Simplify code * Support fixed size arrays fixtures * Update comment * Use DynSolValue::type_strategy for address and fixed bytes fuzzed params * Add prefix to mark a storage array or a function as fixture * Fix test * Simplify code / fixture strategy macro, panic if configured fixture not of param type * Consistent panic with fixture strategy if uint / int fixture of different type. Keep level of randomness in fixture strategy, at par with uint / int strategies. * Review changes: don't panic when invalid fixture, use prop_filter_map for fixture strategy and raise error
- Loading branch information
Showing
24 changed files
with
568 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.