streaming

Media streaming and broadcast systems in Go
Log | Files | Refs | README | LICENSE

pts_test.go (347B)


      1 package scte35
      2 
      3 import (
      4 	"testing"
      5 )
      6 
      7 func TestPTS(t *testing.T) {
      8 	ticks := uint64(8589934591) // max 33-bit uint
      9 	buf := make([]byte, 5)
     10 	putPTS(buf, ticks)
     11 	want := [5]byte{
     12 		0x01,
     13 		0xff,
     14 		0xff,
     15 		0xff,
     16 		0xff,
     17 	}
     18 	var got [5]byte
     19 	copy(got[:], buf)
     20 	if want != got {
     21 		t.Errorf("putPTS(buf, %d); want %#x, got %#x", ticks, want, got)
     22 	}
     23 }