Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion db/seg/compress_fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func FuzzCompress(f *testing.F) {
if pos[i] == 0 {
continue
}
next := min(j+int(pos[i]*10), len(x)-1)
next := min(j+int(pos[i])*10, len(x)-1)
bbb := x[j:next]
a = append(a, bbb)
j = next
Expand Down
2 changes: 1 addition & 1 deletion db/seg/decompress_fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func FuzzDecompressMatch(f *testing.F) {
if pos[i] == 0 {
continue
}
next := min(j+int(pos[i]*10), len(x)-1)
next := min(j+int(pos[i])*10, len(x)-1)
bbb := x[j:next]
a = append(a, bbb)
j = next
Expand Down
3 changes: 3 additions & 0 deletions db/seg/patricia/patricia_fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ func FuzzLongestMatch(f *testing.F) {
if len(keys) == 0 {
return
}
// keys indexes the generated match data below, so map iteration order
// would make the same fuzz input build a different test string each run.
slices.Sort(keys)
var data []byte
for i := 0; i < 4*(len(test)/4); i += 4 {
keyIdx := int(binary.BigEndian.Uint32(test[i : i+4]))
Expand Down
Loading