-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathaccept_test.go
28 lines (25 loc) · 1.14 KB
/
accept_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2011, Shelby Ramsey. All rights reserved.
// Copyright 2018, Eugen Biegler. All rights reserved.
// Use of this code is governed by a BSD license that can be
// found in the LICENSE.txt file.
package sipparser
// Imports from the go standard library
/* // TestAccept tests the accept header and parsing functions
func TestAccept(t *testing.T) {
sm := &SipMsg{}
s := "application/sdp"
sm.parseAccept(s)
if sm.Accept.Val != "application/sdp" {
t.Errorf("[TestAccept] Error parsing accept hdr: application/sdp. sm.Accept.Val should be application/sdp but received: " + sm.Accept.Val)
}
if len(sm.Accept.Params) != 1 {
t.Errorf("[TestAccept] Error parsing accept hdr: application/sdp. sm.Accept.Params should have length of 1.")
}
if sm.Accept.Params[0].Type != "application" {
t.Errorf("[TestAccept] Error parsing accept hdr: application/sdp. sm.Accept.Params[0].Type should be \"application\". Received: %q", sm.Accept.Params[0].Type)
}
if sm.Accept.Params[0].Val != "sdp" {
t.Errorf("[TestAccept] Error parsing accept hdr: application/sdp. sm.Accept.Params[0].Val should be \"sdp\" but received: %q", sm.Accept.Params[0].Val)
}
}
*/