mirror of https://bitbucket.org/ausocean/av.git
Merged in remove-timefrom (pull request #407)
container/mts/psi/helpers.go: removed TimeFrom and usage in psi_test.go
This commit is contained in:
commit
3f7306f2a8
|
@ -75,17 +75,6 @@ func SyntaxSecLenFrom(p []byte) int {
|
||||||
return int(((p[SyntaxSecLenIdx1] & SyntaxSecLenMask1) << 8) | p[SyntaxSecLenIdx2])
|
return int(((p[SyntaxSecLenIdx1] & SyntaxSecLenMask1) << 8) | p[SyntaxSecLenIdx2])
|
||||||
}
|
}
|
||||||
|
|
||||||
// TimeFrom takes a byte slice representation of a psi-pmt and extracts it's
|
|
||||||
// timestamp, returning as a uint64 if it exists, otherwise returning 0 and nil
|
|
||||||
// if it does not exist
|
|
||||||
func TimeFrom(p []byte) (t uint64, err error) {
|
|
||||||
if !HasTime(p) {
|
|
||||||
return 0, errors.New("pmt does not have a time descriptor")
|
|
||||||
}
|
|
||||||
t = binary.BigEndian.Uint64(p[TimeDataIndx : TimeDataIndx+TimeDataSize])
|
|
||||||
return t, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// LocationFrom takes a byte slice representation of a psi-pmt and extracts it's
|
// LocationFrom takes a byte slice representation of a psi-pmt and extracts it's
|
||||||
// timestamp, returning as a uint64 if it exists, otherwise returning 0 and nil
|
// timestamp, returning as a uint64 if it exists, otherwise returning 0 and nil
|
||||||
// if it does not exist
|
// if it does not exist
|
||||||
|
|
|
@ -313,17 +313,6 @@ func TestTimeUpdate(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestTimeGet tsts to see if we can correctly get the timestamp from a pmt
|
|
||||||
func TestTimeGet(t *testing.T) {
|
|
||||||
s, err := TimeFrom(pmtTimeBytes1)
|
|
||||||
if err != nil {
|
|
||||||
t.Errorf("Getting timestamp failed with err: %v", err)
|
|
||||||
}
|
|
||||||
if s != tstTime1 {
|
|
||||||
t.Errorf(errCmp, "TestTimeGet", tstTime1, s)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TestLocationGet checks that we can correctly get location data from a pmt table
|
// TestLocationGet checks that we can correctly get location data from a pmt table
|
||||||
func TestLocationGet(t *testing.T) {
|
func TestLocationGet(t *testing.T) {
|
||||||
pb := standardPmtWithMeta.Bytes()
|
pb := standardPmtWithMeta.Bytes()
|
||||||
|
|
Loading…
Reference in New Issue