Browse Source

Add test for RTP round-tripping.

master
Juliusz Chroboczek 6 months ago
parent
commit
60fd410bff
1 changed files with 30 additions and 0 deletions
  1. +30
    -0
      rtp/rtp_test.go

+ 30
- 0
rtp/rtp_test.go View File

@ -0,0 +1,30 @@
package rtp_test
import (
"reflect"
"testing"
"github.com/jart/gosip/rtp"
)
func TestRTPRoundTrip(t *testing.T) {
h := rtp.Header{
Pad: false,
Mark: true,
PT: 42,
Seq: 1234,
TS: 567891234,
Ssrc: 6789,
}
b := h.Write(nil)
var h2 rtp.Header
err := h2.Read(b)
if err != nil {
t.Fatalf("Read RTP: %v", err)
}
if !reflect.DeepEqual(h, h2) {
t.Errorf("%#v != %#v", h2, h)
}
}

Loading…
Cancel
Save