Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
ed70a631
Commit
ed70a631
authored
Mar 23, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3f5969b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
14 deletions
+4
-14
t/neo/storage/fs1/xbufio_test.go
t/neo/storage/fs1/xbufio_test.go
+4
-14
No files found.
t/neo/storage/fs1/xbufio_test.go
View file @
ed70a631
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment