diff options
author | Tamir Duberstein <tamird@google.com> | 2018-09-14 16:38:45 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-09-14 16:39:56 -0700 |
commit | 75c66f871b56a8f4e83dc9ccec29cf3d2c38fea4 (patch) | |
tree | 137a5e51dcc786e76bc96e34ac36be8fdb5ac304 /pkg/tcpip/link/fdbased/endpoint_test.go | |
parent | 3aa50f18a4102429aa40f5d0e518357ceaed2373 (diff) |
Remove buffer.Prependable.UsedBytes
It is the same as buffer.Prependable.View.
PiperOrigin-RevId: 213064166
Change-Id: Ib33b8a2c4da864209d9a0be0a1c113be10b520d3
Diffstat (limited to 'pkg/tcpip/link/fdbased/endpoint_test.go')
-rw-r--r-- | pkg/tcpip/link/fdbased/endpoint_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/tcpip/link/fdbased/endpoint_test.go b/pkg/tcpip/link/fdbased/endpoint_test.go index f7890e031..411ad7832 100644 --- a/pkg/tcpip/link/fdbased/endpoint_test.go +++ b/pkg/tcpip/link/fdbased/endpoint_test.go @@ -17,6 +17,7 @@ package fdbased import ( + "bytes" "fmt" "math/rand" "reflect" @@ -157,7 +158,7 @@ func TestWritePacket(t *testing.T) { for i := range payload { payload[i] = uint8(rand.Intn(256)) } - want := append(hdr.UsedBytes(), payload...) + want := append(hdr.View(), payload...) if err := c.ep.WritePacket(r, hdr, payload.ToVectorisedView(), proto); err != nil { t.Fatalf("WritePacket failed: %v", err) } @@ -188,7 +189,7 @@ func TestWritePacket(t *testing.T) { if len(b) != len(want) { t.Fatalf("Read returned %v bytes, want %v", len(b), len(want)) } - if !reflect.DeepEqual(b, want) { + if !bytes.Equal(b, want) { t.Fatalf("Read returned %x, want %x", b, want) } }) |