• Kirill Smelkov's avatar
    fuzz: Export tests pickles to fuzz/corpus with stable filenames · 1e108391
    Kirill Smelkov authored
    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.
    1e108391
test-7002263a434ada349e393bd7c53dd27f941edd95.pickle 23 Bytes