2021-02-14 18:27:32 +00:00
|
|
|
import pixie/common, pixie/fileformats/svg, random, strformat
|
2020-12-04 18:13:01 +00:00
|
|
|
|
|
|
|
randomize()
|
|
|
|
|
2021-10-03 22:49:21 +00:00
|
|
|
let original = readFile("tests/fileformats/svg/Ghostscript_Tiger.svg")
|
2020-12-04 18:13:01 +00:00
|
|
|
|
|
|
|
for i in 0 ..< 10_000:
|
|
|
|
var data = original
|
|
|
|
let
|
|
|
|
pos = rand(data.len)
|
|
|
|
value = rand(255).char
|
|
|
|
data[pos] = value
|
|
|
|
echo &"{i} {pos} {value}"
|
|
|
|
try:
|
|
|
|
discard decodeSvg(data)
|
|
|
|
except PixieError:
|
|
|
|
discard
|