tile38/vendor/github.com/streadway/amqp/read_test.go

27 lines
529 B
Go
Raw Normal View History

2017-03-15 20:45:35 +03:00
package amqp
import (
"strings"
"testing"
)
func TestGoFuzzCrashers(t *testing.T) {
if testing.Short() {
t.Skip("excessive allocation")
}
testData := []string{
"\b000000",
"\x02\x16\x10<31>[<5B><>\t\xbdui<75>" + "\x10\x01\x00\xff\xbf\xef\xbfサn\x99\x00\x10r",
"\x0300\x00\x00\x00\x040000",
}
for idx, testStr := range testData {
r := reader{strings.NewReader(testStr)}
frame, err := r.ReadFrame()
if err != nil && frame != nil {
t.Errorf("%d. frame is not nil: %#v err = %v", idx, frame, err)
}
}
}