mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
624 B
36 lines
624 B
package protocol
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/v2ray/v2ray-core/testing/fuzzing"
|
|
)
|
|
|
|
const (
|
|
Iterations = int(500000)
|
|
)
|
|
|
|
func TestReadAuthentication(t *testing.T) {
|
|
for i := 0; i < Iterations; i++ {
|
|
ReadAuthentication(fuzzing.RandomReader())
|
|
}
|
|
}
|
|
|
|
func TestReadUserPassRequest(t *testing.T) {
|
|
for i := 0; i < Iterations; i++ {
|
|
ReadUserPassRequest(fuzzing.RandomReader())
|
|
}
|
|
}
|
|
|
|
func TestReadRequest(t *testing.T) {
|
|
for i := 0; i < Iterations; i++ {
|
|
ReadRequest(fuzzing.RandomReader())
|
|
}
|
|
}
|
|
|
|
func TestReadUDPRequest(t *testing.T) {
|
|
for i := 0; i < Iterations; i++ {
|
|
ReadUDPRequest(fuzzing.RandomBytes())
|
|
}
|
|
}
|