File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -116,13 +116,15 @@ func TestParseRecord(t *testing.T) {
116116 }
117117}
118118
119+ // FuzzParseTree tests that ParseTree never crashes
119120func FuzzParseTree (f * testing.F ) {
120121 f .Add ([]byte ("go.sum database tree\n 123456789012\n TszzRgjTG6xce+z2AG31kAXYKBgQVtCSCE40HmuwBb0=\n " ))
121122 f .Fuzz (func (t * testing.T , text []byte ) {
122123 ParseTree (text )
123124 })
124125}
125126
127+ // FuzzParseRecord tests that ParseRecord never crashes
126128func FuzzParseRecord (f * testing.F ) {
127129 f .Add ([]byte ("12345\n hello\n \n " ))
128130 f .Fuzz (func (t * testing.T , msg []byte ) {
Original file line number Diff line number Diff line change 1+ // Copyright 2019 The Go Authors. All rights reserved.
2+ // Use of this source code is governed by a BSD-style
3+ // license that can be found in the LICENSE file.
4+
5+ package tlog
6+
7+ import (
8+ "testing"
9+ )
10+
11+ // FuzzParseTilePath tests that ParseTilePath never crashes
12+ func FuzzParseTilePath (f * testing.F ) {
13+ f .Add ("tile/4/0/001" )
14+ f .Add ("tile/4/0/001.p/5" )
15+ f .Add ("tile/3/5/x123/x456/078" )
16+ f .Add ("tile/3/5/x123/x456/078.p/2" )
17+ f .Add ("tile/1/0/x003/x057/500" )
18+ f .Add ("tile/3/5/123/456/078" )
19+ f .Add ("tile/3/-1/123/456/078" )
20+ f .Add ("tile/1/data/x003/x057/500" )
21+ f .Fuzz (func (t * testing.T , path string ) {
22+ ParseTilePath (path )
23+ })
24+ }
You can’t perform that action at this time.
0 commit comments