diff options
author | Nicolas Williams <nico@cryptonector.com> | 2014-12-26 19:31:47 -0600 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2014-12-26 23:05:57 -0600 |
commit | 845ad5e96909ce8111933c8a12e63ac09c77d31e (patch) | |
tree | 671d2eb1c2f3e41b9adc610630ae9f1c59db47d2 | |
parent | 243b1f8e5e370d7b6f494346ef1477e73480f1a9 (diff) |
Fuzz JSON parser
-rwxr-xr-x | tests/run | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -123,6 +123,21 @@ $VALGRIND $Q ./jq -c '. as $d|path(..) as $p|$d|getpath($p)|scalars_or_empty|[$p $VALGRIND $Q ./jq --stream -c '.|select(length==2)' < "$PWD/tests/torture/input0.json" > $d/out1 diff $d/out0 $d/out1 +## Fuzz parser + +if dd if=/dev/urandom bs=16 count=1024 > $d/rand 2>/dev/null; then + # Have a /dev/urandom, good + set -x + $VALGRIND $Q ./jq --seq . $d/rand >/dev/null 2>&1 + $VALGRIND $Q ./jq --seq --stream . $d/rand >/dev/null 2>&1 + dd if=/dev/urandom bs=16 count=1024 > $d/rand 2>/dev/null + $VALGRIND $Q ./jq --seq . $d/rand >/dev/null 2>&1 + $VALGRIND $Q ./jq --seq --stream . $d/rand >/dev/null 2>&1 + dd if=/dev/urandom bs=16 count=1024 > $d/rand 2>/dev/null + $VALGRIND $Q ./jq --seq . $d/rand >/dev/null 2>&1 + $VALGRIND $Q ./jq --seq --stream . $d/rand >/dev/null 2>&1 +fi + ## Test library/module system mods=$PWD/tests/modules |