Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use nonduplication fuzzer when generating a decimal #6

Open
tpierrain opened this issue Jun 9, 2021 · 1 comment
Open

Do not use nonduplication fuzzer when generating a decimal #6

tpierrain opened this issue Jun 9, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@tpierrain
Copy link
Owner

Indeed, decimal generation relies on GenerateInteger between 1 and 16. This may throw very quickly exceptions such as:

Diverse.DuplicationException : Couldn't find a non-already provided value of System.Int32 after 100 attempts. Already provided values: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16. You can either:
- Generate a new specific fuzzer to ensure no duplication is provided for a sub-group of fuzzed values (anytime you want through the GenerateNoDuplicationFuzzer() method of your current Fuzzer instance. E.g.: var tempFuzzer = fuzzer.GenerateNoDuplicationFuzzer();)
- Increase the value of the MaxFailingAttemptsForNoDuplication property for your IFuzz instance.
   at Diverse.Fuzzer.GenerateWithoutDuplication[T](MethodBase currentMethod, Int32 argumentsHashCode, Int32 maxFailingAttemptsBeforeLastChanceFunctionIsCalled, Func`2 standardGenerationFunction, Func`3 lastChanceGenerationFunction)
   at Diverse.Fuzzer.GenerateInteger(Nullable`1 minValue, Nullable`1 maxValue)
   at Diverse.Numbers.NumberFuzzer.TakeAValueInBetweenOrARandomBound(Decimal minValue, Decimal maxValue)
   at Diverse.Numbers.NumberFuzzer.GenerateDecimal(Nullable`1 minValue, Nullable`1 maxValue)
   at Diverse.Fuzzer.GenerateDecimal(Nullable`1 minValue, Nullable`1 maxValue)
@tpierrain tpierrain added the bug Something isn't working label Jun 9, 2021
@tpierrain
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant