diff options
author | Russ Cox <rsc@golang.org> | 2009-11-12 14:55:04 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-11-12 14:55:04 -0800 |
commit | b0c7d680525d46d40fab09a4c68131ccbcd3254d (patch) | |
tree | 10b89e5cb619388580d69ed84fcb93d965d66cb4 | |
parent | ce0a4bae41c310f96b86322007e87b2fb0a29781 (diff) | |
download | go-b0c7d680525d46d40fab09a4c68131ccbcd3254d.tar.gz go-b0c7d680525d46d40fab09a4c68131ccbcd3254d.zip |
os.TestSeek: use a smaller but still 64-bit seek offset.
Might fix issue 91.
R=r
https://golang.org/cl/152108
-rw-r--r-- | src/pkg/os/os_test.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/pkg/os/os_test.go b/src/pkg/os/os_test.go index 57081afb4e..8c39019810 100644 --- a/src/pkg/os/os_test.go +++ b/src/pkg/os/os_test.go @@ -541,13 +541,18 @@ func TestSeek(t *testing.T) { test{0, 2, int64(len(data))}, test{0, 0, 0}, test{-1, 2, int64(len(data)) - 1}, - test{1 << 40, 0, 1 << 40}, - test{1 << 40, 2, 1<<40 + int64(len(data))}, + test{1 << 33, 0, 1 << 33}, + test{1 << 33, 2, 1<<33 + int64(len(data))}, }; for i, tt := range tests { off, err := f.Seek(tt.in, tt.whence); if off != tt.out || err != nil { - t.Errorf("#%d: Seek(%v, %v) = %v, %v want %v, nil", i, tt.in, tt.whence, off, err, tt.out) + if e, ok := err.(*PathError); ok && e.Error == EINVAL && tt.out > 1<<32 { + // Reiserfs rejects the big seeks. + // http://code.google.com/p/go/issues/detail?id=91 + break + } + t.Errorf("#%d: Seek(%v, %v) = %v, %v want %v, nil", i, tt.in, tt.whence, off, err, tt.out); } } f.Close(); |