1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-12 15:27:16 -05:00
v2fly/proxy/socks/protocol/socks_fuzz_test.go

36 lines
624 B
Go
Raw Normal View History

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