rewrite fuzz tests of decoders in order to get deterministic results (#261)

This commit is contained in:
Alessandro Ros
2023-04-26 12:30:51 +02:00
committed by GitHub
parent d6a55f882a
commit d56ae1f600
63 changed files with 192 additions and 99 deletions

View File

@@ -1,3 +0,0 @@
go test fuzz v1
[]byte("0")
bool(false)

View File

@@ -0,0 +1,5 @@
go test fuzz v1
[]byte("0\x00\x00\x00\x01\xff000\x00\x00@000000000000000000000000000000000000000000000000000000000000000000")
bool(true)
[]byte("0000\x01\xff000000000000000000000000000000000000000000000000000000000000000000000000")
bool(true)

View File

@@ -1,3 +0,0 @@
go test fuzz v1
[]byte("0\x00\x00\x00\x01\xff000\x00\x00@0000000000000000000000000000000000000000000000000000000000000000")
bool(true)

View File

@@ -1,3 +1,5 @@
go test fuzz v1
[]byte("0")
bool(false)
[]byte("0\x00\x00\x00\x01\xff00")
bool(false)

View File

@@ -0,0 +1,5 @@
go test fuzz v1
[]byte("")
bool(true)
[]byte("")
bool(false)

View File

@@ -1,3 +0,0 @@
go test fuzz v1
[]byte("0000\x01\xff00000000000000000000000000000000000000000000000000000000000000000000000")
bool(true)

View File

@@ -1,3 +0,0 @@
go test fuzz v1
[]byte("0000\x01\xff00")
bool(false)

View File

@@ -0,0 +1,5 @@
go test fuzz v1
[]byte("0\x00\x00\x00\x01\xff000\x00\x00\x8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
bool(false)
[]byte("0000\x01\xff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
bool(false)

View File

@@ -0,0 +1,5 @@
go test fuzz v1
[]byte("0")
bool(true)
[]byte("0\x00\x00\x00\x01\xff000\x00\x00\x8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
bool(true)

View File

@@ -1,3 +0,0 @@
go test fuzz v1
[]byte("0000\x01\xff00000000000000000000000000000000000000000000000000000000000000000000000")
bool(false)