mirror of
https://github.com/pion/stun.git
synced 2025-10-06 16:26:59 +08:00
attr: improve coverage
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
|||||||
//"encoding/binary"
|
//"encoding/binary"
|
||||||
|
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMessage_AddSoftware(t *testing.T) {
|
func TestMessage_AddSoftware(t *testing.T) {
|
||||||
@@ -26,6 +27,12 @@ func TestMessage_AddSoftware(t *testing.T) {
|
|||||||
if vRead != v {
|
if vRead != v {
|
||||||
t.Errorf("Expected %s, got %s.", v, vRead)
|
t.Errorf("Expected %s, got %s.", v, vRead)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sAttr := m.Attributes.Get(AttrSoftware)
|
||||||
|
s := sAttr.String()
|
||||||
|
if !strings.HasPrefix(s, "SOFTWARE:") {
|
||||||
|
t.Error("bad string representation", s)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMessage_AddSoftwareBytes(t *testing.T) {
|
func TestMessage_AddSoftwareBytes(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user