Skip to content

Commit

Permalink
fix phc tests on s390x (#403)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #403

Endianness!

Reviewed By: deathowl

Differential Revision: D64329908

fbshipit-source-id: 23e2edf9772f0380b92655d49d6322fa03a40bcf
  • Loading branch information
abulimov authored and facebook-github-bot committed Oct 14, 2024
1 parent 9fbb455 commit d05503d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions phc/pps_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"testing"
"time"

"github.com/facebook/time/hostendian"
"github.com/facebook/time/servo"

"github.com/golang/mock/gomock"
Expand Down Expand Up @@ -547,7 +548,7 @@ func TestPPSSink_getPPSEventTimestamp(t *testing.T) {

mockDevice.EXPECT().Read(gomock.Any()).Return(1, nil).Do(func(buf []byte) {
var intBuffer bytes.Buffer
err := binary.Write(&intBuffer, binary.LittleEndian, &event)
err := binary.Write(&intBuffer, hostendian.Order, &event)
require.NoError(t, err)
copy(buf, intBuffer.Bytes())
fmt.Print(buf)
Expand Down Expand Up @@ -580,7 +581,7 @@ func TestPPSSink_getPPSEventTimestamp(t *testing.T) {

mockDevice.EXPECT().Read(gomock.Any()).Return(1, nil).Do(func(buf []byte) {
var intBuffer bytes.Buffer
err := binary.Write(&intBuffer, binary.LittleEndian, &event)
err := binary.Write(&intBuffer, hostendian.Order, &event)
require.NoError(t, err)
copy(buf, intBuffer.Bytes())
})
Expand Down

0 comments on commit d05503d

Please sign in to comment.