Commit 1e108391 authored by Kirill Smelkov's avatar Kirill Smelkov

fuzz: Export tests pickles to fuzz/corpus with stable filenames

In 9d1344ba (fuzz: Automatically export all tests pickles into
fuzz/corpus) I added code that automatically exports all test pickles
to fuzz corpus, so that fuzzing starts from all the tricky cases we
already put into tests. However exported files were named as
test-i-j.pickle, where i is sequential number of test entry in global
test vector. This way if we insert some new entry in the middle, or
change entries order it causes lots of renaming inside fuzz/corpus/ on
next `go generate`.

-> Fix that by emitting vectors as test-<sha1-of-pickle>.pickle so that
file name depends only on pickle content are remains stable
independently of entry position in the list of tests.

Besides changes to fuzz_test.go this patch brings:

1) rm fuzz/corpus/test-*.pickle
2) `go generate`

The result inside fuzz/corpus/ is pure renaming + removal of duplicates.
For example test-15-4.pickle is removed because the same data was in test-14-4.pickle
and now resides in test-ee4459c0c165c4cbc3672ee5ef5438e00121b229.pickle.
parent 72a53b61
(lp0
I1
aI2
aI3
aI01
a.
\ No newline at end of file
S'abc'
p0
.
\ No newline at end of file
S'abc'
.
\ No newline at end of file
(dp0
.
\ No newline at end of file
(a1b2d.
\ No newline at end of file
(dS'a'
S'1'
sS'b'
S'2'
s.
\ No newline at end of file
}(UaU1UbU2u.
\ No newline at end of file
(dp0
S'a'
p1
S'1'
p2
sS'b'
p3
S'2'
p4
s.
\ No newline at end of file
(UaU1d.
\ No newline at end of file
(ŒaŒ1d.
\ No newline at end of file
(UaU1UbU2d.
\ No newline at end of file
(a1b2d.
\ No newline at end of file
(dS'a'
S'1'
sS'b'
S'2'
s.
\ No newline at end of file
}(UaU1UbU2u.
\ No newline at end of file
(dp0
S'a'
p1
S'1'
p2
sS'b'
p3
S'2'
p4
s.
\ No newline at end of file
ŒfooŒbar“.
\ No newline at end of file
S'foo'
S'bar'
.
\ No newline at end of file
abcQ.
\ No newline at end of file
abcQ.
\ No newline at end of file
abc
dQ.
\ No newline at end of file
((FooQuxBarKdl.
\ No newline at end of file
((UFooUQuxUBarKdl.
\ No newline at end of file
((FooQuxBarKdl.
\ No newline at end of file
K.
\ No newline at end of file
I1
.
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment