summaryrefslogtreecommitdiffhomepage
path: root/pkg/usermem/usermem_test.go
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2021-03-29 13:28:32 -0700
committergVisor bot <gvisor-bot@google.com>2021-03-29 13:30:21 -0700
commit8a2f7e716dcc62f04d2808e8ade34941c94fc956 (patch)
treeb2195d5728dcbc4f4e59c23ad95d7486ef744371 /pkg/usermem/usermem_test.go
parentb125afba416ebeba906ea595a44a55afe4729d64 (diff)
[syserror] Split usermem package
Split usermem package to help remove syserror dependency in go_marshal. New hostarch package contains code not dependent on syserror. PiperOrigin-RevId: 365651233
Diffstat (limited to 'pkg/usermem/usermem_test.go')
-rw-r--r--pkg/usermem/usermem_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/usermem/usermem_test.go b/pkg/usermem/usermem_test.go
index da60b0cc7..9b697b593 100644
--- a/pkg/usermem/usermem_test.go
+++ b/pkg/usermem/usermem_test.go
@@ -22,6 +22,7 @@ import (
"testing"
"gvisor.dev/gvisor/pkg/context"
+ "gvisor.dev/gvisor/pkg/hostarch"
"gvisor.dev/gvisor/pkg/safemem"
"gvisor.dev/gvisor/pkg/syserror"
)
@@ -106,7 +107,7 @@ func TestBytesIOZeroOutFailure(t *testing.T) {
func TestBytesIOCopyOutFromSuccess(t *testing.T) {
b := newBytesIOString("ABCDEFGH")
- n, err := b.CopyOutFrom(newContext(), AddrRangeSeqFromSlice([]AddrRange{
+ n, err := b.CopyOutFrom(newContext(), hostarch.AddrRangeSeqFromSlice([]hostarch.AddrRange{
{Start: 4, End: 7},
{Start: 1, End: 4},
}), safemem.FromIOReader{bytes.NewBufferString("barfoo")}, IOOpts{})
@@ -120,7 +121,7 @@ func TestBytesIOCopyOutFromSuccess(t *testing.T) {
func TestBytesIOCopyOutFromFailure(t *testing.T) {
b := newBytesIOString("ABCDE")
- n, err := b.CopyOutFrom(newContext(), AddrRangeSeqFromSlice([]AddrRange{
+ n, err := b.CopyOutFrom(newContext(), hostarch.AddrRangeSeqFromSlice([]hostarch.AddrRange{
{Start: 1, End: 4},
{Start: 4, End: 7},
}), safemem.FromIOReader{bytes.NewBufferString("foobar")}, IOOpts{})
@@ -135,7 +136,7 @@ func TestBytesIOCopyOutFromFailure(t *testing.T) {
func TestBytesIOCopyInToSuccess(t *testing.T) {
b := newBytesIOString("AfoobarH")
var dst bytes.Buffer
- n, err := b.CopyInTo(newContext(), AddrRangeSeqFromSlice([]AddrRange{
+ n, err := b.CopyInTo(newContext(), hostarch.AddrRangeSeqFromSlice([]hostarch.AddrRange{
{Start: 4, End: 7},
{Start: 1, End: 4},
}), safemem.FromIOWriter{&dst}, IOOpts{})
@@ -150,7 +151,7 @@ func TestBytesIOCopyInToSuccess(t *testing.T) {
func TestBytesIOCopyInToFailure(t *testing.T) {
b := newBytesIOString("Afoob")
var dst bytes.Buffer
- n, err := b.CopyInTo(newContext(), AddrRangeSeqFromSlice([]AddrRange{
+ n, err := b.CopyInTo(newContext(), hostarch.AddrRangeSeqFromSlice([]hostarch.AddrRange{
{Start: 1, End: 4},
{Start: 4, End: 7},
}), safemem.FromIOWriter{&dst}, IOOpts{})