1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-08-22 04:14:26 -04:00
v2fly/transport/internet/headers/wechat/wechat_test.go

25 lines
556 B
Go
Raw Normal View History

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