2016-02-04 20:31:18 +00:00
|
|
|
package net_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2016-08-20 18:55:45 +00:00
|
|
|
. "v2ray.com/core/common/net"
|
|
|
|
"v2ray.com/core/testing/assert"
|
2016-02-04 20:31:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestTimeOutSettings(t *testing.T) {
|
2016-05-24 19:55:46 +00:00
|
|
|
assert := assert.On(t)
|
2016-02-04 20:31:18 +00:00
|
|
|
|
|
|
|
reader := NewTimeOutReader(8, nil)
|
2016-08-25 19:55:49 +00:00
|
|
|
assert.Uint32(reader.GetTimeOut()).Equals(8)
|
2016-02-04 20:31:18 +00:00
|
|
|
reader.SetTimeOut(8) // no op
|
2016-08-25 19:55:49 +00:00
|
|
|
assert.Uint32(reader.GetTimeOut()).Equals(8)
|
2016-02-04 20:31:18 +00:00
|
|
|
reader.SetTimeOut(9)
|
2016-08-25 19:55:49 +00:00
|
|
|
assert.Uint32(reader.GetTimeOut()).Equals(9)
|
2016-02-04 20:31:18 +00:00
|
|
|
}
|