4 Star 22 Fork 8

北京小程科技有限公司 / SDP协议

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
media_info_test.go 559 Bytes
一键复制 编辑 原始数据 按行查看 历史
shallot 提交于 2020-04-05 10:41 . 添加SDP协议的内容解析。
package sdp
import (
"fmt"
"testing"
)
func TestMediaInfo(t *testing.T) {
tests := []struct {
item string
wantErr bool
}{
{"audio 19998 RTP/AVP 0 101", false},
{"video 0 RTP/AVP 96", false},
}
for i, tt := range tests {
t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
mi, err := parseMediaInfo(tt.item)
if (err != nil) != tt.wantErr {
t.Errorf("MediaInfo error = %v, wantErr %v", err, tt.wantErr)
}
if str := mi.String(); str != tt.item {
t.Errorf("MediaInfo string = %v, wantString %v", str, tt.item)
}
})
}
}
Go
1
https://gitee.com/xiaochengtech/sdp.git
git@gitee.com:xiaochengtech/sdp.git
xiaochengtech
sdp
SDP协议
master

搜索帮助