1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-30 19:15:23 +00:00
v2fly/transport/internet/headers/wechat/wechat_test.go

25 lines
508 B
Go
Raw Normal View History

2017-01-03 21:46:22 +00:00
package wechat_test
import (
2017-12-16 22:31:05 +00:00
"context"
2017-01-03 21:46:22 +00:00
"testing"
2019-01-31 19:57:01 +00:00
"v2ray.com/core/common"
2017-01-03 21:46:22 +00:00
"v2ray.com/core/common/buf"
. "v2ray.com/core/transport/internet/headers/wechat"
)
func TestUTPWrite(t *testing.T) {
2017-12-16 22:31:05 +00:00
videoRaw, err := NewVideoChat(context.Background(), &VideoConfig{})
2019-01-31 19:57:01 +00:00
common.Must(err)
2017-12-16 22:31:05 +00:00
video := videoRaw.(*VideoChat)
2017-01-03 21:46:22 +00:00
2018-03-11 22:45:24 +00:00
payload := buf.New()
2018-11-02 20:34:04 +00:00
video.Serialize(payload.Extend(video.Size()))
2017-01-03 21:46:22 +00:00
2019-01-31 19:57:01 +00:00
if payload.Len() != video.Size() {
t.Error("expected payload size ", video.Size(), " but got ", payload.Len())
}
2017-01-03 21:46:22 +00:00
}