From a4cbf3e6c6d40cc0abe4da58db1ffc708ac78143 Mon Sep 17 00:00:00 2001 From: Antonis Geralis Date: Sun, 28 Aug 2022 11:43:26 +0300 Subject: [PATCH] minor --- drchaos.nimble | 4 ++-- drchaos/mutator.nim | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drchaos.nimble b/drchaos.nimble index f9934a9..b36717e 100644 --- a/drchaos.nimble +++ b/drchaos.nimble @@ -26,7 +26,7 @@ proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") = proc test(name: string, srcDir = "tests/", args = "", lang = "c") = buildBinary name, srcDir, "--mm:arc -d:release" 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": let examples = @["fuzz_graph"] @@ -36,7 +36,7 @@ task testDrChaosExamples, "Build & run Dr. Chaos examples": task testDrChaos, "Build & run Dr. Chaos tests": for filePath in listFiles("tests/"): if filePath[^4..^1] == ".nim": - test filePath[len("tests/")..^5], args = " -error_exitcode=0" + test filePath[len("tests/")..^5], args = "-error_exitcode=0" task testDrChaosNoCrash, "Build & run Dr. Chaos tests that should not crash": for filePath in listFiles("tests/no_crash/"): diff --git a/drchaos/mutator.nim b/drchaos/mutator.nim index 12bb857..39ff91e 100644 --- a/drchaos/mutator.nim +++ b/drchaos/mutator.nim @@ -63,7 +63,7 @@ proc mutateEnum*(index, itemCount: int; r: var Rand): int = if itemCount <= 1: 0 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). runMutator(result, sizeIncreaseHint, false, r)