mirror of https://bitbucket.org/ausocean/av.git
removing changes not relevant to this PR
This commit is contained in:
parent
1436d1f256
commit
474b3a324a
|
@ -91,10 +91,10 @@ var (
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bytes representing pmt with time1 and location1
|
// Bytes representing pmt with time1 and location1
|
||||||
pmtTimeLocBytes1 = buildPmtTimeLocBytes(locationTstStr1)
|
pmtTimeLocationBytes1 = buildPmtTimeLocationBytes(locationTstStr1)
|
||||||
|
|
||||||
// bytes representing pmt with with time1 and location 2
|
// bytes representing pmt with with time1 and location 2
|
||||||
pmtTimeLocBytes2 = buildPmtTimeLocBytes(locationTstStr2)
|
pmtTimeLocationBytes2 = buildPmtTimeLocationBytes(locationTstStr2)
|
||||||
)
|
)
|
||||||
|
|
||||||
// bytesTests contains data for testing the Bytes() funcs for the PSI data struct
|
// bytesTests contains data for testing the Bytes() funcs for the PSI data struct
|
||||||
|
@ -257,23 +257,23 @@ func TestLocationGet(t *testing.T) {
|
||||||
|
|
||||||
// TestLocationUpdate checks to see if we can update the location string in a pmt correctly
|
// TestLocationUpdate checks to see if we can update the location string in a pmt correctly
|
||||||
func TestLocationUpdate(t *testing.T) {
|
func TestLocationUpdate(t *testing.T) {
|
||||||
cpy := make([]byte, len(pmtTimeLocBytes1))
|
cpy := make([]byte, len(pmtTimeLocationBytes1))
|
||||||
copy(cpy, pmtTimeLocBytes1)
|
copy(cpy, pmtTimeLocationBytes1)
|
||||||
cpy = addCrc(cpy)
|
cpy = addCrc(cpy)
|
||||||
err := UpdateLocation(cpy, locationTstStr2)
|
err := UpdateLocation(cpy, locationTstStr2)
|
||||||
cpy = cpy[:len(cpy)-4]
|
cpy = cpy[:len(cpy)-4]
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Update time returned err: %v", err)
|
t.Errorf("Update time returned err: %v", err)
|
||||||
}
|
}
|
||||||
if !bytes.Equal(pmtTimeLocBytes2, cpy) {
|
if !bytes.Equal(pmtTimeLocationBytes2, cpy) {
|
||||||
t.Errorf(errCmp, "TestLocationUpdate", pmtTimeLocBytes2, cpy)
|
t.Errorf(errCmp, "TestLocationUpdate", pmtTimeLocationBytes2, cpy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// buildPmtTimeLocationBytes is a helper function to help construct the byte slices
|
// buildPmtTimeLocationBytes is a helper function to help construct the byte slices
|
||||||
// for pmts with time and location, as the location data field is 32 bytes, i.e. quite large
|
// for pmts with time and location, as the location data field is 32 bytes, i.e. quite large
|
||||||
// to type out
|
// to type out
|
||||||
func buildPmtTimeLocBytes(tstStr string) []byte {
|
func buildPmtTimeLocationBytes(tstStr string) []byte {
|
||||||
return append(append(append(make([]byte, 0), pmtTimeLocationBytesPart1...),
|
return append(append(append(make([]byte, 0), pmtTimeLocationBytesPart1...),
|
||||||
LocationStrBytes(tstStr)...), pmtTimeLocationBytesPart2...)
|
LocationStrBytes(tstStr)...), pmtTimeLocationBytesPart2...)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue