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
c77264f9
Commit
c77264f9
authored
Feb 23, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
515220ef
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
400 additions
and
284 deletions
+400
-284
t/neo/storage/fs1/filestorage_test.go
t/neo/storage/fs1/filestorage_test.go
+5
-4
t/neo/storage/fs1/py/gen-testdata
t/neo/storage/fs1/py/gen-testdata
+8
-5
t/neo/storage/fs1/testdata_expect_test.go
t/neo/storage/fs1/testdata_expect_test.go
+387
-275
No files found.
t/neo/storage/fs1/filestorage_test.go
View file @
c77264f9
...
@@ -4,6 +4,7 @@ package fs1
...
@@ -4,6 +4,7 @@ package fs1
import
(
import
(
"bytes"
"bytes"
"reflect"
"testing"
"testing"
"../../zodb"
"../../zodb"
...
@@ -103,6 +104,7 @@ func TestLoad(t *testing.T) {
...
@@ -103,6 +104,7 @@ func TestLoad(t *testing.T) {
for
i
,
tidMin
:=
range
tidv
{
for
i
,
tidMin
:=
range
tidv
{
for
j
,
tidMax
:=
range
tidv
{
for
j
,
tidMax
:=
range
tidv
{
_
=
j
// XXX
iter
:=
fs
.
Iterate
(
tidMin
,
tidMax
)
iter
:=
fs
.
Iterate
(
tidMin
,
tidMax
)
if
tidMin
>
tidMax
{
if
tidMin
>
tidMax
{
...
@@ -111,24 +113,23 @@ func TestLoad(t *testing.T) {
...
@@ -111,24 +113,23 @@ func TestLoad(t *testing.T) {
txni
:=
zodb
.
TxnInfo
{}
txni
:=
zodb
.
TxnInfo
{}
datai
:=
zodb
.
StorageRecordInformation
{}
datai
:=
zodb
.
StorageRecordInformation
{}
var
stop
bool
// XXX vvv assumes i < j
// XXX vvv assumes i < j
// FIXME first tidMin and last tidMax
// FIXME first tidMin and last tidMax
for
k
:=
i
;
;
k
++
{
for
k
:=
i
;
;
k
++
{
stop
,
err
=
iter
.
NextTxn
(
&
txni
)
dataIter
,
stop
,
err
:
=
iter
.
NextTxn
(
&
txni
)
if
stop
||
err
!=
nil
{
if
stop
||
err
!=
nil
{
break
break
}
}
dbe
=
_1fs_dbEntryv
[
k
]
dbe
:
=
_1fs_dbEntryv
[
k
]
if
!
reflect
.
DeepEqual
(
txni
,
dbe
.
Header
.
TxnInfo
)
{
if
!
reflect
.
DeepEqual
(
txni
,
dbe
.
Header
.
TxnInfo
)
{
t
.
Errorf
(
"iterating tidMin..tidMac (TODO): step XXX: unexpected txn entry.
\n
have: %v
\n
want: %v"
,
txni
,
dbe
.
Header
.
TxnInfo
)
t
.
Errorf
(
"iterating tidMin..tidMac (TODO): step XXX: unexpected txn entry.
\n
have: %v
\n
want: %v"
,
txni
,
dbe
.
Header
.
TxnInfo
)
}
}
for
{
for
{
stop
,
err
=
txni
.
Iter
.
NextData
(
&
datai
)
stop
,
err
=
data
Iter
.
NextData
(
&
datai
)
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
err
)
// XXX
panic
(
err
)
// XXX
}
}
...
...
t/neo/storage/fs1/py/gen-testdata
View file @
c77264f9
...
@@ -104,6 +104,7 @@ def main():
...
@@ -104,6 +104,7 @@ def main():
print
>>
f
,
v
print
>>
f
,
v
emit
(
"// DO NOT EDIT - AUTOGENERATED (by py/gen-testdata)"
)
emit
(
"// DO NOT EDIT - AUTOGENERATED (by py/gen-testdata)"
)
emit
(
"package fs1
\
n
"
)
emit
(
"package fs1
\
n
"
)
emit
(
"import
\
"
../../zodb
\
"
\
n
"
)
# index
# index
emit
(
"const _1fs_indexTopPos = %i"
%
stor
.
_pos
)
emit
(
"const _1fs_indexTopPos = %i"
%
stor
.
_pos
)
...
@@ -128,12 +129,14 @@ def main():
...
@@ -128,12 +129,14 @@ def main():
# -> TxnHeader
# -> TxnHeader
emit
(
"
\
t
\
t
TxnHeader{"
)
emit
(
"
\
t
\
t
TxnHeader{"
)
emit
(
"
\
t
\
t
\
t
Tid:
\
t
%s,"
%
hex64
(
txn
.
tid
))
emit
(
"
\
t
\
t
\
t
RecLenm8:
\
t
%i,"
%
th
.
tlen
)
emit
(
"
\
t
\
t
\
t
RecLenm8:
\
t
%i,"
%
th
.
tlen
)
emit
(
"
\
t
\
t
\
t
Status:
\
t
'%s',"
%
txn
.
status
)
emit
(
"
\
t
\
t
\
t
TxnInfo:
\
t
zodb.TxnInfo{"
)
emit
(
"
\
t
\
t
\
t
User:
\
t
\
t
[]byte(%s),"
%
escapeqq
(
txn
.
user
))
emit
(
"
\
t
\
t
\
t
\
t
Tid:
\
t
%s,"
%
hex64
(
txn
.
tid
))
emit
(
"
\
t
\
t
\
t
Description:
\
t
[]byte(%s),"
%
escapeqq
(
txn
.
description
))
emit
(
"
\
t
\
t
\
t
\
t
Status:
\
t
'%s',"
%
txn
.
status
)
emit
(
"
\
t
\
t
\
t
Extension:
\
t
[]byte(%s),"
%
escapeqq
(
th
.
ext
))
emit
(
"
\
t
\
t
\
t
\
t
User:
\
t
\
t
[]byte(%s),"
%
escapeqq
(
txn
.
user
))
emit
(
"
\
t
\
t
\
t
\
t
Description:
\
t
[]byte(%s),"
%
escapeqq
(
txn
.
description
))
emit
(
"
\
t
\
t
\
t
\
t
Extension:
\
t
[]byte(%s),"
%
escapeqq
(
th
.
ext
))
emit
(
"
\
t
\
t
\
t
},"
)
emit
(
"
\
t
\
t
},"
)
emit
(
"
\
t
\
t
},"
)
# -> DataHeader + payload
# -> DataHeader + payload
...
...
t/neo/storage/fs1/testdata_expect_test.go
View file @
c77264f9
This diff is collapsed.
Click to expand it.
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