File: usecandidate_test.go

package info (click to toggle)
golang-github-pion-ice.v2 2.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 684 kB
  • sloc: makefile: 5
file content (24 lines) | stat: -rw-r--r-- 436 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package ice

import (
	"testing"

	"github.com/pion/stun"
)

func TestUseCandidateAttr_AddTo(t *testing.T) {
	m := new(stun.Message)
	if UseCandidate().IsSet(m) {
		t.Error("should not be set")
	}
	if err := m.Build(stun.BindingRequest, UseCandidate()); err != nil {
		t.Error(err)
	}
	m1 := new(stun.Message)
	if _, err := m1.Write(m.Raw); err != nil {
		t.Error(err)
	}
	if !UseCandidate().IsSet(m1) {
		t.Error("should be set")
	}
}