2017-01-03 22:46:22 +01:00
|
|
|
package wechat_test
|
|
|
|
|
|
|
|
|
|
import (
|
2017-12-16 23:31:05 +01:00
|
|
|
"context"
|
2017-01-03 22:46:22 +01:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
"v2ray.com/core/common/buf"
|
|
|
|
|
. "v2ray.com/core/transport/internet/headers/wechat"
|
2017-10-26 21:44:22 +02:00
|
|
|
. "v2ray.com/ext/assert"
|
2017-01-03 22:46:22 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestUTPWrite(t *testing.T) {
|
2017-10-24 16:15:35 +02:00
|
|
|
assert := With(t)
|
2017-01-03 22:46:22 +01:00
|
|
|
|
2017-12-16 23:31:05 +01:00
|
|
|
videoRaw, err := NewVideoChat(context.Background(), &VideoConfig{})
|
|
|
|
|
assert(err, IsNil)
|
|
|
|
|
|
|
|
|
|
video := videoRaw.(*VideoChat)
|
2017-01-03 22:46:22 +01:00
|
|
|
|
|
|
|
|
payload := buf.NewLocal(2048)
|
|
|
|
|
payload.AppendSupplier(video.Write)
|
|
|
|
|
|
2017-10-24 16:15:35 +02:00
|
|
|
assert(payload.Len(), Equals, video.Size())
|
2017-01-03 22:46:22 +01:00
|
|
|
}
|