Skip to content

Do not use nonduplication fuzzer when generating a decimal #6

@tpierrain

Description

@tpierrain

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions