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
5438d55d
Commit
5438d55d
authored
Feb 22, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3b98998d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
t/neo/storage/fs1/filestorage.go
t/neo/storage/fs1/filestorage.go
+13
-3
t/neo/storage/fs1/filestorage_test.go
t/neo/storage/fs1/filestorage_test.go
+1
-1
No files found.
t/neo/storage/fs1/filestorage.go
View file @
5438d55d
...
@@ -203,11 +203,21 @@ func (fs *FileStorage) Load(xid zodb.Xid) (data []byte, tid zodb.Tid, err error)
...
@@ -203,11 +203,21 @@ func (fs *FileStorage) Load(xid zodb.Xid) (data []byte, tid zodb.Tid, err error)
return
nil
,
zodb
.
Tid
(
0
),
&
ErrXidLoad
{
xid
,
&
zodb
.
ErrXidMissing
{
Xid
:
xid
}}
return
nil
,
zodb
.
Tid
(
0
),
&
ErrXidLoad
{
xid
,
&
zodb
.
ErrXidMissing
{
Xid
:
xid
}}
}
}
// now read actual data / scan via backpointers
// scan via backpointers
if
dh
.
DataLen
==
0
{
for
dh
.
DataLen
==
0
{
// backpointer - TODO
var
xxx
[
8
]
byte
// XXX escapes ?
_
,
err
=
fs
.
f
.
ReadAt
(
xxx
[
:
],
dataPos
+
DataHeaderSize
)
if
err
!=
nil
{
panic
(
err
)
// XXX
}
dataPos
=
int64
(
binary
.
BigEndian
.
Uint64
(
xxx
[
:
]))
err
=
dh
.
Decode
(
fs
.
f
,
dataPos
)
if
err
!=
nil
{
panic
(
err
)
// XXX
}
}
}
// now read actual data
data
=
make
([]
byte
,
dh
.
DataLen
)
// TODO -> slab ?
data
=
make
([]
byte
,
dh
.
DataLen
)
// TODO -> slab ?
n
,
err
:=
fs
.
f
.
ReadAt
(
data
,
dataPos
+
DataHeaderSize
)
n
,
err
:=
fs
.
f
.
ReadAt
(
data
,
dataPos
+
DataHeaderSize
)
if
n
==
len
(
data
)
{
if
n
==
len
(
data
)
{
...
...
t/neo/storage/fs1/filestorage_test.go
View file @
5438d55d
...
@@ -46,7 +46,7 @@ func TestLoad(t *testing.T) {
...
@@ -46,7 +46,7 @@ func TestLoad(t *testing.T) {
t
.
Errorf
(
"load %v: %v"
,
xid
,
err
)
t
.
Errorf
(
"load %v: %v"
,
xid
,
err
)
}
}
if
tid
!=
txh
.
Tid
{
if
tid
!=
txh
.
Tid
{
t
.
Errorf
(
"load %v: returned tid unexpected: %v"
,
xid
)
t
.
Errorf
(
"load %v: returned tid unexpected: %v"
,
xid
,
tid
)
}
}
if
!
bytes
.
Equal
(
data
,
txe
.
Data
())
{
if
!
bytes
.
Equal
(
data
,
txe
.
Data
())
{
t
.
Errorf
(
"load %v: different data:
\n
have: %s
\n
want: %s"
,
xid
,
strconv
.
Quote
(
string
(
data
)),
strconv
.
Quote
(
string
(
txe
.
Data
())))
t
.
Errorf
(
"load %v: different data:
\n
have: %s
\n
want: %s"
,
xid
,
strconv
.
Quote
(
string
(
data
)),
strconv
.
Quote
(
string
(
txe
.
Data
())))
...
...
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