This commit is contained in:
Antonis Geralis 2022-08-28 11:43:26 +03:00
parent 6992d6819c
commit a4cbf3e6c6
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
proc test(name: string, srcDir = "tests/", args = "", lang = "c") = proc test(name: string, srcDir = "tests/", args = "", lang = "c") =
buildBinary name, srcDir, "--mm:arc -d:release" buildBinary name, srcDir, "--mm:arc -d:release"
withDir("build/"): withDir("build/"):
exec "./" & name & " -max_total_time=3 -runs=10000" & args exec "./" & name & " -max_total_time=1 -runs=10000 " & args
task testDrChaosExamples, "Build & run Dr. Chaos examples": task testDrChaosExamples, "Build & run Dr. Chaos examples":
let examples = @["fuzz_graph"] let examples = @["fuzz_graph"]

View File

@ -63,7 +63,7 @@ proc mutateEnum*(index, itemCount: int; r: var Rand): int =
if itemCount <= 1: 0 if itemCount <= 1: 0
else: (index + 1 + r.rand(itemCount - 1)) mod itemCount else: (index + 1 + r.rand(itemCount - 1)) mod itemCount
proc newInput*[T](sizeIncreaseHint: int; r: var Rand): T = proc newInput*[T](sizeIncreaseHint: Natural; r: var Rand): T =
## Creates new input with a chance of returning default(T). ## Creates new input with a chance of returning default(T).
runMutator(result, sizeIncreaseHint, false, r) runMutator(result, sizeIncreaseHint, false, r)