Skip to content
Myr

Fuzz JSON parser

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Nicolas Williams · committed by Nicolas Williams · parent 243b1f8 · Browse files · 1 file+15 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+15 added−0 removed

  • tests:+15 added−0 removed

1 file+15 added−0 removed

modified:tests/run+15 added
121 unmodified lines
122$VALGRIND $Q ./jq -c '. as $d|path(..) as $p|$d|getpath($p)|scalars_or_empty|[$p,.]' < "$PWD/tests/torture/input0.json" > $d/out0123$VALGRIND $Q ./jq --stream -c '.|select(length==2)' < "$PWD/tests/torture/input0.json" > $d/out1124diff $d/out0 $d/out1125126## Fuzz parser127128if dd if=/dev/urandom bs=16 count=1024 > $d/rand 2>/dev/null; then129 # Have a /dev/urandom, good130 set -x131 $VALGRIND $Q ./jq --seq . $d/rand >/dev/null 2>&1132 $VALGRIND $Q ./jq --seq --stream . $d/rand >/dev/null 2>&1133 dd if=/dev/urandom bs=16 count=1024 > $d/rand 2>/dev/null134 $VALGRIND $Q ./jq --seq . $d/rand >/dev/null 2>&1135 $VALGRIND $Q ./jq --seq --stream . $d/rand >/dev/null 2>&1136 dd if=/dev/urandom bs=16 count=1024 > $d/rand 2>/dev/null137 $VALGRIND $Q ./jq --seq . $d/rand >/dev/null 2>&1138 $VALGRIND $Q ./jq --seq --stream . $d/rand >/dev/null 2>&1139fi140141## Test library/module system142143mods=$PWD/tests/modules144
60 unmodified lines