handle hex session id

This commit is contained in:
ShiBen
2022-03-30 15:46:05 +08:00
committed by Alessandro Ros
parent e292718307
commit 6b0f7b84bb
2 changed files with 68 additions and 3 deletions

View File

@@ -1382,6 +1382,68 @@ var cases = []struct {
},
},
},
{
"hex session id for 0XAC4EC96E",
[]byte("v=0\r\n" +
"o=jdoe 0XAC4EC96E 2890842807 IN IP4 10.47.16.5\r\n" +
"s=SDP Seminar\r\n" +
"i=A Seminar on the session description protocol\r\n" +
"t=3034423619 3042462419\r\n"),
[]byte("v=0\r\n" +
"o=jdoe 2890844526 2890842807 IN IP4 10.47.16.5\r\n" +
"s=SDP Seminar\r\n" +
"i=A Seminar on the session description protocol\r\n" +
"t=3034423619 3042462419\r\n"),
SessionDescription{
Origin: psdp.Origin{
Username: "jdoe",
SessionID: 2890844526,
SessionVersion: 2890842807,
NetworkType: "IN",
AddressType: "IP4",
UnicastAddress: "10.47.16.5",
},
SessionName: "SDP Seminar",
SessionInformation: func() *psdp.Information {
v := psdp.Information("A Seminar on the session description protocol")
return &v
}(),
TimeDescriptions: []psdp.TimeDescription{
{psdp.Timing{3034423619, 3042462419}, nil},
},
},
},
{
"hex session id for 103bdb6f",
[]byte("v=0\r\n" +
"o=jdoe 103bdb6f 2890842807 IN IP4 10.47.16.5\r\n" +
"s=SDP Seminar\r\n" +
"i=A Seminar on the session description protocol\r\n" +
"t=3034423619 3042462419\r\n"),
[]byte("v=0\r\n" +
"o=jdoe 272358255 2890842807 IN IP4 10.47.16.5\r\n" +
"s=SDP Seminar\r\n" +
"i=A Seminar on the session description protocol\r\n" +
"t=3034423619 3042462419\r\n"),
SessionDescription{
Origin: psdp.Origin{
Username: "jdoe",
SessionID: 272358255,
SessionVersion: 2890842807,
NetworkType: "IN",
AddressType: "IP4",
UnicastAddress: "10.47.16.5",
},
SessionName: "SDP Seminar",
SessionInformation: func() *psdp.Information {
v := psdp.Information("A Seminar on the session description protocol")
return &v
}(),
TimeDescriptions: []psdp.TimeDescription{
{psdp.Timing{3034423619, 3042462419}, nil},
},
},
},
}
func TestUnmarshal(t *testing.T) {