mirror of https://bitbucket.org/ausocean/av.git
stream/mts/encoder.go: not doing scoped conditional in writePSI when calling updateMeta
This commit is contained in:
parent
6425403fcb
commit
dc46d9f0b2
stream/mts
|
@ -216,8 +216,8 @@ func (e *Encoder) writePSI() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = updateMeta(&pmtTable); err != nil {
|
||||
err = updateMeta(&pmtTable)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@ package meta
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"reflect"
|
||||
"testing"
|
||||
"encoding/binary"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -53,7 +53,6 @@ func TestAddAndGet(t *testing.T) {
|
|||
meta := New()
|
||||
meta.Add(tstKey1, tstData1)
|
||||
meta.Add(tstKey2, tstData2)
|
||||
errors.New("Trying to delete map entry that doesn't exist")
|
||||
if data, err := meta.Get(tstKey1); err != nil {
|
||||
t.Errorf("Could not get data for key: loc: %v", err.Error())
|
||||
if data != tstData1 {
|
||||
|
@ -139,13 +138,12 @@ func TestEncode(t *testing.T) {
|
|||
meta.Add(tstKey2, tstData2)
|
||||
|
||||
dataLen := len(tstKey1+tstData1+tstKey2+tstData2) + 3
|
||||
expectedOut := []byte{
|
||||
header := [4]byte{
|
||||
0x00,
|
||||
0x10,
|
||||
byte(dataLen >> 8),
|
||||
byte(dataLen),
|
||||
}
|
||||
expectedOut = append(expectedOut, []byte(
|
||||
binary.BigEndian.PutUint16(header[2:4],uint16(dataLen))
|
||||
expectedOut := append(header[:], []byte(
|
||||
tstKey1+"="+tstData1+"\t"+
|
||||
tstKey2+"="+tstData2)...)
|
||||
|
||||
|
|
Loading…
Reference in New Issue