v2ray-core/proxy/socks/protocol/socks_fuzz_test.go

36 lines
624 B
Go
Raw Normal View History

2015-11-09 22:52:31 +00:00
package protocol
import (
"testing"
2015-11-10 11:13:01 +00:00
"github.com/v2ray/v2ray-core/testing/fuzzing"
2015-11-09 22:52:31 +00:00
)
const (
Iterations = int(500000)
)
func TestReadAuthentication(t *testing.T) {
for i := 0; i < Iterations; i++ {
2015-11-10 11:13:01 +00:00
ReadAuthentication(fuzzing.RandomReader())
2015-11-09 22:52:31 +00:00
}
}
func TestReadUserPassRequest(t *testing.T) {
for i := 0; i < Iterations; i++ {
2015-11-10 11:13:01 +00:00
ReadUserPassRequest(fuzzing.RandomReader())
2015-11-09 22:52:31 +00:00
}
}
func TestReadRequest(t *testing.T) {
for i := 0; i < Iterations; i++ {
2015-11-10 11:13:01 +00:00
ReadRequest(fuzzing.RandomReader())
2015-11-09 22:52:31 +00:00
}
}
2015-11-10 17:16:13 +00:00
func TestReadUDPRequest(t *testing.T) {
for i := 0; i < Iterations; i++ {
ReadUDPRequest(fuzzing.RandomBytes())
}
}