diff --git a/checksum_test.go b/checksum_test.go new file mode 100644 index 0000000..ecadf32 --- /dev/null +++ b/checksum_test.go @@ -0,0 +1,14 @@ + +package ts + +import ( + "testing" +) + +func TestChecksum(t *testing.T) { + b := []byte("hello world") + b = append(b, []byte{0xbb,0x08,0xec,0x87}...) + crc := updateIeeeCrc32(0xffffffff, b) + t.Logf("%x", crc) +} + diff --git a/writer_test.go b/writer_test.go new file mode 100644 index 0000000..3439b87 --- /dev/null +++ b/writer_test.go @@ -0,0 +1,19 @@ + +package ts + +import ( + "testing" + "encoding/hex" + "bytes" +) + +func TestWriteTSHeader(t *testing.T) { + bw := &bytes.Buffer{} + w := &TSWriter{ + W: bw, + PCR: 0x12345678, + } + w.Write([]byte{'h','e','l','o'}[:], false) + t.Logf("\n%s", hex.Dump(bw.Bytes())) +} +