Commit ed70a631 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 3f5969b5
...@@ -9,8 +9,6 @@ import ( ...@@ -9,8 +9,6 @@ import (
"errors" "errors"
"io" "io"
"testing" "testing"
//"fmt"
) )
...@@ -38,7 +36,6 @@ func (r *XReader) ReadAt(p []byte, pos int64) (n int, err error) { ...@@ -38,7 +36,6 @@ func (r *XReader) ReadAt(p []byte, pos int64) (n int, err error) {
err = io.EOF err = io.EOF
} }
//fmt.Printf("xread @%v #%v -> %v %#v\n", pos0, len(p), p[:n], err)
return n, err return n, err
} }
...@@ -60,29 +57,22 @@ func TestSeqBufReader(t *testing.T) { ...@@ -60,29 +57,22 @@ func TestSeqBufReader(t *testing.T) {
{101, 5, 92, 8}, // EIO again {101, 5, 92, 8}, // EIO again
{105, 5, 105, 10}, // past EIO range - buffer refilled {105, 5, 105, 10}, // past EIO range - buffer refilled
{110,70, 105, 10}, // very big access forward, buf untouched {110,70, 105, 10}, // very big access forward, buf untouched
{180,11, 105, 10}, // big access ~ forward {180,70, 105, 10}, // big access ~ forward
// TODO access near EOF - buffer fill hits EOF, but not returns it to client
// TODO access overlapping EOF - EOF returned
{170,11, 105, 10}, // big access backward {170,11, 105, 10}, // big access backward
{160,11, 105, 10}, // big access backward, once more {160,11, 105, 10}, // big access backward, once more
{155, 5, 155, 10}, // access backward - buffer refilled {155, 5, 155, 10}, // access backward - buffer refilled
// XXX refilled forward first time after big backward readings // XXX refilled forward first time after big backward readings
{150, 5, 145, 10}, // next access backward - buffer refilled backward {150, 5, 145, 10}, // next access backward - buffer refilled backward
{143, 7, 135, 10}, // backward once again - buffer refilled backward
// big backward {250, 4, 250, 6}, // access near EOF - buffer fill hits EOF, but not returns it to client
// small backward - refilled backward {254, 5, 250, 6}, // access overlapping EOF - EOF returned
// XXX big access going backward - detect dir change
// TODO overlap
} }
for _, tt := range testv { for _, tt := range testv {
pOk := make([]byte, tt.Len) pOk := make([]byte, tt.Len)
pB := make([]byte, tt.Len) pB := make([]byte, tt.Len)
//fmt.Println("\n", tt)
nOk, errOk := r.ReadAt(pOk, tt.pos) nOk, errOk := r.ReadAt(pOk, tt.pos)
nB, errB := rb.ReadAt(pB, tt.pos) nB, errB := rb.ReadAt(pB, tt.pos)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment