removing changes not relevant to this PR

This commit is contained in:
Saxon Milton 2019-01-03 02:08:55 +00:00
parent 1436d1f256
commit 474b3a324a
1 changed files with 7 additions and 7 deletions

View File

@ -91,10 +91,10 @@ var (
}
// Bytes representing pmt with time1 and location1
pmtTimeLocBytes1 = buildPmtTimeLocBytes(locationTstStr1)
pmtTimeLocationBytes1 = buildPmtTimeLocationBytes(locationTstStr1)
// 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
@ -257,23 +257,23 @@ func TestLocationGet(t *testing.T) {
// TestLocationUpdate checks to see if we can update the location string in a pmt correctly
func TestLocationUpdate(t *testing.T) {
cpy := make([]byte, len(pmtTimeLocBytes1))
copy(cpy, pmtTimeLocBytes1)
cpy := make([]byte, len(pmtTimeLocationBytes1))
copy(cpy, pmtTimeLocationBytes1)
cpy = addCrc(cpy)
err := UpdateLocation(cpy, locationTstStr2)
cpy = cpy[:len(cpy)-4]
if err != nil {
t.Errorf("Update time returned err: %v", err)
}
if !bytes.Equal(pmtTimeLocBytes2, cpy) {
t.Errorf(errCmp, "TestLocationUpdate", pmtTimeLocBytes2, cpy)
if !bytes.Equal(pmtTimeLocationBytes2, cpy) {
t.Errorf(errCmp, "TestLocationUpdate", pmtTimeLocationBytes2, cpy)
}
}
// 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
// to type out
func buildPmtTimeLocBytes(tstStr string) []byte {
func buildPmtTimeLocationBytes(tstStr string) []byte {
return append(append(append(make([]byte, 0), pmtTimeLocationBytesPart1...),
LocationStrBytes(tstStr)...), pmtTimeLocationBytesPart2...)
}